From 643f7d95fe236d739aaba3b63f0627b20471d4da Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 14 Feb 2020 13:43:34 +0200 Subject: [PATCH] serial: core: use octal permissions on module param Symbolic permissions 'S_IRUSR | S_IRGRP' are not preferred. Use octal permissions '0440'. This also makes code shorter. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200214114339.53897-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- 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 bb22870..7564bbd 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); static struct attribute *tty_dev_attrs[] = { &dev_attr_type.attr, -- 2.7.4