All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module: main: remove unnecessary ‘0’ values from err
@ 2022-12-23  8:32 Li kunyu
  2022-12-23 15:03 ` Luis Chamberlain
  0 siblings, 1 reply; 3+ messages in thread
From: Li kunyu @ 2022-12-23  8:32 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-modules, linux-kernel, Li kunyu

err is assigned before use, so it does not need to initialize the
assignment.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 kernel/module/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/module/main.c b/kernel/module/main.c
index ff2dfd1f548d..6e6e0428b183 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2669,7 +2669,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
 		       int flags)
 {
 	struct module *mod;
-	long err = 0;
+	long err;
 	char *after_dashes;
 
 	/*
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] module: main: remove unnecessary ‘0’ values from err
  2022-12-23  8:32 [PATCH] module: main: remove unnecessary ‘0’ values from err Li kunyu
@ 2022-12-23 15:03 ` Luis Chamberlain
  0 siblings, 0 replies; 3+ messages in thread
From: Luis Chamberlain @ 2022-12-23 15:03 UTC (permalink / raw)
  To: Li kunyu; +Cc: linux-modules, linux-kernel

On Fri, Dec 23, 2022 at 04:32:32PM +0800, Li kunyu wrote:
> err is assigned before use, so it does not need to initialize the
> assignment.

Sorry no, for something so simple, it just smells like you are wanting
to incraese your commit count.

  Luis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] module: main: Remove unnecessary ‘0’ values from err
@ 2023-10-20  8:27 ZhouJie
  0 siblings, 0 replies; 3+ messages in thread
From: ZhouJie @ 2023-10-20  8:27 UTC (permalink / raw)
  To: mcgrof; +Cc: linux-modules, linux-kernel, ZhouJie

Remove redundant assignment .The variable 'err' was assigned a value
before its usage, making the initial assignment unnecessary. This commit
removes the redundant assignment, improving code clarity and efficiency.

Signed-off-by: ZhouJie <zhoujie@nfschina.com>
---
 kernel/module/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/module/main.c b/kernel/module/main.c
index 98fedfdb8db52..a3c036eb7bcdb 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -2830,7 +2830,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
 {
 	struct module *mod;
 	bool module_allocated = false;
-	long err = 0;
+	long err;
 	char *after_dashes;
 
 	/*
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-20  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-23  8:32 [PATCH] module: main: remove unnecessary ‘0’ values from err Li kunyu
2022-12-23 15:03 ` Luis Chamberlain
2023-10-20  8:27 [PATCH] module: main: Remove " ZhouJie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.