* [PATCH] staging: iio: adc: ad7280a: fix permission coding style issue
@ 2017-03-23 13:18 Olivier Leveque
2017-03-25 17:07 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Olivier Leveque @ 2017-03-23 13:18 UTC (permalink / raw)
To: lars, Michael.Hennerich, linux-iio; +Cc: Olivier Leveque
Symbolic permissions 'S_IWUSR | S_IRUGO' are not preferred. Consider using
octal permissions '0644'. Found running checkpatch.
Signed-off-by: Olivier Leveque <o_leveque@orange.fr>
---
drivers/staging/iio/adc/ad7280a.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index 6a85e28..d5ab83f 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -560,7 +560,7 @@ static int ad7280_attr_init(struct ad7280_state *st)
st->iio_attr[cnt].address =
AD7280A_DEVADDR(dev) << 8 | ch;
st->iio_attr[cnt].dev_attr.attr.mode =
- S_IWUSR | S_IRUGO;
+ 0644;
st->iio_attr[cnt].dev_attr.show =
ad7280_show_balance_sw;
st->iio_attr[cnt].dev_attr.store =
@@ -577,7 +577,7 @@ static int ad7280_attr_init(struct ad7280_state *st)
AD7280A_DEVADDR(dev) << 8 |
(AD7280A_CB1_TIMER + ch);
st->iio_attr[cnt].dev_attr.attr.mode =
- S_IWUSR | S_IRUGO;
+ 0644;
st->iio_attr[cnt].dev_attr.show =
ad7280_show_balance_timer;
st->iio_attr[cnt].dev_attr.store =
@@ -746,26 +746,26 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
in_voltage-voltage_thresh_low_value,
- S_IRUGO | S_IWUSR,
+ 0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_UNDERVOLTAGE);
static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
in_voltage-voltage_thresh_high_value,
- S_IRUGO | S_IWUSR,
+ 0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_OVERVOLTAGE);
static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
- S_IRUGO | S_IWUSR,
+ 0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_AUX_ADC_UNDERVOLTAGE);
static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
- S_IRUGO | S_IWUSR,
+ 0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_AUX_ADC_OVERVOLTAGE);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: iio: adc: ad7280a: fix permission coding style issue
2017-03-23 13:18 [PATCH] staging: iio: adc: ad7280a: fix permission coding style issue Olivier Leveque
@ 2017-03-25 17:07 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-03-25 17:07 UTC (permalink / raw)
To: Olivier Leveque, lars, Michael.Hennerich, linux-iio
On 23/03/17 13:18, Olivier Leveque wrote:
> Symbolic permissions 'S_IWUSR | S_IRUGO' are not preferred. Consider using
> octal permissions '0644'. Found running checkpatch.
>
> Signed-off-by: Olivier Leveque <o_leveque@orange.fr>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/staging/iio/adc/ad7280a.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
> index 6a85e28..d5ab83f 100644
> --- a/drivers/staging/iio/adc/ad7280a.c
> +++ b/drivers/staging/iio/adc/ad7280a.c
> @@ -560,7 +560,7 @@ static int ad7280_attr_init(struct ad7280_state *st)
> st->iio_attr[cnt].address =
> AD7280A_DEVADDR(dev) << 8 | ch;
> st->iio_attr[cnt].dev_attr.attr.mode =
> - S_IWUSR | S_IRUGO;
> + 0644;
> st->iio_attr[cnt].dev_attr.show =
> ad7280_show_balance_sw;
> st->iio_attr[cnt].dev_attr.store =
> @@ -577,7 +577,7 @@ static int ad7280_attr_init(struct ad7280_state *st)
> AD7280A_DEVADDR(dev) << 8 |
> (AD7280A_CB1_TIMER + ch);
> st->iio_attr[cnt].dev_attr.attr.mode =
> - S_IWUSR | S_IRUGO;
> + 0644;
> st->iio_attr[cnt].dev_attr.show =
> ad7280_show_balance_timer;
> st->iio_attr[cnt].dev_attr.store =
> @@ -746,26 +746,26 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
>
> static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
> in_voltage-voltage_thresh_low_value,
> - S_IRUGO | S_IWUSR,
> + 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
> AD7280A_CELL_UNDERVOLTAGE);
>
> static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
> in_voltage-voltage_thresh_high_value,
> - S_IRUGO | S_IWUSR,
> + 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
> AD7280A_CELL_OVERVOLTAGE);
>
> static IIO_DEVICE_ATTR(in_temp_thresh_low_value,
> - S_IRUGO | S_IWUSR,
> + 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
> AD7280A_AUX_ADC_UNDERVOLTAGE);
>
> static IIO_DEVICE_ATTR(in_temp_thresh_high_value,
> - S_IRUGO | S_IWUSR,
> + 0644,
> ad7280_read_channel_config,
> ad7280_write_channel_config,
> AD7280A_AUX_ADC_OVERVOLTAGE);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-25 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-23 13:18 [PATCH] staging: iio: adc: ad7280a: fix permission coding style issue Olivier Leveque
2017-03-25 17:07 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).