lkml.org 
[lkml]   [2018]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] iio: buffer: use permission specific variants of DEVICE_ATTR
On Sat, 6 Jan 2018 14:18:58 +0100 (CET)
Julia Lawall <julia.lawall@lip6.fr> wrote:

> On Sat, 6 Jan 2018, Lars-Peter Clausen wrote:
>
> > On 01/06/2018 01:35 PM, Jonathan Cameron wrote:
> > > On Thu, 4 Jan 2018 20:07:14 +0530
> > > Aishwarya Pant <aishpant@gmail.com> wrote:
> > >
> > >> This is a clean-up patch which replaces DEVICE_ATTR macro with the file
> > >> permission specific DEVICE_ATTR_{RO/WO/RW} macros for compaction and
> > >> readability. Done using coccinelle.
> > >
> > > Hmm. I'll be honest, I personally really dislike these macros.
> > > They absolutely don't help with readability because they obscure
> > > the connection between the attributes being created and their callbacks.
> > > Short is not the same as more readable.
> >
> > FWIW fully agreed.
>
> Could there be variants that keep the function names as arguments, but
> keep the benefit of the simpler permission specification and ensuring that
> the right functions are provided for the given permissions?

Yes, that would bring the benefits without the readability cost.
No one needs to know that RW means some octal number after all.

Jonathan
>
> julia
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

\
 
 \ /
  Last update: 2018-01-06 15:18    [W:0.035 / U:9.680 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site