'files' will be immediately reassigned. 'f_flags' and 'file' will be
overwritten in the if{} or seq_show() directly exits with an error.
so we don't need to consume CPU resources to initialize them.
Signed-off-by: Kaitao Cheng
---
v2 ChangeLog:
1.
During build compiler reports some 'false positive' warnings about
variables {'seq_ops', 'filtered_pids', 'other_pids'} may be used
uninitialized. This patch silences these warnings.
Also delete some useless spaces
Signed-off-by: Kaitao Cheng
---
kernel/
There is a function named ilog2() exist which can replace blksize.
The generated code will be shorter and more efficient on some
architecture, such as arm64. And ilog2() can be optimized according
to different architecture.
Signed-off-by: Kaitao Cheng
---
changes in v2:
Remove all
we don't need {len = PTR_ERR(pathname)} when IS_ERR(pathname) is false,
it's better to move it into if(IS_ERR(pathname)){}.
Signed-off-by: Kaitao Cheng
---
fs/proc/base.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index d8
During build compiler reports some 'false positive' warnings about
variables {'seq_ops', 'filtered_pids', 'other_pids'} may be used
uninitialized. This patch silences these warnings.
Also delete some useless spaces
Signed-off-by: Kaitao Cheng
---
kerne
blksize_bits() can be achieved through ilog2(), and ilog2() is
more efficient.
Signed-off-by: Kaitao Cheng
---
include/linux/blkdev.h | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2b33166b9daf..cce96abac4d4 100644
The variables{files, file} will definitely be assigned,
so we don't need to initialize them.
Signed-off-by: Kaitao Cheng
---
fs/proc/fd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 81882a13212d..6f95baf44e37 100644
--- a/fs
There is no need to make the 'node_order' variable static
since new value always be assigned before use it.
Signed-off-by: Kaitao Cheng
Signed-off-by: Muchun Song
---
mm/page_alloc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/page_alloc.c b/mm/page_all
From: Kaitao cheng
The simple_strto{l,ul} are deprecated, use kstrtou{l,ul} instead.
Signed-off-by: Kaitao cheng
---
drivers/base/core.c | 21 ++---
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 04bbcd7..ed145fb
From: Kaitao cheng
The simple_strto{l,ul} are deprecated, use kstrtou{l,ul} instead.
Signed-off-by: Kaitao cheng
---
drivers/base/core.c | 21 ++---
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 04bbcd7..ed145fb
10 matches
Mail list logo