Message ID | 1477769829-22230-12-git-send-email-Julia.Lawall@lip6.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 3bbe32e..164b4d3 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2297,7 +2297,7 @@ static ssize_t dapm_widget_show(struct device *dev, return count; } -static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL); +static DEVICE_ATTR_RO(dapm_widget); struct attribute *soc_dapm_dev_attrs[] = { &dev_attr_dapm_widget.attr,
Use DEVICE_ATTR_RO for read only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @ro@ declarer name DEVICE_ATTR; identifier x,x_show; @@ DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL); @script:ocaml@ x << ro.x; x_show << ro.x_show; @@ if not (x^"_show" = x_show) then Coccilib.include_match false @@ declarer name DEVICE_ATTR_RO; identifier ro.x,ro.x_show; @@ - DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL); + DEVICE_ATTR_RO(x); // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- sound/soc/soc-dapm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)