netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] r8152: Return true/false (not 1/0) from bool functions
@ 2022-05-24  9:37 Jiapeng Chong
  2022-05-24 13:03 ` Paolo Abeni
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2022-05-24  9:37 UTC (permalink / raw)
  To: davem
  Cc: edumazet, kuba, pabeni, linux-usb, netdev, linux-kernel,
	Jiapeng Chong, Abaci Robot

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,
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-24 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  9:37 [PATCH] r8152: Return true/false (not 1/0) from bool functions Jiapeng Chong
2022-05-24 13:03 ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).