From: Yang Li <yang.lee@linux.alibaba.com>
To: ap420073@gmail.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Yang Li <yang.lee@linux.alibaba.com>,
Abaci Robot <abaci@linux.alibaba.com>
Subject: [PATCH -next] amt: Return true/false (not 1/0) from bool function
Date: Thu, 21 Jul 2022 10:44:43 +0800 [thread overview]
Message-ID: <20220721024443.112126-1-yang.lee@linux.alibaba.com> (raw)
Return boolean values ("true" or "false") instead of 1 or 0 from bool
functions. This fixes the following warnings from coccicheck:
./drivers/net/amt.c:901:9-10: WARNING: return of 0/1 in function 'amt_queue_event' with return type bool
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/net/amt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/amt.c b/drivers/net/amt.c
index febfcf2d92af..2ff53e73f10f 100644
--- a/drivers/net/amt.c
+++ b/drivers/net/amt.c
@@ -898,7 +898,7 @@ static bool amt_queue_event(struct amt_dev *amt, enum amt_event event,
spin_lock_bh(&amt->lock);
if (amt->nr_events >= AMT_MAX_EVENTS) {
spin_unlock_bh(&amt->lock);
- return 1;
+ return true;
}
index = (amt->event_idx + amt->nr_events) % AMT_MAX_EVENTS;
@@ -909,7 +909,7 @@ static bool amt_queue_event(struct amt_dev *amt, enum amt_event event,
queue_work(amt_wq, &amt->event_wq);
spin_unlock_bh(&amt->lock);
- return 0;
+ return false;
}
static void amt_secret_work(struct work_struct *work)
--
2.20.1.7.g153144c
next reply other threads:[~2022-07-21 2:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-21 2:44 Yang Li [this message]
2022-07-21 7:26 ` [PATCH -next] amt: Return true/false (not 1/0) from bool function Taehee Yoo
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=20220721024443.112126-1-yang.lee@linux.alibaba.com \
--to=yang.lee@linux.alibaba.com \
--cc=abaci@linux.alibaba.com \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).