Re: [PATCH 3/4] RDMA: manual changes for sysfs_emit and neatening

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

 



On Wed, Oct 07, 2020 at 07:36:26PM -0700, Joe Perches wrote:

> @@ -653,10 +651,7 @@ static ssize_t serial_show(struct device *device,
>  		rdma_device_to_drv_device(device, struct qib_ibdev, rdi.ibdev);
>  	struct qib_devdata *dd = dd_from_dev(dev);
>  
> -	buf[sizeof(dd->serial)] = '\0';
> -	memcpy(buf, dd->serial, sizeof(dd->serial));
> -	strcat(buf, "\n");
> -	return strlen(buf);
> +	return sysfs_emit(buf, "%s\n", dd->serial);
>  }

This is not the same thing? dd->serial does not look null terminated,
eg it is filled like this:

		memcpy(dd->serial, ifp->if_serial, sizeof(ifp->if_serial));

>From data read off the flash

Jason



[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