public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel: Optimize unused integer return values
@ 2022-04-27  7:34 Li kunyu
  2022-04-27  7:47 ` Marco Elver
  2022-04-28  1:59 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Li kunyu @ 2022-04-27  7:34 UTC (permalink / raw)
  To: ebiederm, keescook, tglx, elver; +Cc: oleg, legion, linux-kernel, Li kunyu

Optimize unused integer return values

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 kernel/signal.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index 30cd1ca43bcd..ae58a966c8de 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3464,7 +3464,7 @@ int __copy_siginfo_to_user32(struct compat_siginfo __user *to,
 	return 0;
 }
 
-static int post_copy_siginfo_from_user32(kernel_siginfo_t *to,
+static void post_copy_siginfo_from_user32(kernel_siginfo_t *to,
 					 const struct compat_siginfo *from)
 {
 	clear_siginfo(to);
@@ -3548,7 +3548,8 @@ static int __copy_siginfo_from_user32(int signo, struct kernel_siginfo *to,
 		return -EFAULT;
 
 	from.si_signo = signo;
-	return post_copy_siginfo_from_user32(to, &from);
+	post_copy_siginfo_from_user32(to, &from);
+	return 0;
 }
 
 int copy_siginfo_from_user32(struct kernel_siginfo *to,
@@ -3559,7 +3560,8 @@ int copy_siginfo_from_user32(struct kernel_siginfo *to,
 	if (copy_from_user(&from, ufrom, sizeof(struct compat_siginfo)))
 		return -EFAULT;
 
-	return post_copy_siginfo_from_user32(to, &from);
+	post_copy_siginfo_from_user32(to, &from);
+	return 0;
 }
 #endif /* CONFIG_COMPAT */
 
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* Re: [PATCH] kernel: Optimize unused integer return values
@ 2022-04-27  8:54 Li kunyu
  0 siblings, 0 replies; 4+ messages in thread
From: Li kunyu @ 2022-04-27  8:54 UTC (permalink / raw)
  To: elver; +Cc: ebiederm, keescook, tglx, oleg, legion, linux-kernel

Sorry, this patch is incomplete. I have the following ideas

post_copy_siginfo_from_User32 function can change the integer return value 0 to void return type, and its caller return value is based on it. Can the return type of related function be changed to void.

If you agree with this idea, I will resend the patc

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

end of thread, other threads:[~2022-04-28  2:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-27  7:34 [PATCH] kernel: Optimize unused integer return values Li kunyu
2022-04-27  7:47 ` Marco Elver
2022-04-28  1:59 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-04-27  8:54 Li kunyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox