lkml.org 
[lkml]   [2016]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 10/15] ASoC: omap-mcbsp: use permission-specific DEVICE_ATTR variants
Hi

On Sat, 29 Oct 2016 21:37:04 +0200
Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> Use DEVICE_ATTR_RW for read-write attributes. This simplifies the
> source code, improves readbility, and reduces the chance of
> inconsistencies.
>
...
>
> - DEVICE_ATTR(x, \(0644\|S_IRUGO|S_IWUSR\), x_show, x_store);
> + DEVICE_ATTR_RW(x);

I'm not so sure does this improve readability. 644 is pretty obvious but for DEVICE_ATTR_RW() one has to dive into include/linux/device.h and include/linux/sysfs.h to see for what users it grants the write access.

--
Jarkko

\
 
 \ /
  Last update: 2016-10-30 12:29    [W:0.204 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site