* [PATCH 1/1 linux-next] staging: speakup: use swap() in get_highlight_color()
@ 2015-06-10 16:33 Fabian Frederick
0 siblings, 0 replies; only message in thread
From: Fabian Frederick @ 2015-06-10 16:33 UTC (permalink / raw
To: linux-kernel
Cc: Julia Lawall, Fabian Frederick, William Hubbs, Chris Brannon,
Kirk Reiser, Samuel Thibault, Greg Kroah-Hartman, speakup, devel
Use kernel.h macro definition.
Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
drivers/staging/speakup/main.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c955976..6c4f9a1 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1597,7 +1597,7 @@ static int count_highlight_color(struct vc_data *vc)
static int get_highlight_color(struct vc_data *vc)
{
int i, j;
- unsigned int cptr[8], tmp;
+ unsigned int cptr[8];
int vc_num = vc->vc_num;
for (i = 0; i < 8; i++)
@@ -1606,11 +1606,8 @@ static int get_highlight_color(struct vc_data *vc)
for (i = 0; i < 7; i++)
for (j = i + 1; j < 8; j++)
if (speakup_console[vc_num]->ht.bgcount[cptr[i]] >
- speakup_console[vc_num]->ht.bgcount[cptr[j]]) {
- tmp = cptr[i];
- cptr[i] = cptr[j];
- cptr[j] = tmp;
- }
+ speakup_console[vc_num]->ht.bgcount[cptr[j]])
+ swap(cptr[i], cptr[j]);
for (i = 0; i < 8; i++)
if (speakup_console[vc_num]->ht.bgcount[cptr[i]] != 0)
--
2.4.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-10 16:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 16:33 [PATCH 1/1 linux-next] staging: speakup: use swap() in get_highlight_color() Fabian Frederick
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 read-only IMAP folder(s) and NNTP newsgroup(s).