All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/can/usb/mcba_usb.c:176:27: warning: Parameter 'cf' can be declared with const [constParameter]
@ 2022-05-22 19:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-05-22 19:57 UTC (permalink / raw)
  To: kbuild

[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-22 19:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 19:57 drivers/net/can/usb/mcba_usb.c:176:27: warning: Parameter 'cf' can be declared with const [constParameter] kernel test robot

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.