summaryrefslogtreecommitdiff
path: root/drivers/staging/speakup
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-06-10 19:33:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-13 03:19:47 +0300
commit590aeb174ad41292322c12d4fe24885bc7f074e5 (patch)
tree655913bfcbb3f1dfbd81ac18bd0fe5db6eb0f33c /drivers/staging/speakup
parent2ccd94e412be244d46fdf3261763d921d4918761 (diff)
downloadlinux-590aeb174ad41292322c12d4fe24885bc7f074e5.tar.xz
staging: speakup: use swap() in get_highlight_color()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup')
-rw-r--r--drivers/staging/speakup/main.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c955976414ee..6c4f9a1ed07f 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)