All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jonathan Cameron <jic23@kernel.org>,
	Joe Simmons-Talbott <joetalbott@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] iio: Prefer octal over symbolic permissions.
Date: Sat, 28 May 2022 10:36:57 -0700	[thread overview]
Message-ID: <083c936b74c2a2aef678e7b89be22e00c596144f.camel@perches.com> (raw)
In-Reply-To: <20220528183405.22b55033@jic23-huawei>

On Sat, 2022-05-28 at 18:34 +0100, Jonathan Cameron wrote:
> On Fri, 27 May 2022 14:56:52 -0400
> Joe Simmons-Talbott <joetalbott@gmail.com> wrote:
> > As reported by checkpatch.pl use ocatl permissions rather than symbolic
> > permissions.
[]
> Why the resend?  Given change of description, I'm guessing this is v2
> because of feedback on a similar patch elsewhere. If so, please
> put the version number in the patch log and provide a changelog
> below the ---
> 
> Hmm. I guess I don't really mind cleaning this up though it is
> some churn in core code which is usually something we try to avoid
> for fairly trivial style reasons.
> 
> One request inline (though I suspect it applies in several places,
> I just haven't checked ;)
[]
> > diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
[]
> > @@ -1391,17 +1391,17 @@ static ssize_t direction_show(struct device *dev,
> >  	}
> >  }
> >  
> > -static DEVICE_ATTR(length, S_IRUGO | S_IWUSR, iio_buffer_read_length,
> > +static DEVICE_ATTR(length, 0644, iio_buffer_read_length,
> >  		   iio_buffer_write_length);
> >  static struct device_attribute dev_attr_length_ro = __ATTR(length,
> > -	S_IRUGO, iio_buffer_read_length, NULL);
> > -static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR,
> > +	0444, iio_buffer_read_length, NULL);
> > +static DEVICE_ATTR(enable, 0644,
> >  		   iio_buffer_show_enable, iio_buffer_store_enable);
> > -static DEVICE_ATTR(watermark, S_IRUGO | S_IWUSR,
> > +static DEVICE_ATTR(watermark, 0644,
> >  		   iio_buffer_show_watermark, iio_buffer_store_watermark);
> >  static struct device_attribute dev_attr_watermark_ro = __ATTR(watermark,
> > -	S_IRUGO, iio_buffer_show_watermark, NULL);
> > -static DEVICE_ATTR(data_available, S_IRUGO,
> > +	0444, iio_buffer_show_watermark, NULL);
> > +static DEVICE_ATTR(data_available, 0444,
> >  		iio_dma_show_data_available, NULL);
> 
> a side effect of this change a slight shortening of how long the above
> two lines will be if combined into one.  It's now sub 80 chars
> I think, so please make them a single line.  Also check for similar
> cases elsewhere.

another possibility it to rename the function to <var>_show and change

	static DEVICE_ATTR(foo, 0444, <var>, NULL)
to
	static DEVICE_ATTR_RO(<var>)

and also use

DEVICE_ATTR_RW

with appropriate function renaming where feasible.

  reply	other threads:[~2022-05-28 17:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 18:56 [PATCH 1/1] iio: Prefer octal over symbolic permissions Joe Simmons-Talbott
2022-05-28 17:34 ` Jonathan Cameron
2022-05-28 17:36   ` Joe Perches [this message]
2022-05-29 14:08   ` Joe Talbott
2022-05-31  9:56     ` Jonathan Cameron
2022-06-01 14:09       ` Joe Simmons-Talbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=083c936b74c2a2aef678e7b89be22e00c596144f.camel@perches.com \
    --to=joe@perches.com \
    --cc=jic23@kernel.org \
    --cc=joetalbott@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.