lkml.org 
[lkml]   [2017]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW
On Tue, Dec 19, 2017 at 10:15:07AM -0800, Joe Perches wrote:
> Convert DEVICE_ATTR uses to DEVICE_ATTR_RW where possible.
>
...

> diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
> index 7a54e3083203..79d4dc785e5c 100644
> --- a/sound/soc/omap/mcbsp.c
> +++ b/sound/soc/omap/mcbsp.c
> @@ -854,7 +854,7 @@ static ssize_t dma_op_mode_store(struct device *dev,
> return size;
> }
>
> -static DEVICE_ATTR(dma_op_mode, 0644, dma_op_mode_show, dma_op_mode_store);
> +static DEVICE_ATTR_RW(dma_op_mode);
>
While I can ack this part here if it helps generic cleanup effort I
don't understart would it improve code readability in general? Mode 644
is clear and don't need any grepping but for DEVICE_ATTR_RW() I had to go
through all of these files in order to see what does it mean:

DEVICE_ATTR_RW: include/linux/device.h
__ATTR_RW: include/linux/sysfs.h
S_IWUSR: include/uapi/linux/stat.h
S_IRUGO: include/linux/stat.h

Jarkko Nikula <jarkko.nikula@bitmer.com>

\
 
 \ /
  Last update: 2017-12-20 10:00    [W:0.108 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site