Skip to content

Commit

Permalink
net: hns3: cleanup a format-truncation warning
Browse files Browse the repository at this point in the history
In hns3_nic_init_irq(), when '*_int_idx' has more than 9 digits
and the length of netdev's name is IFNAMSIZ, the total length
of final name will be bigger the HNAE3_INT_NAME_LEN - 1, even
though '*_int_idx' will never have such large value, but the
compiler gives a format-truncation warning for this case.

So this patch just enlarges the length to avoid this warning.

Signed-off-by: Guojia Liao <liaoguojia@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Guojia Liao authored and David S. Miller committed Oct 31, 2019
1 parent db4d3d5 commit e4b806e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/hisilicon/hns3/hnae3.h
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,8 @@ struct hnae3_ae_algo {
const struct pci_device_id *pdev_id_table;
};

#define HNAE3_INT_NAME_LEN (IFNAMSIZ + 16)
#define HNAE3_INT_NAME_EXT_LEN 32 /* Max extra information length */
#define HNAE3_INT_NAME_LEN (IFNAMSIZ + HNAE3_INT_NAME_EXT_LEN)
#define HNAE3_ITR_COUNTDOWN_START 100

struct hnae3_tc_info {
Expand Down

0 comments on commit e4b806e

Please sign in to comment.