usb: musb-new: Cannot test unsigned member to be negative
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 30 Sep 2025 15:52:24 +0000 (16:52 +0100)
committerMarek Vasut <marek.vasut+usb@mailbox.org>
Tue, 28 Oct 2025 15:35:05 +0000 (16:35 +0100)
commit41fd18219fb6625171180a21d0e4f17e9b7b5aa2
tree851d8e7fe4d5887427f68d66fa742f3e3850bc6f
parentd5de67c57e795325a67ec4ca6486654b72ade038
usb: musb-new: Cannot test unsigned member to be negative

You cannot test an unsigned member of a struct for being negative, the
test will always fail. Instead assign the return value of
fdtdec_get_int, which returns an int, to a temporary variable declared
as an int, so that it can be tested for being negative before being
assigned to the unsigned struct member.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/usb/musb-new/omap2430.c
drivers/usb/musb-new/ti-musb.c