[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-omap
Subject:    Re: [PATCH 10/15] ASoC: omap-mcbsp: use permission-specific DEVICE_ATTR variants
From:       Julia Lawall <julia.lawall () lip6 ! fr>
Date:       2016-10-30 11:50:12
Message-ID: alpine.DEB.2.20.1610301246120.2074 () hadrien
[Download RAW message or body]



On Sun, 30 Oct 2016, Jarkko Nikula wrote:

> 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.

OK, as you like.  It does help ensure that the functions that are supposed
to be defined are available.  There were a couple of occurrences of 0644
with no show or no store function.  Among the three declarers, there are
currently in total over 800 uses in the kernel, so they are also not so
obscure.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic