]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
net: hns3: cleanup a format-truncation warning
authorGuojia Liao <liaoguojia@huawei.com>
Thu, 31 Oct 2019 11:23:20 +0000 (19:23 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:24:11 +0000 (16:24 +0100)
BugLink: https://launchpad.net/bugs/1859261
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>
(cherry picked from commit e4b806edfabd43853d365a9fcaf238cf10c3c4ab)
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hnae3.h

index 0f8e615b66f08898001e0e5724b8bd4a6a9394a5..3b5e2d7251e75ce34b4b5584f7d24a7c22f375fb 100644 (file)
@@ -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 {