diff mbox series

platform/x86: samsung-laptop: set debugfs blobs to read only

Message ID 20210504123139.45101-1-wsa+renesas@sang-engineering.com (mailing list archive)
State Superseded, archived
Headers show
Series platform/x86: samsung-laptop: set debugfs blobs to read only | expand

Commit Message

Wolfram Sang May 4, 2021, 12:31 p.m. UTC
Those blobs can only be read. So, don't confuse users with 'writable'
flags.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Found while working with blobs myself. I don't have the HW.

 drivers/platform/x86/samsung-laptop.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Andy Shevchenko May 4, 2021, 12:40 p.m. UTC | #1
On Tue, May 4, 2021 at 3:32 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> Those blobs can only be read. So, don't confuse users with 'writable'
> flags.

Wouldn't it make sense at the same time to convert ugly namings to
octal permissions?
Wolfram Sang May 4, 2021, 12:51 p.m. UTC | #2
> > Those blobs can only be read. So, don't confuse users with 'writable'
> > flags.
> 
> Wouldn't it make sense at the same time to convert ugly namings to
> octal permissions?

I think this is out-of-scpoe for this patch. While I also use octals
personally, I don't feel strongly about it and let others use what they
prefer.
Andy Shevchenko May 4, 2021, 1:09 p.m. UTC | #3
On Tue, May 4, 2021 at 3:51 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> > > Those blobs can only be read. So, don't confuse users with 'writable'
> > > flags.
> >
> > Wouldn't it make sense at the same time to convert ugly namings to
> > octal permissions?
>
> I think this is out-of-scpoe for this patch. While I also use octals
> personally, I don't feel strongly about it and let others use what they
> prefer.

Linus has (had?) a strong opinion about it. My point is to reduce the
churn since two patches fixing the very same parameter in a row seems
too much to me.
https://lwn.net/Articles/696227/
Wolfram Sang May 4, 2021, 1:17 p.m. UTC | #4
> Linus has (had?) a strong opinion about it. My point is to reduce the

OK, I see. Thanks for the pointer!

> churn since two patches fixing the very same parameter in a row seems
> too much to me.

I'd still prefer that and having a seperate patch fixing the whole
driver. IMO better than having a mixture of octals and defines.
Andy Shevchenko May 4, 2021, 3:05 p.m. UTC | #5
On Tue, May 4, 2021 at 4:17 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
>
> > Linus has (had?) a strong opinion about it. My point is to reduce the
>
> OK, I see. Thanks for the pointer!
>
> > churn since two patches fixing the very same parameter in a row seems
> > too much to me.
>
> I'd still prefer that and having a seperate patch fixing the whole
> driver. IMO better than having a mixture of octals and defines.

You can convert the rest as well. And point out that only blobs are RO.
Whatever, the main idea is to do both things either with one patch or
two in a series at the same time.
diff mbox series

Patch

diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index d5cec6e35bb8..7e1dedde6dab 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -1301,13 +1301,13 @@  static void samsung_debugfs_init(struct samsung_laptop *samsung)
 			   &samsung->debug.data.d2);
 	debugfs_create_u8("d3", S_IRUGO | S_IWUSR, root,
 			  &samsung->debug.data.d3);
-	debugfs_create_blob("data", S_IRUGO | S_IWUSR, root,
+	debugfs_create_blob("data", S_IRUGO, root,
 			    &samsung->debug.data_wrapper);
-	debugfs_create_blob("f0000_segment", S_IRUSR | S_IWUSR, root,
+	debugfs_create_blob("f0000_segment", S_IRUSR, root,
 			    &samsung->debug.f0000_wrapper);
 	debugfs_create_file("call", S_IFREG | S_IRUGO, root, samsung,
 			    &samsung_laptop_call_fops);
-	debugfs_create_blob("sdiag", S_IRUGO | S_IWUSR, root,
+	debugfs_create_blob("sdiag", S_IRUGO, root,
 			    &samsung->debug.sdiag_wrapper);
 }