From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiri Kosina <jikos@kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Andy Shevchenko <andy@kernel.org>
Subject: [PATCH v1 12/12] HID: cp2112: Use octal permissions
Date: Mon, 3 Jul 2023 21:52:22 +0300 [thread overview]
Message-ID: <20230703185222.50554-13-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20230703185222.50554-1-andriy.shevchenko@linux.intel.com>
Octal permissions are preferred as stated in
Documentation/dev-tools/checkpatch.rst. Replace symbolic permissions
with octal permissions when creating the files.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/hid/hid-cp2112.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 3c6a3be8fc02..adbe8a47cf67 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -175,7 +175,7 @@ struct cp2112_device {
};
static int gpio_push_pull = CP2112_GPIO_ALL_GPIO_MASK;
-module_param(gpio_push_pull, int, S_IRUGO | S_IWUSR);
+module_param(gpio_push_pull, int, 0644);
MODULE_PARM_DESC(gpio_push_pull, "GPIO push-pull configuration bitmask");
static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
@@ -1057,7 +1057,7 @@ static void chmod_sysfs_attrs(struct hid_device *hdev)
}
for (attr = cp2112_attr_group.attrs; *attr; ++attr) {
- umode_t mode = (buf[1] & 1) ? S_IWUSR | S_IRUGO : S_IRUGO;
+ umode_t mode = (buf[1] & 1) ? 0644: 0444;
ret = sysfs_chmod_file(&hdev->dev.kobj, *attr, mode);
if (ret < 0)
hid_err(hdev, "error chmoding sysfs file %s\n",
--
2.40.0.1.gaa8946217a0b
next prev parent reply other threads:[~2023-07-03 18:52 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 18:52 [PATCH v1 00/12] HID: cp2112: Cleanups and refactorings Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 01/12] lib/string_choices: Add str_write_read() helper Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 02/12] HID: cp2112: Use str_write_read() and str_read_write() Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 03/12] HID: cp2112: Make irq_chip immutable Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 04/12] HID: cp2112: Switch to for_each_set_bit() to simplify the code Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 05/12] HID: cp2112: Don't call ->to_irq() explicitly Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 06/12] HID: cp2112: Remove dead code Andy Shevchenko
2023-08-26 18:29 ` Christophe JAILLET
2023-08-28 8:52 ` Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 07/12] HID: cp2112: Define maximum GPIO constant and use it Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 08/12] HID: cp2112: Define all GPIO mask " Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 09/12] HID: cp2112: Use BIT() in GPIO setter and getter Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 10/12] HID: cp2112: Use sysfs_emit() to instead of scnprintf() Andy Shevchenko
2023-07-03 18:52 ` [PATCH v1 11/12] HID: cp2112: Convert to DEVICE_ATTR_RW() Andy Shevchenko
2023-07-03 18:52 ` Andy Shevchenko [this message]
2023-07-27 18:43 ` [PATCH v1 00/12] HID: cp2112: Cleanups and refactorings Andy Shevchenko
2023-08-04 6:40 ` Andy Shevchenko
2023-08-07 11:19 ` Jiri Kosina
2023-08-07 14:30 ` Andy Shevchenko
2023-08-14 9:28 ` Jiri Kosina
2023-08-21 8:11 ` Andy Shevchenko
2023-08-21 8:51 ` Benjamin Tissoires
2023-08-21 9:34 ` Andy Shevchenko
2023-08-21 9:35 ` Andy Shevchenko
2023-08-21 10:19 ` Benjamin Tissoires
2023-08-21 10:27 ` Benjamin Tissoires
2023-08-21 10:37 ` Andy Shevchenko
2023-08-21 13:56 ` Benjamin Tissoires
2023-08-21 10:32 ` Andy Shevchenko
2023-08-21 12:06 ` Benjamin Tissoires
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=20230703185222.50554-13-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@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).