Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1516500 > unrolled thread

[PATCH] usb: renesas_usbhs: simplify list handling

Started byNicholas Mc Guire <hofrat@osadl.org>
First post2016-11-07 20:10 +0100
Last post2016-11-08 08:20 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: renesas_usbhs: simplify list handling Nicholas Mc Guire <hofrat@osadl.org> - 2016-11-07 20:10 +0100
    RE: [PATCH] usb: renesas_usbhs: simplify list handling Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-11-08 03:20 +0100
      Re: [PATCH] usb: renesas_usbhs: simplify list handling Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-08 04:30 +0100
        Re: [PATCH] usb: renesas_usbhs: simplify list handling Nicholas Mc Guire <der.herr@hofr.at> - 2016-11-08 08:20 +0100

#1516500 — [PATCH] usb: renesas_usbhs: simplify list handling

FromNicholas Mc Guire <hofrat@osadl.org>
Date2016-11-07 20:10 +0100
Subject[PATCH] usb: renesas_usbhs: simplify list handling
Message-ID<sAXsS-7ns-25@gated-at.bofh.it>
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 <hofrat@osadl.org>
---
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

[toc] | [next] | [standalone]


#1516739

FromYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date2016-11-08 03:20 +0100
Message-ID<sB4aZ-3cW-5@gated-at.bofh.it>
In reply to#1516500
Hi,

> From: Nicholas Mc Guire
> Sent: Tuesday, November 08, 2016 4:07 AM
> 
> 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 <hofrat@osadl.org>
> ---
> 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)

Thank you for the patch!
However, such a patch is already merged in the Felipe's usb.git repository unfortunately...
https://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/commit/?h=testing/next&id=31faf878bd8c7e2c078a3b75f65efe64f23b0f18
So, the patch will appear in linux-next repository in the future.

Best regards,
Yoshihiro Shimoda

[toc] | [prev] | [next] | [standalone]


#1516762

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-11-08 04:30 +0100
Message-ID<sB5gJ-3TL-17@gated-at.bofh.it>
In reply to#1516739
>> Fixes: 6acb95d4e070 ("usb: renesas_usbhs: modify packet queue control method")


This is not a fix, but a clean-up patch.



>> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
>> ---
>> 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)
>
> Thank you for the patch!
> However, such a patch is already merged in the Felipe's usb.git repository unfortunately...
> https://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/commit/?h=testing/next&id=31faf878bd8c7e2c078a3b75f65efe64f23b0f18
> So, the patch will appear in linux-next repository in the future.


Likewise for
drivers/usb/dwc3/gadget.h
drivers/usb/dwc2/gadget.c


-- 
Best Regards
Masahiro Yamada

[toc] | [prev] | [next] | [standalone]


#1516898

FromNicholas Mc Guire <der.herr@hofr.at>
Date2016-11-08 08:20 +0100
Message-ID<sB8Rj-6fz-11@gated-at.bofh.it>
In reply to#1516762
On Tue, Nov 08, 2016 at 12:26:45PM +0900, Masahiro Yamada wrote:
> >> Fixes: 6acb95d4e070 ("usb: renesas_usbhs: modify packet queue control method")
> 
> 
> This is not a fix, but a clean-up patch.

true - I´ve been using it incorrectly to basically just record
the origin of the issue found - but looking at Submitting patches
this seems wrong.
In any case it would be interesting to be able to trace location
of where things go in that then need cleanups - is there an
alternative tag that could be used for that purpose ?

thx!
hofrat

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web