Re: [PATCH] mlx4: fix a compilation warning.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2018-11-14 at 22:55 -0500, Qian Cai wrote:
+AD4 drivers/infiniband/hw/mlx4/sysfs.c:360:2: warning: +IBg-strncpy+IBk output may be
+AD4 truncated copying 8 bytes from a string of length 31 +AFs--Wstringop-truncation+AF0
+AD4   strncpy(base+AF8-name, name, 8)+ADs /+ACo-till xxxx:yy:+ACo-/
+AD4   +AF4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+AH4AfgB+
+AD4 
+AD4 Signed-off-by: Qian Cai +ADw-cai+AEA-gmx.us+AD4
+AD4 ---
+AD4  drivers/infiniband/hw/mlx4/sysfs.c +AHw 2 +--
+AD4  1 file changed, 1 insertion(+-), 1 deletion(-)
+AD4 
+AD4 diff --git a/drivers/infiniband/hw/mlx4/sysfs.c b/drivers/infiniband/hw/mlx4/sysfs.c
+AD4 index 752bdd536130..1fa23c358d01 100644
+AD4 --- a/drivers/infiniband/hw/mlx4/sysfs.c
+AD4 +-+-+- b/drivers/infiniband/hw/mlx4/sysfs.c
+AD4 +AEAAQA -357,7 +-357,7 +AEAAQA static void get+AF8-name(struct mlx4+AF8-ib+AF8-dev +ACo-dev, char +ACo-name, int i, int max)
+AD4  
+AD4  	/+ACo pci+AF8-name format is: bus:dev:func -+AD4 xxxx:yy:zz.n +ACo-/
+AD4  	strlcpy(name, pci+AF8-name(dev-+AD4-dev-+AD4-persist-+AD4-pdev), max)+ADs
+AD4 -	strncpy(base+AF8-name, name, 8)+ADs /+ACo-till xxxx:yy:+ACo-/
+AD4 +-	snprintf(base+AF8-name, sizeof(base+AF8-name), name)+ADs /+ACo-till xxxx:yy:+ACo-/
+AD4  	base+AF8-name+AFs-8+AF0 +AD0 '+AFw-0'+ADs
+AD4  	/+ACo with no ARI only 3 last bits are used so when the fn is higher than 8
+AD4  	 +ACo need to add it to the dev num, so count in the last number will be

This change makes the +ACI-base+AF8-name+AFs-8+AF0 +AD0 '+AFw-0'+ACI statement superfluous so please
remove it.

Thanks,

Bart.



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux