Skip to contentSkip to conversation

f_ncm: ncm_bitrate (speed) is unsigned

PATCH In review Maciej Żenczykowski 2 participants 2 messages Jun 8, 2021 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f_ncm: ncm_bitrate (speed) is unsigned

From: Maciej Żenczykowski <[email protected]>

[  190.544755] configfs-gadget gadget: notify speed -44967296

This is because 4250000000 - 2**32 is -44967296.

Cc Brooke Basile <[email protected]>
Cc Bryan O'Donoghue <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Lorenzo Colitti <[email protected]>
Cc Yauheni Kaliuta <[email protected]>
Cc Linux USB Mailing List <[email protected]>
Fixes 9f6ce4240a2b ("usb: gadget: f_ncm.c added")
---
 drivers/usb/gadget/function/f_ncm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/function/f_ncm.c +1 -1
index 019bea8e09cc..0d23c6c11a13 100644
@@ -583,7 +583,7 @@ static void ncm_do_notify(struct f_ncm *ncm)
 		data[0] = cpu_to_le32(ncm_bitrate(cdev->gadget));
 		data[1] = data[0];
 
-		DBG(cdev, "notify speed %d\n", ncm_bitrate(cdev->gadget));
+		DBG(cdev, "notify speed %u\n", ncm_bitrate(cdev->gadget));
 		ncm->notify_state = NCM_NOTIFY_CONNECT;
 		break;
 	}
Signature · 1 line
2.32.0.rc1.229.g3e70b5a671-goog
Acked-by on v1 1/1
#1 lore raw

drivers/usb/gadget/function/f_ncm.c static void ncm_do_notify(struct f_ncm *ncm) · line 589

Quoted 11 lines · Maciej Żenczykowski
drivers/usb/gadget/function/f_ncm.c +1 -1
@@ -583,7 +583,7 @@ static void ncm_do_notify(struct f_ncm *ncm)
                data[0] = cpu_to_le32(ncm_bitrate(cdev->gadget));
                data[1] = data[0];
 
-               DBG(cdev, "notify speed %d\n", ncm_bitrate(cdev->gadget));
+               DBG(cdev, "notify speed %u\n", ncm_bitrate(cdev->gadget));
                ncm->notify_state = NCM_NOTIFY_CONNECT;
                break;
        }