lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181029134628.dq6eroc5ypmzrkoz@earth.universe>
Date:   Mon, 29 Oct 2018 14:46:28 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     Steffen Vogel <post@...ffenvogel.de>
Cc:     linux-kernel@...r.kernel.org, Evgeniy Polyakov <zbr@...emap.net>
Subject: Re: [PATCH 5/9] w1: use octal numbers instead of macros for file mode

Hi,

On Sun, Oct 28, 2018 at 11:09:24PM +0100, Steffen Vogel wrote:
> This satifies a warning raised by the checkpatch tool.
> 
> Signed-off-by: Steffen Vogel <post@...ffenvogel.de>
> ---
>  drivers/w1/w1.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index f64da16dbec9..bad2ee26cd4e 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -554,18 +554,18 @@ static ssize_t w1_master_attribute_store_remove(struct device *dev,
>  		       w1_master_attribute_show_##_name,	\
>  		       w1_master_attribute_store_##_name)
>  
> -static W1_MASTER_ATTR_RO(name, S_IRUGO);
> -static W1_MASTER_ATTR_RO(slaves, S_IRUGO);
> -static W1_MASTER_ATTR_RO(slave_count, S_IRUGO);
> -static W1_MASTER_ATTR_RW(max_slave_count, S_IRUGO | S_IWUSR | S_IWGRP);
> -static W1_MASTER_ATTR_RO(attempts, S_IRUGO);
> -static W1_MASTER_ATTR_RO(timeout, S_IRUGO);
> -static W1_MASTER_ATTR_RO(timeout_us, S_IRUGO);
> -static W1_MASTER_ATTR_RO(pointer, S_IRUGO);
> -static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUSR | S_IWGRP);
> -static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUSR | S_IWGRP);
> -static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUSR | S_IWGRP);
> -static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUSR | S_IWGRP);
> +static W1_MASTER_ATTR_RO(name, 0444);
> +static W1_MASTER_ATTR_RO(slaves, 0444);
> +static W1_MASTER_ATTR_RO(slave_count, 0444);
> +static W1_MASTER_ATTR_RW(max_slave_count, 0664);
> +static W1_MASTER_ATTR_RO(attempts, 0444);
> +static W1_MASTER_ATTR_RO(timeout, 0444);
> +static W1_MASTER_ATTR_RO(timeout_us, 0444);
> +static W1_MASTER_ATTR_RO(pointer, 0444);
> +static W1_MASTER_ATTR_RW(search, 0664);
> +static W1_MASTER_ATTR_RW(pullup, 0664);
> +static W1_MASTER_ATTR_RW(add, 0664);
> +static W1_MASTER_ATTR_RW(remove, 0664);

Since the permissions are the same for all instances, the macros
could be simplified further (e.g. W1_MASTER_ATTR_RW(remove)).

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ