linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: speakup@linux-speakup.org, devel@driverdev.osuosl.org,
	Bhagyashri Dighole <digholebhagyashri@gmail.com>,
	Chris Brannon <chris@the-brannons.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kirk Reiser <kirk@reisers.ca>,
	Okash Khawaja <okash.khawaja@gmail.com>,
	Samuel Thibault <samuel.thibault@ens-lyon.org>,
	William Hubbs <w.d.hubbs@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] staging: speakup: One function call less in speakup_win_enable()
Date: Sat, 6 Jul 2019 10:15:30 +0200	[thread overview]
Message-ID: <11f79333-25c3-1ad9-4975-58c64821f3fe@web.de> (raw)

From: Markus Elfring <elfring@users.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@users.sourceforge.net>
---
 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


             reply	other threads:[~2019-07-06  8:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-06  8:15 Markus Elfring [this message]
2019-07-06  9:00 ` [PATCH] staging: speakup: One function call less in speakup_win_enable() Samuel Thibault
2019-07-06  9:28   ` Greg Kroah-Hartman

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=11f79333-25c3-1ad9-4975-58c64821f3fe@web.de \
    --to=markus.elfring@web.de \
    --cc=chris@the-brannons.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=digholebhagyashri@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kirk@reisers.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okash.khawaja@gmail.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=speakup@linux-speakup.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).