From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: drivers/net/can/usb/mcba_usb.c:176:27: warning: Parameter 'cf' can be declared with const [constParameter]
Date: Mon, 23 May 2022 03:57:27 +0800 [thread overview]
Message-ID: <202205230346.lPD7KAI0-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3692 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
CC: "Marc Kleine-Budde" <mkl@pengutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: eaea45fc0e7b6ae439526b4a41d91230c8517336
commit: cc4b08c31b5c51352f258032cc65e884b3e61e6a can: do not increase tx_bytes statistics for RTR frames
date: 5 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 5 months ago
compiler: m68k-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout cc4b08c31b5c51352f258032cc65e884b3e61e6a
cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> drivers/net/can/usb/mcba_usb.c:176:27: warning: Parameter 'cf' can be declared with const [constParameter]
struct can_frame *cf)
^
vim +/cf +176 drivers/net/can/usb/mcba_usb.c
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 174
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 175 static inline struct mcba_usb_ctx *mcba_usb_get_free_ctx(struct mcba_priv *priv,
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 @176 struct can_frame *cf)
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 177 {
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 178 int i = 0;
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 179 struct mcba_usb_ctx *ctx = NULL;
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 180
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 181 for (i = 0; i < MCBA_MAX_TX_URBS; i++) {
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 182 if (priv->tx_context[i].ndx == MCBA_CTX_FREE) {
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 183 ctx = &priv->tx_context[i];
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 184 ctx->ndx = i;
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 185
cc4b08c31b5c51 Vincent Mailhol 2021-12-07 186 if (cf)
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 187 ctx->can = true;
cc4b08c31b5c51 Vincent Mailhol 2021-12-07 188 else
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 189 ctx->can = false;
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 190
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 191 atomic_dec(&priv->free_ctx_cnt);
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 192 break;
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 193 }
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 194 }
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 195
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 196 if (!atomic_read(&priv->free_ctx_cnt))
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 197 /* That was the last free ctx. Slow down tx path */
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 198 netif_stop_queue(priv->netdev);
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 199
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 200 return ctx;
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 201 }
51f3baad7de943 Remigiusz Kołłątaj 2017-04-14 202
:::::: The code at line 176 was first introduced by commit
:::::: 51f3baad7de943780ce0c17bd7975df567dd6e14 can: mcba_usb: Add support for Microchip CAN BUS Analyzer
:::::: TO: Remigiusz Kołłątaj <remigiusz.kollataj@mobica.com>
:::::: CC: Marc Kleine-Budde <mkl@pengutronix.de>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-05-22 19:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202205230346.lPD7KAI0-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.