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.
This commit is contained in:
Bob Lee 2024-10-08 11:35:39 +08:00
parent 2eadbb1ecf
commit 2a04a64041
No known key found for this signature in database
GPG Key ID: 0DA954476306EEFA

View File

@ -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;
}