public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: rndis: fix itnull.cocci warnings
@ 2015-12-18 20:07 Julia Lawall
  2015-12-22 18:10 ` Felipe Balbi
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2015-12-18 20:07 UTC (permalink / raw)
  To: Geliang Tang
  Cc: Felipe Balbi, Greg Kroah-Hartman, Andrzej Pietrasiewicz,
	linux-usb, linux-kernel, kbuild-all

The index variable of list_for_each_entry_safe is never NULL.

Generated by: scripts/coccinelle/iterators/itnull.cocci

CC: Geliang Tang <geliangtang@163.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

 rndis.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/gadget/function/rndis.c
+++ b/drivers/usb/gadget/function/rndis.c
@@ -1009,7 +1009,7 @@ void rndis_free_response(struct rndis_pa
 	rndis_resp_t *r, *n;
 
 	list_for_each_entry_safe(r, n, &params->resp_queue, list) {
-		if (r && r->buf == buf) {
+		if (r->buf == buf) {
 			list_del(&r->list);
 			kfree(r);
 		}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings
  2015-12-18 20:07 [PATCH] usb: gadget: rndis: fix itnull.cocci warnings Julia Lawall
@ 2015-12-22 18:10 ` Felipe Balbi
  2015-12-22 18:17   ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2015-12-22 18:10 UTC (permalink / raw)
  To: Julia Lawall, Geliang Tang
  Cc: Greg Kroah-Hartman, Andrzej Pietrasiewicz, linux-usb,
	linux-kernel, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

Julia Lawall <julia.lawall@lip6.fr> writes:

> The index variable of list_for_each_entry_safe is never NULL.
>
> Generated by: scripts/coccinelle/iterators/itnull.cocci
>
> CC: Geliang Tang <geliangtang@163.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>

doesn't apply. Does this depend on anything ?

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings
  2015-12-22 18:10 ` Felipe Balbi
@ 2015-12-22 18:17   ` Julia Lawall
  2015-12-22 18:28     ` Felipe Balbi
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2015-12-22 18:17 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Geliang Tang, Greg Kroah-Hartman, Andrzej Pietrasiewicz,
	linux-usb, linux-kernel, kbuild-all



On Tue, 22 Dec 2015, Felipe Balbi wrote:

> Julia Lawall <julia.lawall@lip6.fr> writes:
>
> > The index variable of list_for_each_entry_safe is never NULL.
> >
> > Generated by: scripts/coccinelle/iterators/itnull.cocci
> >
> > CC: Geliang Tang <geliangtang@163.com>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> > Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>
> doesn't apply. Does this depend on anything ?

It may be derived from a patch posted to a mailing list.  I don't have the
original reference any more.

julia

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] usb: gadget: rndis: fix itnull.cocci warnings
  2015-12-22 18:17   ` Julia Lawall
@ 2015-12-22 18:28     ` Felipe Balbi
  0 siblings, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2015-12-22 18:28 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Geliang Tang, Greg Kroah-Hartman, Andrzej Pietrasiewicz,
	linux-usb, linux-kernel, kbuild-all

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]


Hi,

Julia Lawall <julia.lawall@lip6.fr> writes:
> On Tue, 22 Dec 2015, Felipe Balbi wrote:
>
>> Julia Lawall <julia.lawall@lip6.fr> writes:
>>
>> > The index variable of list_for_each_entry_safe is never NULL.
>> >
>> > Generated by: scripts/coccinelle/iterators/itnull.cocci
>> >
>> > CC: Geliang Tang <geliangtang@163.com>
>> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>> > Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>>
>> doesn't apply. Does this depend on anything ?
>
> It may be derived from a patch posted to a mailing list.  I don't have the
> original reference any more.

okay, it could be the big series converting gadgets to
list_for_each_entry_safe(). Thanks

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] usb: gadget: rndis: fix itnull.cocci warnings
@ 2016-01-25 15:21 Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2016-01-25 15:21 UTC (permalink / raw)
  To: Geliang Tang
  Cc: linux-usb, kbuild-all, Greg Kroah-Hartman, Felipe Balbi,
	Andrzej Pietrasiewicz, linux-usb, linux-kernel

The index variable of list_for_each_entry_safe is an offset from a list
pointer, and thus should not be NULL.

Generated by: scripts/coccinelle/iterators/itnull.cocci

CC: Geliang Tang <geliangtang@163.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
usb-testing
head:   0e781c2258ffb2a42bf44f62dea8662f38cbfd34
commit: f6281af9d62e128aa6efad29cf7265062af114f2 [27/38] usb: gadget:
rndis: use list_for_each_entry_safe

 rndis.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/gadget/function/rndis.c
+++ b/drivers/usb/gadget/function/rndis.c
@@ -1009,7 +1009,7 @@ void rndis_free_response(struct rndis_pa
 	rndis_resp_t *r, *n;

 	list_for_each_entry_safe(r, n, &params->resp_queue, list) {
-		if (r && r->buf == buf) {
+		if (r->buf == buf) {
 			list_del(&r->list);
 			kfree(r);
 		}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-25 15:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-18 20:07 [PATCH] usb: gadget: rndis: fix itnull.cocci warnings Julia Lawall
2015-12-22 18:10 ` Felipe Balbi
2015-12-22 18:17   ` Julia Lawall
2015-12-22 18:28     ` Felipe Balbi
  -- strict thread matches above, loose matches on Subject: below --
2016-01-25 15:21 Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox