mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: fix static analysis false positive
@ 2024-10-14 12:50 Ahmad Fatoum
  2024-10-15  7:17 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-10-14 12:50 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

On 32-bit systems, the 32-bit-wide buf can never exceed 0xffffffff,
so this resulted in a warning. Fix this by using upper_32_bits()
instead, which is also easier to read.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/usb/gadget/udc/fsl_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc.c b/drivers/usb/gadget/udc/fsl_udc.c
index e1d0d0b48272..30f4da0c41e7 100644
--- a/drivers/usb/gadget/udc/fsl_udc.c
+++ b/drivers/usb/gadget/udc/fsl_udc.c
@@ -780,7 +780,7 @@ static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req,
 
 	/* Init all of buffer page pointers */
 	buf = (unsigned long)req->req.buf;
-	if (buf > 0xffffffff) {
+	if (upper_32_bits(buf)) {
 		pr_err("Only 32bit supported\n");
 		return NULL;
 	}
-- 
2.39.5




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

* Re: [PATCH] usb: gadget: fix static analysis false positive
  2024-10-14 12:50 [PATCH] usb: gadget: fix static analysis false positive Ahmad Fatoum
@ 2024-10-15  7:17 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-10-15  7:17 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Mon, 14 Oct 2024 14:50:25 +0200, Ahmad Fatoum wrote:
> On 32-bit systems, the 32-bit-wide buf can never exceed 0xffffffff,
> so this resulted in a warning. Fix this by using upper_32_bits()
> instead, which is also easier to read.
> 
> 

Applied, thanks!

[1/1] usb: gadget: fix static analysis false positive
      https://git.pengutronix.de/cgit/barebox/commit/?id=9899233fafb9 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2024-10-15  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-14 12:50 [PATCH] usb: gadget: fix static analysis false positive Ahmad Fatoum
2024-10-15  7:17 ` Sascha Hauer

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