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: Julia Lawall <Julia.Lawall@inria.fr>
This commit is contained in:
parent
68ea60a796
commit
ff82e84e80
1 changed files with 3 additions and 8 deletions
|
@ -34,15 +34,10 @@ expression BUF, SZ, FORMAT, STR;
|
||||||
ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
|
ssize_t show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
<...
|
<...
|
||||||
(
|
|
||||||
return
|
return
|
||||||
- snprintf(BUF, SZ, FORMAT, STR);
|
- snprintf(BUF, SZ, FORMAT
|
||||||
+ sysfs_emit(BUF, FORMAT, STR);
|
+ sysfs_emit(BUF, FORMAT
|
||||||
|
|
,...);
|
||||||
return
|
|
||||||
- snprintf(BUF, SZ, STR);
|
|
||||||
+ sysfs_emit(BUF, STR);
|
|
||||||
)
|
|
||||||
...>
|
...>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue