Skip to content
Snippets Groups Projects
Commit ff82e84e authored by Julia Lawall's avatar Julia Lawall
Browse files

coccinelle: device_attr_show: simplify patch case


Replacing the final expression argument by ... allows the format
string to have multiple arguments.

It also has the advantage of allowing the change to be recognized as
a change in a single statement, thus avoiding adding unneeded braces.

Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
parent 68ea60a7
No related branches found
No related tags found
No related merge requests found
......@@ -34,15 +34,10 @@ expression BUF, SZ, FORMAT, STR;
ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
{
<...
(
return
- snprintf(BUF, SZ, FORMAT, STR);
+ sysfs_emit(BUF, FORMAT, STR);
|
return
- snprintf(BUF, SZ, STR);
+ sysfs_emit(BUF, STR);
)
- snprintf(BUF, SZ, FORMAT
+ sysfs_emit(BUF, FORMAT
,...);
...>
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment