Skip to contentSkip to conversation

usb: gadget: Fix unsigned comparison with less than zero

PATCH In review Jiapeng Chong 2 participants 4 messages Jun 23, 2022 – Jun 29, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: gadget: Fix unsigned comparison with less than zero

This was found by coccicheck:

./drivers/usb/gadget/udc/aspeed_udc.c:496:8-13: WARNING: Unsigned expression compared with zero: chunk >= 0.

---
 drivers/usb/gadget/udc/aspeed_udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/udc/aspeed_udc.c +2 -2
index 1fc15228ff15..387a7abdcee4 100644
@@ -476,8 +476,8 @@ static int ast_dma_descriptor_setup(struct ast_udc_ep *ep, u32 dma_buf,
 {
 	struct ast_udc_dev *udc = ep->udc;
 	struct device *dev = &udc->pdev->dev;
-	u32 offset, chunk;
-	int count, last;
+	u32 offset;
+	int count, last, chunk;
 
 	if (!ep->descs) {
 		dev_warn(dev, "%s: Empty DMA descs list failure\n",
Signature · 1 line
2.20.1.7.g153144c
maintainer
#1 lore raw
Quoted 3 lines · Jiapeng Chong

This was found by coccicheck:

./drivers/usb/gadget/udc/aspeed_udc.c:496:8-13: WARNING: Unsigned expression compared with zero: chunk >= 0.

What does this mean? Where is the error?

Please explain the reason for changes, not just the output of a random tool that you ran on the code.

Quoted 1 line

What commit does this fix?

thanks,

greg k-h

#2 lore raw

Sorry, we didn't see this patch.
commit c09b1f372e746aeeb61ef8ffe0fea3970fd9273e

------------------------------------------------------------------
????Greg KH <[email protected]>
?????2022?6?24?(???) 19:45
????Jiapeng Chong <[email protected]>
????neal_liu <[email protected]>; balbi <[email protected]>; joel <[email protected]>; andrew <[email protected]>; sumit.semwal <[email protected]>; christian.koenig <[email protected]>; linux-aspeed <[email protected]>; linux-usb <[email protected]>; linux-arm-kernel <[email protected]>; linux-kernel <[email protected]>; linux-media <[email protected]>; dri-devel <[email protected]>; linaro-mm-sig <[email protected]> ????Re: [PATCH] usb: gadget: Fix unsigned comparison with less than zero

Quoted 3 lines · Jiapeng Chong

This was found by coccicheck:

./drivers/usb/gadget/udc/aspeed_udc.c:496:8-13: WARNING: Unsigned expression compared with zero: chunk >= 0.

What does this mean? Where is the error?

Please explain the reason for changes, not just the output of a random tool that you ran on the code.

Quoted 1 line

What commit does this fix?

thanks,

greg k-h

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20220629/cb6bd167/attachment-0001.htm>

maintainer
#3 lore raw
Quoted 2 lines · Jiapeng.Chong

Sorry, we didn't see this patch.
commit c09b1f372e746aeeb61ef8ffe0fea3970fd9273e

I am sorry, I do not understand what you mean here at all.

confused,

greg k-h