Subject: Re: [PATCH V1 net-next 10/10] net: ena: Extract recurring driver reset code into a function

From: kernel test robot <[email-masked]>
Date: Sat, 8 Jan 2022 18:33:08 +0800

Hi Arthur,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Arthur-Kiyanovski/ENA-capabilities-field-and-cosmetic/20220107-034036
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 710ad98c363a66a0cd8526465426c5c5f8377ee0
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20220108/[email-masked]/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/fc12048d64c67fe13a46a2a3932df606c29ac4d9
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Arthur-Kiyanovski/ENA-capabilities-field-and-cosmetic/20220107-034036
        git checkout fc12048d64c67fe13a46a2a3932df606c29ac4d9
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/net/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email-masked]>

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/amazon/ena/ena_netdev.c:21:
   drivers/net/ethernet/amazon/ena/ena_netdev.h: In function 'ena_reset_device':
>> drivers/net/ethernet/amazon/ena/ena_netdev.h:399:31: warning: implicit conversion from 'enum ena_flags_t' to 'enum ena_regs_reset_reason_types' [-Wenum-conversion]
     399 |         adapter->reset_reason = reset_reason;
         |                               ^
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'ena_tx_timeout':
>> drivers/net/ethernet/amazon/ena/ena_netdev.c:106:35: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
     106 |         ena_reset_device(adapter, ENA_REGS_RESET_OS_NETDEV_WD);
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'ena_xmit_common':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:171:42: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
     171 |                                          ENA_REGS_RESET_DRIVER_INVALID_STATE);
         |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'handle_invalid_req_id':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:1280:41: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    1280 |         ena_reset_device(ring->adapter, ENA_REGS_RESET_INV_TX_REQ_ID);
         |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'ena_rx_skb':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:1444:43: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    1444 |                 ena_reset_device(adapter, ENA_REGS_RESET_INV_RX_REQ_ID);
         |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'ena_clean_rx_irq':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:1777:43: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    1777 |                 ena_reset_device(adapter, ENA_REGS_RESET_TOO_MANY_RX_DESCS);
         |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c:1781:43: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    1781 |                 ena_reset_device(adapter, ENA_REGS_RESET_INV_RX_REQ_ID);
         |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'check_for_rx_interrupt_queue':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:3701:43: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    3701 |                 ena_reset_device(adapter, ENA_REGS_RESET_MISS_INTERRUPT);
         |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'check_missing_comp_in_tx_queue':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:3738:51: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    3738 |                         ena_reset_device(adapter, ENA_REGS_RESET_MISS_INTERRUPT);
         |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c:3764:43: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    3764 |                 ena_reset_device(adapter, ENA_REGS_RESET_MISS_TX_CMPL);
         |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'check_for_missing_keep_alive':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:3885:43: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    3885 |                 ena_reset_device(adapter, ENA_REGS_RESET_KEEP_ALIVE_TO);
         |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/amazon/ena/ena_netdev.c: In function 'check_for_admin_com_state':
   drivers/net/ethernet/amazon/ena/ena_netdev.c:3896:43: warning: implicit conversion from 'enum ena_regs_reset_reason_types' to 'enum ena_flags_t' [-Wenum-conversion]
    3896 |                 ena_reset_device(adapter, ENA_REGS_RESET_ADMIN_TO);
         |                                           ^~~~~~~~~~~~~~~~~~~~~~~
--
   In file included from drivers/net/ethernet/amazon/ena/ena_ethtool.c:9:
   drivers/net/ethernet/amazon/ena/ena_netdev.h: In function 'ena_reset_device':
>> drivers/net/ethernet/amazon/ena/ena_netdev.h:399:31: warning: implicit conversion from 'enum ena_flags_t' to 'enum ena_regs_reset_reason_types' [-Wenum-conversion]
     399 |         adapter->reset_reason = reset_reason;
         |                               ^

vim +399 drivers/net/ethernet/amazon/ena/ena_netdev.h

   396	
   397	static inline void ena_reset_device(struct ena_adapter *adapter, enum ena_flags_t reset_reason)
   398	{
 > 399		adapter->reset_reason = reset_reason;
   400		/* Make sure reset reason is set before triggering the reset */
   401		smp_mb__before_atomic();
   402		set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags);
   403	}
   404	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email-masked]