]> git.baikalelectronics.ru Git - kernel.git/commit
hinic: use ARRAY_SIZE instead of ARRAY_LEN
authorGuo Zhengkui <guozhengkui@vivo.com>
Mon, 15 Nov 2021 05:00:10 +0000 (13:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Nov 2021 14:18:09 +0000 (14:18 +0000)
commitba98a36c61daaf661e3ed57c87f98e5a9d10c7ca
treee7d275df3c78b0dff19ab6e53cc366b0d2d349b6
parent9eaa1b3741f1baca0520f6b8068aa937f750fb92
hinic: use ARRAY_SIZE instead of ARRAY_LEN

ARRAY_SIZE defined in <linux/kernel.h> is safer than self-defined
macros to get size of an array such as ARRAY_LEN used here. Because
ARRAY_SIZE uses __must_be_array(arr) to ensure arr is really an array.

Reported-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/huawei/hinic/hinic_ethtool.c