projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
406df15
)
HID: core: use scnprintf in modalias_show()
author
Rasmus Villemoes
<linux@rasmusvillemoes.dk>
Sat, 14 Nov 2015 21:08:08 +0000
(22:08 +0100)
committer
Jiri Kosina
<jkosina@suse.cz>
Fri, 20 Nov 2015 09:48:04 +0000
(10:48 +0100)
scnprintf() exists to provide these semantics, so we might as well use
it.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/hid/hid-core.c
b/drivers/hid/hid-core.c
index d5ddb757369195eff4412efd568fda433dc5c2ca..3c1cfc6d99641b0c91013070422775b59757a7c3 100644
(file)
--- a/
drivers/hid/hid-core.c
+++ b/
drivers/hid/hid-core.c
@@
-2217,12
+2217,9
@@
static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
char *buf)
{
struct hid_device *hdev = container_of(dev, struct hid_device, dev);
- int len;
-
- len = snprintf(buf, PAGE_SIZE, "hid:b%04Xg%04Xv%08Xp%08X\n",
- hdev->bus, hdev->group, hdev->vendor, hdev->product);
- return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
+ return scnprintf(buf, PAGE_SIZE, "hid:b%04Xg%04Xv%08Xp%08X\n",
+ hdev->bus, hdev->group, hdev->vendor, hdev->product);
}
static DEVICE_ATTR_RO(modalias);