* [PATCH 1/1 linux-next] staging: xgifb: use swap() in XGI_WriteDAC()
@ 2015-05-18 17:34 Fabian Frederick
0 siblings, 0 replies; only message in thread
From: Fabian Frederick @ 2015-05-18 17:34 UTC (permalink / raw)
To: linux-kernel; +Cc: Fabian Frederick, Arnaud Patard, Greg Kroah-Hartman, devel
Use kernel.h macro definition.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
drivers/staging/xgifb/vb_setmode.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index a47395e..3b0b4d3 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -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);
--
2.4.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-05-18 17:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-18 17:34 [PATCH 1/1 linux-next] staging: xgifb: use swap() in XGI_WriteDAC() 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 NNTP newsgroup(s).