lkml.org 
[lkml]   [2020]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] proc: fix boolreturn.cocci warnings
From: kernel test robot <lkp@intel.com>

fs/proc/generic.c:204:9-10: WARNING: return of 0/1 in function 'is_pde_visible' with return type bool

Return statements in functions returning bool should use
true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

CC: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

url: https://github.com/0day-ci/linux/commits/Alexey-Gladkov/proc-use-subset-option-to-hide-some-top-level-procfs-entries/20200605-040818
base: d4899e5542c15062cc55cac0ca99025bb64edc61

generic.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -201,7 +201,7 @@ bool is_pde_visible(struct proc_fs_info
int i;

if (!fs_info->whitelist || pde == &proc_root)
- return 1;
+ return true;

read_lock(&proc_subdir_lock);

@@ -218,7 +218,7 @@ bool is_pde_visible(struct proc_fs_info

if (ent == pde) {
read_unlock(&proc_subdir_lock);
- return 1;
+ return true;
}

if (!S_ISDIR(ent->mode))
@@ -228,14 +228,14 @@ bool is_pde_visible(struct proc_fs_info
while (de != &proc_root) {
if (ent == de) {
read_unlock(&proc_subdir_lock);
- return 1;
+ return true;
}
de = de->parent;
}
}

read_unlock(&proc_subdir_lock);
- return 0;
+ return false;
}

static DEFINE_IDA(proc_inum_ida);
\
 
 \ /
  Last update: 2020-06-05 04:19    [W:0.173 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site