diff options
| author | Qasim Ijaz <[email protected]> | 2025-04-22 13:47:17 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-04-25 11:21:35 +0000 |
| commit | f4239ace2dd8606f6824757f192965a95746da05 (patch) | |
| tree | b33d71193ef27dccd3c301adc134288a1f85332b /drivers/fpga/tests/fpga-bridge-test.c | |
| parent | usb: gadget: udc: renesas_usb3: remove unnecessary NULL check before phy_exit() (diff) | |
| download | kernel-f4239ace2dd8606f6824757f192965a95746da05.tar.gz kernel-f4239ace2dd8606f6824757f192965a95746da05.zip | |
usb: typec: ucsi: fix Clang -Wsign-conversion warning
debugfs.c emits the following warnings when compiling with the -Wsign-conversion flag with clang 15:
drivers/usb/typec/ucsi/debugfs.c:58:27: warning: implicit conversion changes signedness: 'int' to 'u32' (aka 'unsigned int') [-Wsign-conversion]
ucsi->debugfs->status = ret;
~ ^~~
drivers/usb/typec/ucsi/debugfs.c:71:25: warning: implicit conversion changes signedness: 'u32' (aka 'unsigned int') to 'int' [-Wsign-conversion]
return ucsi->debugfs->status;
~~~~~~ ~~~~~~~~~~~~~~~^~~~~~
During ucsi_cmd() we see:
if (ret < 0) {
ucsi->debugfs->status = ret;
return ret;
}
But "status" is u32 meaning unsigned wrap-around occurs when assigning a value which is < 0 to it, this obscures the real status.
To fix this make the "status" of type int since ret is also of type int.
Fixes: df0383ffad64 ("usb: typec: ucsi: Add debugfs for ucsi commands")
Cc: [email protected]
Signed-off-by: Qasim Ijaz <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-bridge-test.c')
0 files changed, 0 insertions, 0 deletions
