From: Paolo Abeni <pabeni@redhat.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, davem@davemloft.net
Cc: edumazet@google.com, kuba@kernel.org, linux-usb@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH] r8152: Return true/false (not 1/0) from bool functions
Date: Tue, 24 May 2022 15:03:07 +0200 [thread overview]
Message-ID: <6dc4367dc75d3f7baf9f61e2691045066b3716e1.camel@redhat.com> (raw)
In-Reply-To: <20220524093733.9537-1-jiapeng.chong@linux.alibaba.com>
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
prev parent reply other threads:[~2022-05-24 13:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 9:37 Jiapeng Chong
2022-05-24 13:03 ` Paolo Abeni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6dc4367dc75d3f7baf9f61e2691045066b3716e1.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=abaci@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiapeng.chong@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®