From 2a04a64041947b19b15d425649efa874e43649ee Mon Sep 17 00:00:00 2001 From: Bob Lee Date: Tue, 8 Oct 2024 11:35:39 +0800 Subject: [PATCH] Remove the redundant code As myvariable is declared as an integer, it is meaningless that putting u after %d in the format specifier of sscanf for scanning an integer. This patch removes the u in the format specifier for avoiding misleading. --- examples/hello-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/hello-sysfs.c b/examples/hello-sysfs.c index 6e4f7cf..863570b 100644 --- a/examples/hello-sysfs.c +++ b/examples/hello-sysfs.c @@ -23,7 +23,7 @@ static ssize_t myvariable_store(struct kobject *kobj, struct kobj_attribute *attr, char *buf, size_t count) { - sscanf(buf, "%du", &myvariable); + sscanf(buf, "%d", &myvariable); return count; }