mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
ptp: replace snprintf with sysfs_emit
[ Upstream commit e2cf07654e
]
coccinelle report:
./drivers/ptp/ptp_sysfs.c:17:8-16:
WARNING: use scnprintf or sprintf
./drivers/ptp/ptp_sysfs.c:390:8-16:
WARNING: use scnprintf or sprintf
Use sysfs_emit instead of scnprintf or sprintf makes more sense.
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>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
052fb1c9dd
commit
1eb5980453
1 changed files with 2 additions and 2 deletions
|
@ -14,7 +14,7 @@ static ssize_t clock_name_show(struct device *dev,
|
|||
struct device_attribute *attr, char *page)
|
||||
{
|
||||
struct ptp_clock *ptp = dev_get_drvdata(dev);
|
||||
return snprintf(page, PAGE_SIZE-1, "%s\n", ptp->info->name);
|
||||
return sysfs_emit(page, "%s\n", ptp->info->name);
|
||||
}
|
||||
static DEVICE_ATTR_RO(clock_name);
|
||||
|
||||
|
@ -387,7 +387,7 @@ static ssize_t ptp_pin_show(struct device *dev, struct device_attribute *attr,
|
|||
|
||||
mutex_unlock(&ptp->pincfg_mux);
|
||||
|
||||
return snprintf(page, PAGE_SIZE, "%u %u\n", func, chan);
|
||||
return sysfs_emit(page, "%u %u\n", func, chan);
|
||||
}
|
||||
|
||||
static ssize_t ptp_pin_store(struct device *dev, struct device_attribute *attr,
|
||||
|
|
Loading…
Reference in a new issue