From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Lourdes Pedrajas <lu@pplo.net>
Cc: outreachy-kernel@googlegroups.com, w.d.hubbs@gmail.com,
chris@the-brannons.com, kirk@reisers.ca,
gregkh@linuxfoundation.org
Subject: Re: [PATCH] staging: speakup: main: switch multiple assignment for one assignment per line
Date: Sun, 15 Mar 2020 17:24:46 +0100 [thread overview]
Message-ID: <20200315162446.evxlgilfye35eosq@function> (raw)
In-Reply-To: <20200315044051.13921-1-lu@pplo.net>
Hello,
Lourdes Pedrajas, le dim. 15 mars 2020 05:40:51 +0100, a ecrit:
> One assignment per line is preferred, instead of multiple assignments.
> To prevent possible undefined behavior.
Here the behavior is completely defined, but one assignment per line
makes it more readable.
> Issue found with checkpath.
>
> Signed-off-by: Lourdes Pedrajas <lu@pplo.net>
> ---
> drivers/staging/speakup/main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 488f2539aa9a..d363009863e3 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -2117,7 +2117,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym,
> spk_keydown = 0;
> goto out;
> }
> - value = spk_lastkey = pad_chars[value];
> + spk_lastkey = pad_chars[value];
> + value = pad_chars[value];
Please rather use
value = pad_chars[value];
spk_lastkey = value
To make it clear that it's the same value which is used, and to have the
spk_something assignment next to the other spk_something assignments.
> spk_keydown++;
> spk_parked &= 0xfe;
> goto no_map;
> --
> 2.17.1
>
next prev parent reply other threads:[~2020-03-15 16:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-15 4:40 [PATCH] staging: speakup: main: switch multiple assignment for one assignment per line Lourdes Pedrajas
2020-03-15 16:24 ` Samuel Thibault [this message]
2020-03-15 21:44 ` Lourdes Pedrajas
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=20200315162446.evxlgilfye35eosq@function \
--to=samuel.thibault@ens-lyon.org \
--cc=chris@the-brannons.com \
--cc=gregkh@linuxfoundation.org \
--cc=kirk@reisers.ca \
--cc=lu@pplo.net \
--cc=outreachy-kernel@googlegroups.com \
--cc=w.d.hubbs@gmail.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 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.