mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
scsi: mvsas: Replace snprintf() with sysfs_emit()
coccinelle report: ./drivers/scsi/mvsas/mv_init.c:699:8-16: WARNING: use scnprintf or sprintf ./drivers/scsi/mvsas/mv_init.c:747:8-16: WARNING: use scnprintf or sprintf Use sysfs_emit() instead of scnprintf() or sprintf(). Link: https://lore.kernel.org/r/c1711f7cf251730a8ceb5bdfc313bf85662b3395.1643182948.git.yang.guang5@zte.com.cn Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Yang Guang <yang.guang5@zte.com.cn> Signed-off-by: David Yang <davidcomponentone@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
687ba48e16
commit
0ad3867b0f
1 changed files with 2 additions and 2 deletions
|
@ -696,7 +696,7 @@ static struct pci_driver mvs_pci_driver = {
|
||||||
static ssize_t driver_version_show(struct device *cdev,
|
static ssize_t driver_version_show(struct device *cdev,
|
||||||
struct device_attribute *attr, char *buffer)
|
struct device_attribute *attr, char *buffer)
|
||||||
{
|
{
|
||||||
return snprintf(buffer, PAGE_SIZE, "%s\n", DRV_VERSION);
|
return sysfs_emit(buffer, "%s\n", DRV_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR_RO(driver_version);
|
static DEVICE_ATTR_RO(driver_version);
|
||||||
|
@ -744,7 +744,7 @@ static ssize_t interrupt_coalescing_store(struct device *cdev,
|
||||||
static ssize_t interrupt_coalescing_show(struct device *cdev,
|
static ssize_t interrupt_coalescing_show(struct device *cdev,
|
||||||
struct device_attribute *attr, char *buffer)
|
struct device_attribute *attr, char *buffer)
|
||||||
{
|
{
|
||||||
return snprintf(buffer, PAGE_SIZE, "%d\n", interrupt_coalescing);
|
return sysfs_emit(buffer, "%d\n", interrupt_coalescing);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEVICE_ATTR_RW(interrupt_coalescing);
|
static DEVICE_ATTR_RW(interrupt_coalescing);
|
||||||
|
|
Loading…
Reference in a new issue