[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220106190026.7b98d791@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 6 Jan 2022 19:00:26 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Arthur Kiyanovski <akiyano@...zon.com>
Cc: David Miller <davem@...emloft.net>, <netdev@...r.kernel.org>,
"Woodhouse, David" <dwmw@...zon.com>,
"Machulsky, Zorik" <zorik@...zon.com>,
"Matushevsky, Alexander" <matua@...zon.com>,
Saeed Bshara <saeedb@...zon.com>,
"Wilson, Matt" <msw@...zon.com>,
"Liguori, Anthony" <aliguori@...zon.com>,
"Bshara, Nafea" <nafea@...zon.com>,
"Belgazal, Netanel" <netanel@...zon.com>,
"Saidi, Ali" <alisaidi@...zon.com>,
"Herrenschmidt, Benjamin" <benh@...zon.com>,
"Dagan, Noam" <ndagan@...zon.com>,
"Agroskin, Shay" <shayagr@...zon.com>,
"Arinzon, David" <darinzon@...zon.com>,
Nati Koler <nkoler@...zon.com>
Subject: Re: [PATCH V1 net-next 10/10] net: ena: Extract recurring driver
reset code into a function
On Thu, 6 Jan 2022 19:29:15 +0000 Arthur Kiyanovski wrote:
> Create an inline function for resetting the driver
> to reduce code duplication.
> +static inline void ena_reset_device(struct ena_adapter *adapter, enum ena_flags_t reset_reason)
Looks like you picked the wrong type because new W=1 warnings abound:
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;
| ^
../drivers/net/ethernet/amazon/ena/ena_netdev.c: note: in included file:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: warning: mixing different enum types:
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_flags_t
../drivers/net/ethernet/amazon/ena/ena_netdev.h:399:33: unsigned int enum ena_regs_reset_reason_types
While you're fixing things it'd also be cool to address the existing
clang warning:
drivers/net/ethernet/amazon/ena/ena_netdev.c:1892:6: warning: variable 'tx_bytes' set but not used [-Wunused-but-set-variable]
u32 tx_bytes = 0;
^
Powered by blists - more mailing lists