linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>, Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 13/29] hwmon: (jc42) Replace S_<PERMS> with octal values
Date: Thu, 17 Jan 2019 13:13:33 -0800	[thread overview]
Message-ID: <1547759629-23007-14-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1547759629-23007-1-git-send-email-linux@roeck-us.net>

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/jc42.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index e5234f953a6d..4fa482ae0eb5 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -390,21 +390,21 @@ static umode_t jc42_is_visible(const void *_data, enum hwmon_sensor_types type,
 {
 	const struct jc42_data *data = _data;
 	unsigned int config = data->config;
-	umode_t mode = S_IRUGO;
+	umode_t mode = 0444;
 
 	switch (attr) {
 	case hwmon_temp_min:
 	case hwmon_temp_max:
 		if (!(config & JC42_CFG_EVENT_LOCK))
-			mode |= S_IWUSR;
+			mode |= 0200;
 		break;
 	case hwmon_temp_crit:
 		if (!(config & JC42_CFG_TCRIT_LOCK))
-			mode |= S_IWUSR;
+			mode |= 0200;
 		break;
 	case hwmon_temp_crit_hyst:
 		if (!(config & (JC42_CFG_EVENT_LOCK | JC42_CFG_TCRIT_LOCK)))
-			mode |= S_IWUSR;
+			mode |= 0200;
 		break;
 	case hwmon_temp_input:
 	case hwmon_temp_max_hyst:
-- 
2.7.4


  parent reply	other threads:[~2019-01-17 21:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 21:13 [PATCH 00/29] hwmon: Use permission specific SENSOR[_DEVICE]_ATTR Guenter Roeck
2019-01-17 21:13 ` [PATCH 01/29] hwmon: (gl518sm) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 02/29] hwmon: (gl520sm) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 03/29] hwmon: (gpio-fan) Replace S_<PERMS> with octal values Guenter Roeck
2019-01-17 21:13 ` [PATCH 04/29] hwmon: (hih6130) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 05/29] hwmon: (hwmon) Replace S_<PERMS> with octal values Guenter Roeck
2019-01-17 21:13 ` [PATCH 06/29] hwmon: (i5500_temp) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 07/29] hwmon: (i5k_amb) Replace S_<PERMS> with octal values Guenter Roeck
2019-01-17 21:13 ` [PATCH 08/29] hwmon: (ibmaem) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 09/29] hwmon: (ibmpex) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 10/29] hwmon: (iio_hwmon) Replace S_<PERMS> with octal values Guenter Roeck
2019-01-17 21:13 ` [PATCH 11/29] hwmon: (ina209) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 12/29] hwmon: (ina3221) " Guenter Roeck
2019-01-17 21:13 ` Guenter Roeck [this message]
2019-01-17 21:13 ` [PATCH 14/29] hwmon: (k8temp) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 15/29] hwmon: (lineage-pem) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 16/29] hwmon: (lm73) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 17/29] hwmon: (lm75) Replace S_<PERMS> with octal values Guenter Roeck
2019-01-17 21:13 ` [PATCH 18/29] hwmon: (lm77) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 19/29] hwmon: (lm80) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 20/29] hwmon: (lm83) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 21/29] hwmon: (lm90) Replace S_<PERMS> with octal values Guenter Roeck
2019-01-17 21:13 ` [PATCH 22/29] hwmon: (lm92) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 23/29] hwmon: (lm93) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 24/29] hwmon: (lm95241) Replace S_<PERMS> with octal values Guenter Roeck
2019-01-17 21:13 ` [PATCH 25/29] hwmon: (lm95245) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 26/29] hwmon: (ltc2990) Use permission specific SENSOR[_DEVICE]_ATTR variants Guenter Roeck
2019-01-17 21:13 ` [PATCH 27/29] hwmon: (ltc4151) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 28/29] hwmon: (ltc4222) " Guenter Roeck
2019-01-17 21:13 ` [PATCH 29/29] hwmon: (ltc4245) Replace S_<PERMS> with octal values Guenter Roeck

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=1547759629-23007-14-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    /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).