staging: xgifb: use swap() in XGI_WriteDAC()
authorFabian Frederick <fabf@skynet.be>
Mon, 18 May 2015 17:34:15 +0000 (19:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 01:30:40 +0000 (10:30 +0900)
Use kernel.h macro definition.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/xgifb/vb_setmode.c

index 3f7c10e..c886dd2 100644 (file)
@@ -1081,24 +1081,17 @@ static void XGI_WriteDAC(unsigned short dl,
                         unsigned short dh,
                         struct vb_device_info *pVBInfo)
 {
-       unsigned short temp, bh, bl;
+       unsigned short bh, bl;
 
        bh = ah;
        bl = al;
 
        if (dl != 0) {
-               temp = bh;
-               bh = dh;
-               dh = temp;
-               if (dl == 1) {
-                       temp = bl;
-                       bl = dh;
-                       dh = temp;
-               } else {
-                       temp = bl;
-                       bl = bh;
-                       bh = temp;
-               }
+               swap(bh, dh);
+               if (dl == 1)
+                       swap(bl, dh);
+               else
+                       swap(bl, bh);
        }
        outb((unsigned short) dh, pVBInfo->P3c9);
        outb((unsigned short) bh, pVBInfo->P3c9);