summaryrefslogtreecommitdiff
path: root/i386/i386at
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-02-04 13:11:24 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-02-04 13:11:24 +0100
commit1046eda445bb33249555cf186344ffb3431e6478 (patch)
treeca72aaa007d6ec4007859b5d032ffc1fa569e4bb /i386/i386at
parenta9f5cf5d2ff55abdd05a2ab6965d8b4ba190eac9 (diff)
Make empty while loops more prominent
* i386/i386at/kd.c (kdintr, kd_senddata, kd_sendcmd, kd_getgata, kd_cmdreg_read, kd_cmdreg_write, kd_mouse_drain): Move semi colon of empty while loops on a single line to make it more visible.
Diffstat (limited to 'i386/i386at')
-rw-r--r--i386/i386at/kd.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index f70175c..d6b75af 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -738,7 +738,8 @@ int vec;
tp = &kd_tty;
#ifdef old
- while ((inb(K_STATUS) & K_OBUF_FUL) == 0); /* this should never loop */
+ while ((inb(K_STATUS) & K_OBUF_FUL) == 0)
+ ; /* this should never loop */
#else /* old */
{
/*
@@ -2232,7 +2233,8 @@ void
kd_senddata(ch)
unsigned char ch;
{
- while (inb(K_STATUS) & K_IBUF_FUL);
+ while (inb(K_STATUS) & K_IBUF_FUL)
+ ;
outb(K_RDWR, ch);
last_sent = ch;
return;
@@ -2250,7 +2252,8 @@ void
kd_sendcmd(ch)
unsigned char ch;
{
- while (inb(K_STATUS) & K_IBUF_FUL);
+ while (inb(K_STATUS) & K_IBUF_FUL)
+ ;
outb(K_CMD, ch);
return;
}
@@ -2266,7 +2269,8 @@ unsigned char ch;
unsigned char
kd_getdata(void)
{
- while ((inb(K_STATUS) & K_OBUF_FUL) == 0);
+ while ((inb(K_STATUS) & K_OBUF_FUL) == 0)
+ ;
return(inb(K_RDWR));
}
@@ -2275,10 +2279,12 @@ kd_cmdreg_read(void)
{
int ch=KC_CMD_READ;
- while (inb(K_STATUS) & K_IBUF_FUL);
+ while (inb(K_STATUS) & K_IBUF_FUL)
+ ;
outb(K_CMD, ch);
- while ((inb(K_STATUS) & K_OBUF_FUL) == 0);
+ while ((inb(K_STATUS) & K_OBUF_FUL) == 0)
+ ;
return(inb(K_RDWR));
}
@@ -2287,10 +2293,12 @@ kd_cmdreg_write(int val)
{
int ch=KC_CMD_WRITE;
- while (inb(K_STATUS) & K_IBUF_FUL);
+ while (inb(K_STATUS) & K_IBUF_FUL)
+ ;
outb(K_CMD, ch);
- while (inb(K_STATUS) & K_IBUF_FUL);
+ while (inb(K_STATUS) & K_IBUF_FUL)
+ ;
outb(K_RDWR, val);
}
@@ -2298,7 +2306,8 @@ void
kd_mouse_drain(void)
{
int i;
- while(inb(K_STATUS) & K_IBUF_FUL);
+ while(inb(K_STATUS) & K_IBUF_FUL)
+ ;
while((i = inb(K_STATUS)) & K_OBUF_FUL)
printf("kbd: S = %x D = %x\n", i, inb(K_RDWR));
}