From patchwork Mon Oct 31 10:49:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 80155 Delivered-To: patch@linaro.org Received: by 10.80.142.83 with SMTP id 19csp66013edx; Mon, 31 Oct 2016 03:52:17 -0700 (PDT) X-Received: by 10.98.149.140 with SMTP id c12mr1782621pfk.100.1477911136941; Mon, 31 Oct 2016 03:52:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c22si8064156pfk.219.2016.10.31.03.52.16; Mon, 31 Oct 2016 03:52:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936336AbcJaKwO (ORCPT + 4 others); Mon, 31 Oct 2016 06:52:14 -0400 Received: from mga07.intel.com ([134.134.136.100]:56068 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936266AbcJaKwM (ORCPT ); Mon, 31 Oct 2016 06:52:12 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 31 Oct 2016 03:52:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,426,1473145200"; d="scan'208";a="26014336" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.68.37]) by orsmga004.jf.intel.com with ESMTP; 31 Oct 2016 03:52:10 -0700 From: Felipe Balbi To: Linux USB Cc: Masahiro Yamada , Felipe Balbi Subject: [PATCH 70/82] usb: renesas_usbhs: cleanup with list_first_entry_or_null() Date: Mon, 31 Oct 2016 12:49:02 +0200 Message-Id: <20161031104914.1990-71-felipe.balbi@linux.intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161031104914.1990-1-felipe.balbi@linux.intel.com> References: <20161031104914.1990-1-felipe.balbi@linux.intel.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Masahiro Yamada The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Acked-by: Yoshihiro Shimoda Signed-off-by: Masahiro Yamada Signed-off-by: Felipe Balbi --- drivers/usb/renesas_usbhs/fifo.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.10.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 857e78337324..d1af831f43eb 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -100,10 +100,7 @@ static void __usbhsf_pkt_del(struct usbhs_pkt *pkt) static struct usbhs_pkt *__usbhsf_pkt_get(struct usbhs_pipe *pipe) { - if (list_empty(&pipe->list)) - return NULL; - - return list_first_entry(&pipe->list, struct usbhs_pkt, node); + return list_first_entry_or_null(&pipe->list, struct usbhs_pkt, node); } static void usbhsf_fifo_clear(struct usbhs_pipe *pipe,