[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190706090019.rivposzrqesodhso@function>
Date: Sat, 6 Jul 2019 11:00:19 +0200
From: Samuel Thibault <samuel.thibault@...-lyon.org>
To: Markus Elfring <Markus.Elfring@....de>
Cc: speakup@...ux-speakup.org, devel@...verdev.osuosl.org,
Bhagyashri Dighole <digholebhagyashri@...il.com>,
Chris Brannon <chris@...-brannons.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kirk Reiser <kirk@...sers.ca>,
Okash Khawaja <okash.khawaja@...il.com>,
William Hubbs <w.d.hubbs@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] staging: speakup: One function call less in
speakup_win_enable()
Markus Elfring, le sam. 06 juil. 2019 10:15:30 +0200, a ecrit:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sat, 6 Jul 2019 10:03:56 +0200
>
> Avoid an extra function call by using a ternary operator instead of
> a conditional statement.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
Reviewed-by: Samuel Thibault <samuel.thibault@...-lyon.org>
> ---
> drivers/staging/speakup/main.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
> index 488f2539aa9a..03bbc9a4dbb3 100644
> --- a/drivers/staging/speakup/main.c
> +++ b/drivers/staging/speakup/main.c
> @@ -1917,10 +1917,9 @@ static void speakup_win_enable(struct vc_data *vc)
> return;
> }
> win_enabled ^= 1;
> - if (win_enabled)
> - synth_printf("%s\n", spk_msg_get(MSG_WINDOW_SILENCED));
> - else
> - synth_printf("%s\n", spk_msg_get(MSG_WINDOW_SILENCE_DISABLED));
> + synth_printf("%s\n", spk_msg_get(win_enabled
> + ? MSG_WINDOW_SILENCED
> + : MSG_WINDOW_SILENCE_DISABLED));
> }
>
> static void speakup_bits(struct vc_data *vc)
> --
> 2.22.0
>
--
Samuel
--- christ gives channel operator status to Dieu
-+- #ens-mim and hell -+-
Powered by blists - more mailing lists