r8152: Return true/false (not 1/0) from bool functions
Subsystems (4)
PATCH 1/1 r8152: Return true/false (not 1/0) from bool functions
Return statements in functions returning bool should use true/false instead of 1/0.
Clean the following coccicheck warning:
./drivers/net/usb/r8152.c:9579:10-11: WARNING: return of 0/1 in function 'rtl8152_supports_lenovo_macpassthru' with return type bool.
--- drivers/net/usb/r8152.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/usb/r8152.c +3 -3
@@ -9576,15 +9576,15 @@ static bool rtl8152_supports_lenovo_macpassthru(struct usb_device *udev)case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2 :case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3 :case DEVICE_ID_THINKPAD_USB_C_DONGLE : -return 1 ; +return true; } }else if (vendor_id ==VENDOR_ID_REALTEK && parent_vendor_id ==VENDOR_ID_LENOVO ) {switch (product_id) {case 0x8153 : -return 1 ; +return true; } } -return 0 ; +return false; } static int rtl8152_probe(struct usb_interface *intf,
Signature · 1 line
2.20.1.7.g153144c
Paolo Abeni
maintainerQuoted 27 lines · Jiapeng Chong
Return statements in functions returning bool should use true/false instead of 1/0.
Clean the following coccicheck warning:
./drivers/net/usb/r8152.c:9579:10-11: WARNING: return of 0/1 in function '
rtl8152_supports_lenovo_macpassthru' with return type bool.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/net/usb/r8152.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/usb/r8152.c +1
-1@@ -9576,15 +9576,15 @@ static bool rtl8152_supports_lenovo_macpassthru(struct usb_device *udev)case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2 :case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3 :case DEVICE_ID_THINKPAD_USB_C_DONGLE : -return 1 ; +return true; } }else if (vendor_id ==VENDOR_ID_REALTEK && parent_vendor_id ==VENDOR_ID_LENOVO ) {switch (product_id) {
drivers/net/usb/r8152.c static bool rtl8152_supports_lenovo_macpassthru(struct usb_device *udev) · line 9590
Quoted 10 lines
drivers/net/usb/r8152.c +2
-2case 0x8153 : -return 1 ; +return true; } } -return 0 ; +return false; } static int rtl8152_probe(struct usb_interface *intf,
This looks like net-next material, and net-next is currently closed, please resubmit in ~2weeks specifying the target tree in the subj.
Thanks
Paolo