* [PATCH 1/3] mm: replace S_IRUGO with 0444
@ 2018-04-07 18:47 Paul McQuade
2018-04-07 18:47 ` [PATCH 2/3] mm: Replace S_IWUSR with 0200 Paul McQuade
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Paul McQuade @ 2018-04-07 18:47 UTC (permalink / raw)
To: paulmcquad
Cc: konrad.wilk, labbott, gregkh, akpm, guptap, vbabka, mgorman,
hannes, rientjes, mhocko, rppt, dave, hmclauchlan, tglx,
pombredanne, linux-kernel, linux-mm
Fix checkpatch warnings about S_IRUGO being less readable than
providing the permissions octal as '0444'.
Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
mm/cleancache.c | 8 ++++----
mm/cma_debug.c | 12 ++++++------
mm/dmapool.c | 2 +-
mm/frontswap.c | 8 ++++----
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/mm/cleancache.c b/mm/cleancache.c
index f7b9fdc79d97..90d259e69496 100644
--- a/mm/cleancache.c
+++ b/mm/cleancache.c
@@ -307,11 +307,11 @@ static int __init init_cleancache(void)
struct dentry *root = debugfs_create_dir("cleancache", NULL);
if (root == NULL)
return -ENXIO;
- debugfs_create_u64("succ_gets", S_IRUGO, root, &cleancache_succ_gets);
- debugfs_create_u64("failed_gets", S_IRUGO,
+ debugfs_create_u64("succ_gets", 0444, root, &cleancache_succ_gets);
+ debugfs_create_u64("failed_gets", 0444,
root, &cleancache_failed_gets);
- debugfs_create_u64("puts", S_IRUGO, root, &cleancache_puts);
- debugfs_create_u64("invalidates", S_IRUGO,
+ debugfs_create_u64("puts", 0444, root, &cleancache_puts);
+ debugfs_create_u64("invalidates", 0444,
root, &cleancache_invalidates);
#endif
return 0;
diff --git a/mm/cma_debug.c b/mm/cma_debug.c
index 275df8b5b22e..6494c7a7d257 100644
--- a/mm/cma_debug.c
+++ b/mm/cma_debug.c
@@ -178,17 +178,17 @@ static void cma_debugfs_add_one(struct cma *cma, int idx)
debugfs_create_file("free", S_IWUSR, tmp, cma,
&cma_free_fops);
- debugfs_create_file("base_pfn", S_IRUGO, tmp,
+ debugfs_create_file("base_pfn", 0444, tmp,
&cma->base_pfn, &cma_debugfs_fops);
- debugfs_create_file("count", S_IRUGO, tmp,
+ debugfs_create_file("count", 0444, tmp,
&cma->count, &cma_debugfs_fops);
- debugfs_create_file("order_per_bit", S_IRUGO, tmp,
+ debugfs_create_file("order_per_bit", 0444, tmp,
&cma->order_per_bit, &cma_debugfs_fops);
- debugfs_create_file("used", S_IRUGO, tmp, cma, &cma_used_fops);
- debugfs_create_file("maxchunk", S_IRUGO, tmp, cma, &cma_maxchunk_fops);
+ debugfs_create_file("used", 0444, tmp, cma, &cma_used_fops);
+ debugfs_create_file("maxchunk", 0444, tmp, cma, &cma_maxchunk_fops);
u32s = DIV_ROUND_UP(cma_bitmap_maxno(cma), BITS_PER_BYTE * sizeof(u32));
- debugfs_create_u32_array("bitmap", S_IRUGO, tmp, (u32*)cma->bitmap, u32s);
+ debugfs_create_u32_array("bitmap", 0444, tmp, (u32 *)cma->bitmap, u32s);
}
static int __init cma_debugfs_init(void)
diff --git a/mm/dmapool.c b/mm/dmapool.c
index 4d90a64b2fdc..6d4b97e7e9e9 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -105,7 +105,7 @@ show_pools(struct device *dev, struct device_attribute *attr, char *buf)
return PAGE_SIZE - size;
}
-static DEVICE_ATTR(pools, S_IRUGO, show_pools, NULL);
+static DEVICE_ATTR(pools, 0444, show_pools, NULL);
/**
* dma_pool_create - Creates a pool of consistent memory blocks, for dma.
diff --git a/mm/frontswap.c b/mm/frontswap.c
index fec8b5044040..3b41425d34cd 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -486,11 +486,11 @@ static int __init init_frontswap(void)
struct dentry *root = debugfs_create_dir("frontswap", NULL);
if (root == NULL)
return -ENXIO;
- debugfs_create_u64("loads", S_IRUGO, root, &frontswap_loads);
- debugfs_create_u64("succ_stores", S_IRUGO, root, &frontswap_succ_stores);
- debugfs_create_u64("failed_stores", S_IRUGO, root,
+ debugfs_create_u64("loads", 0444, root, &frontswap_loads);
+ debugfs_create_u64("succ_stores", 0444, root, &frontswap_succ_stores);
+ debugfs_create_u64("failed_stores", 0444, root,
&frontswap_failed_stores);
- debugfs_create_u64("invalidates", S_IRUGO,
+ debugfs_create_u64("invalidates", 0444,
root, &frontswap_invalidates);
#endif
return 0;
--
2.16.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] mm: Replace S_IWUSR with 0200
2018-04-07 18:47 [PATCH 1/3] mm: replace S_IRUGO with 0444 Paul McQuade
@ 2018-04-07 18:47 ` Paul McQuade
2018-04-07 18:47 ` [PATCH 3/3] mm: replace S_IRUSR | S_IWUSR with 0600 Paul McQuade
2018-04-07 20:11 ` [PATCH 1/3] mm: replace S_IRUGO with 0444 Joe Perches
2 siblings, 0 replies; 5+ messages in thread
From: Paul McQuade @ 2018-04-07 18:47 UTC (permalink / raw)
To: paulmcquad
Cc: konrad.wilk, labbott, gregkh, akpm, guptap, vbabka, mgorman,
hannes, rientjes, mhocko, rppt, dave, hmclauchlan, tglx,
pombredanne, linux-kernel, linux-mm
Fix checkpatch warnings about S_IWUSR being less readable than
providing the permissions octal as '0200'.
Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
mm/cma_debug.c | 4 ++--
mm/compaction.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/cma_debug.c b/mm/cma_debug.c
index 6494c7a7d257..f0af3f93d1e4 100644
--- a/mm/cma_debug.c
+++ b/mm/cma_debug.c
@@ -172,10 +172,10 @@ static void cma_debugfs_add_one(struct cma *cma, int idx)
tmp = debugfs_create_dir(name, cma_debugfs_root);
- debugfs_create_file("alloc", S_IWUSR, tmp, cma,
+ debugfs_create_file("alloc", 0200, tmp, cma,
&cma_alloc_fops);
- debugfs_create_file("free", S_IWUSR, tmp, cma,
+ debugfs_create_file("free", 0200, tmp, cma,
&cma_free_fops);
debugfs_create_file("base_pfn", 0444, tmp,
diff --git a/mm/compaction.c b/mm/compaction.c
index 88d01a50a015..50d0000a6afd 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1900,7 +1900,7 @@ static ssize_t sysfs_compact_node(struct device *dev,
return count;
}
-static DEVICE_ATTR(compact, S_IWUSR, NULL, sysfs_compact_node);
+static DEVICE_ATTR(compact, 0200, NULL, sysfs_compact_node);
int compaction_register_node(struct node *node)
{
--
2.16.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] mm: replace S_IRUSR | S_IWUSR with 0600
2018-04-07 18:47 [PATCH 1/3] mm: replace S_IRUGO with 0444 Paul McQuade
2018-04-07 18:47 ` [PATCH 2/3] mm: Replace S_IWUSR with 0200 Paul McQuade
@ 2018-04-07 18:47 ` Paul McQuade
2018-04-07 20:11 ` [PATCH 1/3] mm: replace S_IRUGO with 0444 Joe Perches
2 siblings, 0 replies; 5+ messages in thread
From: Paul McQuade @ 2018-04-07 18:47 UTC (permalink / raw)
To: paulmcquad
Cc: konrad.wilk, labbott, gregkh, akpm, guptap, vbabka, mgorman,
hannes, rientjes, mhocko, rppt, dave, hmclauchlan, tglx,
pombredanne, linux-kernel, linux-mm
Fix checkpatch warnings about S_IRUSR | S_IWUSR being less readable than
providing the permissions octal as '0600'.
Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
mm/failslab.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/failslab.c b/mm/failslab.c
index 1f2f248e3601..b135ebb88b6f 100644
--- a/mm/failslab.c
+++ b/mm/failslab.c
@@ -42,7 +42,7 @@ __setup("failslab=", setup_failslab);
static int __init failslab_debugfs_init(void)
{
struct dentry *dir;
- umode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
+ umode_t mode = S_IFREG | 0600;
dir = fault_create_debugfs_attr("failslab", NULL, &failslab.attr);
if (IS_ERR(dir))
--
2.16.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] mm: replace S_IRUGO with 0444
2018-04-07 18:47 [PATCH 1/3] mm: replace S_IRUGO with 0444 Paul McQuade
2018-04-07 18:47 ` [PATCH 2/3] mm: Replace S_IWUSR with 0200 Paul McQuade
2018-04-07 18:47 ` [PATCH 3/3] mm: replace S_IRUSR | S_IWUSR with 0600 Paul McQuade
@ 2018-04-07 20:11 ` Joe Perches
2018-04-07 20:37 ` Paul Mc Quade
2 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2018-04-07 20:11 UTC (permalink / raw)
To: Paul McQuade
Cc: konrad.wilk, labbott, gregkh, akpm, guptap, vbabka, mgorman,
hannes, rientjes, mhocko, rppt, dave, hmclauchlan, tglx,
pombredanne, linux-kernel, linux-mm
On Sat, 2018-04-07 at 19:47 +0100, Paul McQuade wrote:
> Fix checkpatch warnings about S_IRUGO being less readable than
> providing the permissions octal as '0444'.
Hey Paul.
I sent a cleanup a couple weeks ago to Andrew Morton for the
same thing.
https://lkml.org/lkml/2018/3/26/638
Andrew said he'd wait until after -rc1 is out.
btw: checkpatch can do this substitution automatically
cheers, Joe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] mm: replace S_IRUGO with 0444
2018-04-07 20:11 ` [PATCH 1/3] mm: replace S_IRUGO with 0444 Joe Perches
@ 2018-04-07 20:37 ` Paul Mc Quade
0 siblings, 0 replies; 5+ messages in thread
From: Paul Mc Quade @ 2018-04-07 20:37 UTC (permalink / raw)
To: Joe Perches
Cc: konrad.wilk, labbott, gregkh, akpm, guptap, vbabka, mgorman,
hannes, rientjes, mhocko, rppt, dave, hmclauchlan, tglx,
pombredanne, linux-kernel, linux-mm
[-- Attachment #1: Type: text/plain, Size: 530 bytes --]
Cool, thanks! I didn't know that.
On Sat 7 Apr 2018, 21:11 Joe Perches <joe@perches.com> wrote:
> On Sat, 2018-04-07 at 19:47 +0100, Paul McQuade wrote:
> > Fix checkpatch warnings about S_IRUGO being less readable than
> > providing the permissions octal as '0444'.
>
> Hey Paul.
>
> I sent a cleanup a couple weeks ago to Andrew Morton for the
> same thing.
>
> https://lkml.org/lkml/2018/3/26/638
>
> Andrew said he'd wait until after -rc1 is out.
>
> btw: checkpatch can do this substitution automatically
>
> cheers, Joe
>
[-- Attachment #2: Type: text/html, Size: 938 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-04-07 20:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-07 18:47 [PATCH 1/3] mm: replace S_IRUGO with 0444 Paul McQuade
2018-04-07 18:47 ` [PATCH 2/3] mm: Replace S_IWUSR with 0200 Paul McQuade
2018-04-07 18:47 ` [PATCH 3/3] mm: replace S_IRUSR | S_IWUSR with 0600 Paul McQuade
2018-04-07 20:11 ` [PATCH 1/3] mm: replace S_IRUGO with 0444 Joe Perches
2018-04-07 20:37 ` Paul Mc Quade
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).