From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933689AbcKGTGX (ORCPT ); Mon, 7 Nov 2016 14:06:23 -0500 Received: from www.osadl.org ([62.245.132.105]:48043 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932849AbcKGTGU (ORCPT ); Mon, 7 Nov 2016 14:06:20 -0500 From: Nicholas Mc Guire To: Greg Kroah-Hartman Cc: Yoshihiro Shimoda , Felipe Balbi , Julia Lawall , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] usb: renesas_usbhs: simplify list handling Date: Mon, 7 Nov 2016 20:07:02 +0100 Message-Id: <1478545622-29591-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current code is effectively equivalent to list_first_entry_or_null() so simply switch and simplify the code. Fixes: 6acb95d4e070 ("usb: renesas_usbhs: modify packet queue control method") Signed-off-by: Nicholas Mc Guire --- Found by simple coccinelle scanner Compile tested with: multi_v7_defconfig (implies CONFIG_USB_RENESAS_USBHS=m) Patch is against 4.9.0-rc2 (localversion-next is next-20161028) drivers/usb/renesas_usbhs/fifo.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 857e783..d1af831 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, -- 1.7.10.4