]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
hwmon: (hwmon) Replace S_<PERMS> with octal values
authorGuenter Roeck <linux@roeck-us.net>
Mon, 10 Dec 2018 22:02:08 +0000 (14:02 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 18 Feb 2019 22:23:29 +0000 (14:23 -0800)
Replace S_<PERMS> with octal values.

The conversion was done automatically with coccinelle. The semantic patches
and the scripts used to generate this commit log are available at
https://github.com/groeck/coccinelle-patches/hwmon/.

This patch does not introduce functional changes. It was verified by
compiling the old and new files and comparing text and data sizes.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/hwmon.c

index 36ed50d4b276fccd40bfc88f18b019b52083bd9d..c22dc1e079113f9174fe3b6a5bb1b0f6a4c9e724 100644 (file)
@@ -278,10 +278,10 @@ static struct attribute *hwmon_genattr(struct device *dev,
        if (!mode)
                return ERR_PTR(-ENOENT);
 
-       if ((mode & S_IRUGO) && ((is_string && !ops->read_string) ||
+       if ((mode & 0444) && ((is_string && !ops->read_string) ||
                                 (!is_string && !ops->read)))
                return ERR_PTR(-EINVAL);
-       if ((mode & S_IWUGO) && !ops->write)
+       if ((mode & 0222) && !ops->write)
                return ERR_PTR(-EINVAL);
 
        hattr = devm_kzalloc(dev, sizeof(*hattr), GFP_KERNEL);