summaryrefslogtreecommitdiff
path: root/drivers/acpi/dock.c
diff options
context:
space:
mode:
authorQing Wang <wangqing@vivo.com>2021-10-13 06:24:50 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-10-13 21:02:18 +0300
commitd47e983e4f612856c860ae04db054ebcf4a333c3 (patch)
treef6ca4bec83a2236f7cafc8c755f4d65c5a30c659 /drivers/acpi/dock.c
parent5771e582d79258333a1cf817db999f58384e5685 (diff)
downloadlinux-d47e983e4f612856c860ae04db054ebcf4a333c3.tar.xz
ACPI: replace snprintf() in "show" functions with sysfs_emit()
coccicheck complains about the use of snprintf() in sysfs "show" functions: Fix the coccicheck warning: WARNING: use scnprintf or sprintf. so use sysfs_emit() instead of it where applicable. Signed-off-by: Qing Wang <wangqing@vivo.com> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/dock.c')
-rw-r--r--drivers/acpi/dock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 7cf92158008f..c8e9b962e18c 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -492,7 +492,7 @@ static ssize_t docked_show(struct device *dev,
struct acpi_device *adev = NULL;
acpi_bus_get_device(dock_station->handle, &adev);
- return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev));
+ return sysfs_emit(buf, "%u\n", acpi_device_enumerated(adev));
}
static DEVICE_ATTR_RO(docked);
@@ -504,7 +504,7 @@ static ssize_t flags_show(struct device *dev,
{
struct dock_station *dock_station = dev->platform_data;
- return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
+ return sysfs_emit(buf, "%d\n", dock_station->flags);
}
static DEVICE_ATTR_RO(flags);
@@ -543,7 +543,7 @@ static ssize_t uid_show(struct device *dev,
if (ACPI_FAILURE(status))
return 0;
- return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
+ return sysfs_emit(buf, "%llx\n", lbuf);
}
static DEVICE_ATTR_RO(uid);
@@ -562,7 +562,7 @@ static ssize_t type_show(struct device *dev,
else
type = "unknown";
- return snprintf(buf, PAGE_SIZE, "%s\n", type);
+ return sysfs_emit(buf, "%s\n", type);
}
static DEVICE_ATTR_RO(type);