* Re: [PATCH] kernel: reboot: Remove unnecessary ‘0’ values from ret
2023-07-11 20:21 [PATCH] kernel: reboot: Remove unnecessary ‘0’ values from ret Li zeming
@ 2023-07-10 3:53 ` Randy Dunlap
0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2023-07-10 3:53 UTC (permalink / raw)
To: Li zeming, rafael.j.wysocki, kai.heng.feng, dmitry.osipenko; +Cc: linux-kernel
On 7/11/23 13:21, Li zeming wrote:
> ret is assigned first, so it does not need to initialize the assignment.
>
> Signed-off-by: Li zeming <zeming@nfschina.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
> ---
> kernel/reboot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index 3bba88c7ffc6..e00a02a74694 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -702,7 +702,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
> {
> struct pid_namespace *pid_ns = task_active_pid_ns(current);
> char buffer[256];
> - int ret = 0;
> + int ret;
>
> /* We only trust the superuser with rebooting the system. */
> if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))
--
~Randy
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] kernel: reboot: Remove unnecessary ‘0’ values from ret
@ 2023-07-11 20:21 Li zeming
2023-07-10 3:53 ` Randy Dunlap
0 siblings, 1 reply; 2+ messages in thread
From: Li zeming @ 2023-07-11 20:21 UTC (permalink / raw)
To: rafael.j.wysocki, kai.heng.feng, dmitry.osipenko; +Cc: linux-kernel, Li zeming
ret is assigned first, so it does not need to initialize the assignment.
Signed-off-by: Li zeming <zeming@nfschina.com>
---
kernel/reboot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/reboot.c b/kernel/reboot.c
index 3bba88c7ffc6..e00a02a74694 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -702,7 +702,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
{
struct pid_namespace *pid_ns = task_active_pid_ns(current);
char buffer[256];
- int ret = 0;
+ int ret;
/* We only trust the superuser with rebooting the system. */
if (!ns_capable(pid_ns->user_ns, CAP_SYS_BOOT))
--
2.18.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-10 3:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-11 20:21 [PATCH] kernel: reboot: Remove unnecessary ‘0’ values from ret Li zeming
2023-07-10 3:53 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®