public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Li zeming <zeming@nfschina.com>
Cc: gor@linux.ibm.com, hca@linux.ibm.com,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH] stackleak: Remove unnecessary '0' values from ret
Date: Tue, 17 Oct 2023 11:14:43 +0100	[thread overview]
Message-ID: <ZS5ek5RrW3XaBph9@FVFF77S0Q05N> (raw)
In-Reply-To: <20231017060824.10434-1-zeming@nfschina.com>

On Tue, Oct 17, 2023 at 02:08:24PM +0800, Li zeming wrote:
> ret is assigned first, so it does not need to initialize the assignment.
> 
> Signed-off-by: Li zeming <zeming@nfschina.com>

Does this actually need to change? It's not harmful, and deleting the
assignment doesn't save any lines of code.

That said, I don't have strong feelings either way, and Kees is the
de-facto-yet-undocumented maintainer for this code, so I will leave it to him
to decide whether to apply.

Mark.

> ---
>  kernel/stackleak.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/stackleak.c b/kernel/stackleak.c
> index 34c9d81eea940..3faf863593846 100644
> --- a/kernel/stackleak.c
> +++ b/kernel/stackleak.c
> @@ -24,7 +24,7 @@ static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass);
>  static int stack_erasing_sysctl(struct ctl_table *table, int write,
>  			void __user *buffer, size_t *lenp, loff_t *ppos)
>  {
> -	int ret = 0;
> +	int ret;
>  	int state = !static_branch_unlikely(&stack_erasing_bypass);
>  	int prev_state = state;
>  
> -- 
> 2.18.2
> 

  reply	other threads:[~2023-10-17 10:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17  6:08 [PATCH] stackleak: Remove unnecessary ‘0’ values from ret Li zeming
2023-10-17 10:14 ` Mark Rutland [this message]
2023-10-19  0:39   ` [PATCH] stackleak: Remove unnecessary '0' " Kees Cook
2023-11-01  4:03     ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZS5ek5RrW3XaBph9@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zeming@nfschina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox