linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jiri Slaby <jslaby@suse.com>,
	linux-serial@vger.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [PATCH v2 3/8] serial: core: use octal permissions on module param
Date: Fri, 14 Feb 2020 08:27:19 -0800	[thread overview]
Message-ID: <20200214162719.GA3987177@kroah.com> (raw)
In-Reply-To: <20200214114339.53897-4-andriy.shevchenko@linux.intel.com>

On Fri, Feb 14, 2020 at 01:43:34PM +0200, Andy Shevchenko wrote:
> Symbolic permissions 'S_IRUSR | S_IRGRP' are not preferred.
> Use octal permissions '0440'. This also makes code shorter.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/tty/serial/serial_core.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index bb2287048108..7564bbd3061c 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -2749,19 +2749,19 @@ static ssize_t uart_get_attr_iomem_reg_shift(struct device *dev,
>  	return snprintf(buf, PAGE_SIZE, "%d\n", tmp.iomem_reg_shift);
>  }
>  
> -static DEVICE_ATTR(type, S_IRUSR | S_IRGRP, uart_get_attr_type, NULL);
> -static DEVICE_ATTR(line, S_IRUSR | S_IRGRP, uart_get_attr_line, NULL);
> -static DEVICE_ATTR(port, S_IRUSR | S_IRGRP, uart_get_attr_port, NULL);
> -static DEVICE_ATTR(irq, S_IRUSR | S_IRGRP, uart_get_attr_irq, NULL);
> -static DEVICE_ATTR(flags, S_IRUSR | S_IRGRP, uart_get_attr_flags, NULL);
> -static DEVICE_ATTR(xmit_fifo_size, S_IRUSR | S_IRGRP, uart_get_attr_xmit_fifo_size, NULL);
> -static DEVICE_ATTR(uartclk, S_IRUSR | S_IRGRP, uart_get_attr_uartclk, NULL);
> -static DEVICE_ATTR(close_delay, S_IRUSR | S_IRGRP, uart_get_attr_close_delay, NULL);
> -static DEVICE_ATTR(closing_wait, S_IRUSR | S_IRGRP, uart_get_attr_closing_wait, NULL);
> -static DEVICE_ATTR(custom_divisor, S_IRUSR | S_IRGRP, uart_get_attr_custom_divisor, NULL);
> -static DEVICE_ATTR(io_type, S_IRUSR | S_IRGRP, uart_get_attr_io_type, NULL);
> -static DEVICE_ATTR(iomem_base, S_IRUSR | S_IRGRP, uart_get_attr_iomem_base, NULL);
> -static DEVICE_ATTR(iomem_reg_shift, S_IRUSR | S_IRGRP, uart_get_attr_iomem_reg_shift, NULL);
> +static DEVICE_ATTR(type, 0440, uart_get_attr_type, NULL);
> +static DEVICE_ATTR(line, 0440, uart_get_attr_line, NULL);
> +static DEVICE_ATTR(port, 0440, uart_get_attr_port, NULL);
> +static DEVICE_ATTR(irq, 0440, uart_get_attr_irq, NULL);
> +static DEVICE_ATTR(flags, 0440, uart_get_attr_flags, NULL);
> +static DEVICE_ATTR(xmit_fifo_size, 0440, uart_get_attr_xmit_fifo_size, NULL);
> +static DEVICE_ATTR(uartclk, 0440, uart_get_attr_uartclk, NULL);
> +static DEVICE_ATTR(close_delay, 0440, uart_get_attr_close_delay, NULL);
> +static DEVICE_ATTR(closing_wait, 0440, uart_get_attr_closing_wait, NULL);
> +static DEVICE_ATTR(custom_divisor, 0440, uart_get_attr_custom_divisor, NULL);
> +static DEVICE_ATTR(io_type, 0440, uart_get_attr_io_type, NULL);
> +static DEVICE_ATTR(iomem_base, 0440, uart_get_attr_iomem_base, NULL);
> +static DEVICE_ATTR(iomem_reg_shift, 0440, uart_get_attr_iomem_reg_shift, NULL);

I'll take these, but we should move them all to DEVICE_ATTR_RO() as that
would make things a lot more "obvious" what is happening here.

thanks,

greg k-h

  reply	other threads:[~2020-02-14 20:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 11:43 [PATCH v2 0/8] serial: Disable DMA and PM on kernel console Andy Shevchenko
2020-02-14 11:43 ` [PATCH v2 1/8] serial: core: Introduce uart_console_enabled() helper Andy Shevchenko
2020-02-14 11:43 ` [PATCH v2 2/8] serial: core: Consolidate spin lock initialization code Andy Shevchenko
2020-02-14 11:43 ` [PATCH v2 3/8] serial: core: use octal permissions on module param Andy Shevchenko
2020-02-14 16:27   ` Greg Kroah-Hartman [this message]
2020-02-17  9:15     ` Andy Shevchenko
2020-02-14 11:43 ` [PATCH v2 4/8] serial: core: Allow detach and attach serial device for console Andy Shevchenko
2020-02-14 16:28   ` Greg Kroah-Hartman
2020-02-17 10:23     ` Andy Shevchenko
2020-02-14 11:43 ` [PATCH v2 5/8] serial: 8250_port: Don't use power management for kernel console Andy Shevchenko
2020-02-14 13:39   ` Russell King - ARM Linux admin
2020-02-14 17:13     ` Tony Lindgren
2020-02-14 18:09       ` Andy Shevchenko
2020-02-14 18:42         ` Tony Lindgren
2020-02-14 19:06           ` Tony Lindgren
2020-02-14 18:14   ` Tony Lindgren
2020-02-14 18:56     ` Andy Shevchenko
2020-02-14 19:02       ` Tony Lindgren
2020-02-14 11:43 ` [PATCH v2 6/8] serial: 8250_port: Disable DMA operations " Andy Shevchenko
2020-02-14 16:30   ` Greg Kroah-Hartman
2020-02-17  9:18     ` Andy Shevchenko
2020-02-14 11:43 ` [PATCH v2 7/8] serial: 8250_mtk: Remove duplicating code to disable DMA Andy Shevchenko
2020-02-14 11:43 ` [PATCH v2 8/8] serial: 8250_omap: " Andy Shevchenko
2020-02-14 16:33 ` [PATCH v2 0/8] serial: Disable DMA and PM on kernel console Greg Kroah-Hartman
2020-02-14 21:41   ` Tony Lindgren
2020-02-17 10:05     ` Andy Shevchenko

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=20200214162719.GA3987177@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=jslaby@suse.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=tony@atomide.com \
    /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 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).