Content-Type: multipart/mixed; boundary="===============1745218158093860782==" MIME-Version: 1.0 From: Julia Lawall To: kbuild-all@lists.01.org Subject: [PATCH] NOUPSTREAM: ANDROID: usb: gadget: configfs: fix itnull.cocci warnings (fwd) Date: Fri, 10 Dec 2021 23:25:41 +0100 Message-ID: List-Id: --===============1745218158093860782== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hello, The patch with the call to BAD is a Coccinelle hack, but it remains the case that fi cannot be NULL in the first line of the body of the list_for_each loop. julia ---------- Forwarded message ---------- Date: Tue, 7 Dec 2021 18:50:38 +0800 From: kernel test robot To: kbuild(a)lists.01.org Cc: lkp(a)intel.com, Julia Lawall Subject: [PATCH] NOUPSTREAM: ANDROID: usb: gadget: configfs: fix itnull.coc= ci warnings CC: kbuild-all(a)lists.01.org TO: cros-kernel-buildreports(a)googlegroups.com TO: Guenter Roeck From: kernel test robot drivers/usb/gadget/configfs.c:1554:6-8: ERROR: iterator variable bound on l= ine 1553 cannot be NULL Many iterators have the property that the first argument is always bound to a real list element, never NULL. Semantic patch information: False positives arise for some iterators that do not have this property, or in cases when the loop cursor is reassigned. The latter should only happen when the matched code is on the way to a loop exit (break, goto, or return). Generated by: scripts/coccinelle/iterators/itnull.cocci CC: Badhri Jagan Sridharan Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chr= omeos-5.15 head: 617fec3654adc5dfc39d303b5b371fc4e1be600b commit: db87c70afb233e6f6c5fb8164f92b1bef4690a1b [1992/2561] NOUPSTREAM: AN= DROID: usb: gadget: configfs: Add Uevent to notify userspace :::::: branch date: 8 hours ago :::::: commit date: 2 weeks ago Please take the patch only if it's a positive warning. Thanks! configfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1551,7 +1551,7 @@ static int android_setup(struct usb_gadg } spin_unlock_irqrestore(&cdev->lock, flags); list_for_each_entry(fi, &gi->available_func, cfs_list) { - if (fi !=3D NULL && fi->f !=3D NULL && fi->f->setup !=3D NULL) { + if (BAD(fi !=3D NULL) && fi->f !=3D NULL && fi->f->setup !=3D NULL) { value =3D fi->f->setup(fi->f, c); if (value >=3D 0) break; --===============1745218158093860782==--