diff mbox series

r8152: Return true/false (not 1/0) from bool functions

Message ID 20220524093733.9537-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series r8152: Return true/false (not 1/0) from bool functions | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: hayeswang@realtek.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jiapeng Chong May 24, 2022, 9:37 a.m. UTC
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 <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/net/usb/r8152.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Paolo Abeni May 24, 2022, 1:03 p.m. UTC | #1
On Tue, 2022-05-24 at 17:37 +0800, Jiapeng Chong wrote:
> 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 <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/usb/r8152.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 7389d6ef8569..7b7704b4b500 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -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,

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
diff mbox series

Patch

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 7389d6ef8569..7b7704b4b500 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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,