>>> Tom Cosgrove 6-Jun-16 21:07 >>>
>
> As per subject, a couple of empty loop bodies in the i396 and amd64 boot 
> blocks.
>
> Diff below.
>
> Tom

Subsequently found a few more, and a handful of trailing whitespaces.

Updated diff below.

Thanks

Tom


Index: sys/arch/amd64/stand/efiboot/efidev.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/efiboot/efidev.c,v
retrieving revision 1.18
diff -u -p -u -r1.18 efidev.c
--- sys/arch/amd64/stand/efiboot/efidev.c       6 May 2016 03:13:52 -0000       
1.18
+++ sys/arch/amd64/stand/efiboot/efidev.c       7 Jun 2016 20:40:16 -0000
@@ -568,7 +568,7 @@ efiopen(struct open_file *f, ...)
        }
 #endif
        for (maj = 0; maj < nbdevs &&
-           strncmp(dev, bdevs[maj], devlen); maj++);
+           strncmp(dev, bdevs[maj], devlen); maj++) continue;
        if (maj >= nbdevs) {
                printf("Unknown device: ");
                for (cp = *file; *cp != ':'; cp++)
Index: sys/arch/amd64/stand/libsa/bioscons.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/libsa/bioscons.c,v
retrieving revision 1.11
diff -u -p -u -r1.11 bioscons.c
--- sys/arch/amd64/stand/libsa/bioscons.c       27 May 2016 05:37:51 -0000      
1.11
+++ sys/arch/amd64/stand/libsa/bioscons.c       7 Jun 2016 20:40:16 -0000
@@ -155,7 +155,7 @@ com_init(struct consdev *cn)
 
        /* A few ms delay for the chip, using the getsecs() API */
        while (!(i++ % 1000) && getsecs() < tt)
-               ;
+               continue;
 
        /* drain the input buffer */
        while (inb(port + com_lsr) & LSR_RXRDY)
@@ -171,7 +171,7 @@ com_getc(dev_t dev)
                return (inb(port + com_lsr) & LSR_RXRDY);
 
        while ((inb(port + com_lsr) & LSR_RXRDY) == 0)
-               ;
+               continue;
 
        return (inb(port + com_data) & 0xff);
 }
@@ -237,7 +237,7 @@ com_putc(dev_t dev, int c)
        int port = (com_addr == -1) ? comports[minor(dev)] : com_addr;
 
        while ((inb(port + com_lsr) & LSR_TXRDY) == 0)
-               ;
+               continue;
 
        outb(port + com_data, c);
 }
Index: sys/arch/amd64/stand/libsa/biosdev.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/libsa/biosdev.c,v
retrieving revision 1.27
diff -u -p -u -r1.27 biosdev.c
--- sys/arch/amd64/stand/libsa/biosdev.c        1 Oct 2015 20:28:12 -0000       
1.27
+++ sys/arch/amd64/stand/libsa/biosdev.c        7 Jun 2016 20:40:16 -0000
@@ -560,7 +560,7 @@ biosopen(struct open_file *f, ...)
 #endif
 
        for (maj = 0; maj < nbdevs &&
-           strncmp(dev, bdevs[maj], devlen); maj++);
+           strncmp(dev, bdevs[maj], devlen); maj++) continue;
        if (maj >= nbdevs) {
                printf("Unknown device: ");
                for (cp = *file; *cp != ':'; cp++)
@@ -671,7 +671,8 @@ biosdisk_err(u_int error)
        register const u_char *p = bidos_errs;
 
        while (*p && *p != error)
-               while (*p++);
+               while (*p++)
+                       continue;
 
        return ++p;
 }
@@ -703,7 +704,8 @@ biosdisk_errno(u_int error)
        if (error == 0)
                return 0;
 
-       for (p = tab; p->error && p->error != error; p++);
+       for (p = tab; p->error && p->error != error; p++)
+               continue;
 
        return p->errno;
 }
Index: sys/arch/amd64/stand/libsa/diskprobe.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/libsa/diskprobe.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 diskprobe.c
--- sys/arch/amd64/stand/libsa/diskprobe.c      2 Sep 2015 01:52:26 -0000       
1.16
+++ sys/arch/amd64/stand/libsa/diskprobe.c      7 Jun 2016 20:40:16 -0000
@@ -266,7 +266,7 @@ diskprobe(void)
 
        /* Checksumming of hard disks */
        for (i = 0; disksum(i++) && i < MAX_CKSUMLEN; )
-               ;
+               continue;
        bios_cksumlen = i;
 
        /* Get space for passing bios_diskinfo stuff to kernel */
Index: sys/arch/amd64/stand/libsa/gateA20.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/libsa/gateA20.c,v
retrieving revision 1.2
diff -u -p -u -r1.2 gateA20.c
--- sys/arch/amd64/stand/libsa/gateA20.c        21 Mar 2004 21:37:41 -0000      
1.2
+++ sys/arch/amd64/stand/libsa/gateA20.c        7 Jun 2016 20:40:16 -0000
@@ -74,19 +74,19 @@ gateA20(int on)
                }
        } else {
 
-               while (inb(IO_KBD + KBSTATP) & KBS_IBF);
+               while (inb(IO_KBD + KBSTATP) & KBS_IBF) continue;
 
                while (inb(IO_KBD + KBSTATP) & KBS_DIB)
                        (void)inb(IO_KBD + KBDATAP);
 
                outb(IO_KBD + KBCMDP, KBC_CMDWOUT);
-               while (inb(IO_KBD + KBSTATP) & KBS_IBF);
+               while (inb(IO_KBD + KBSTATP) & KBS_IBF) continue;
 
                if (on)
                        outb(IO_KBD + KBDATAP, KB_A20);
                else
                        outb(IO_KBD + KBDATAP, 0xcd);
-               while (inb(IO_KBD + KBSTATP) & KBS_IBF);
+               while (inb(IO_KBD + KBSTATP) & KBS_IBF) continue;
 
                while (inb(IO_KBD + KBSTATP) & KBS_DIB)
                        (void)inb(IO_KBD + KBDATAP);
Index: sys/arch/amd64/stand/libsa/memprobe.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/libsa/memprobe.c,v
retrieving revision 1.16
diff -u -p -u -r1.16 memprobe.c
--- sys/arch/amd64/stand/libsa/memprobe.c       8 Oct 2015 14:46:05 -0000       
1.16
+++ sys/arch/amd64/stand/libsa/memprobe.c       7 Jun 2016 20:40:16 -0000
@@ -442,7 +442,7 @@ mem_pass(void)
        bios_memmap_t *p;
 
        for (p = bios_memmap; p->type != BIOS_MAP_END; p++)
-               ;
+               continue;
        addbootarg(BOOTARG_MEMMAP, (p - bios_memmap + 1) * sizeof *bios_memmap,
            bios_memmap);
 }
Index: sys/arch/amd64/stand/libsa/time.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/amd64/stand/libsa/time.c,v
retrieving revision 1.5
diff -u -p -u -r1.5 time.c
--- sys/arch/amd64/stand/libsa/time.c   23 Sep 2014 17:59:25 -0000      1.5
+++ sys/arch/amd64/stand/libsa/time.c   7 Jun 2016 20:40:16 -0000
@@ -14,8 +14,8 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
@@ -142,7 +142,7 @@ sleep(u_int i)
         * so that it may handle interrupts.
         */
        for (t = getsecs() + i; getsecs() < t; cnischar())
-               ;
+               continue;
 
        return 0;
 }
Index: sys/arch/i386/stand/libsa/bioscons.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/i386/stand/libsa/bioscons.c,v
retrieving revision 1.36
diff -u -p -u -r1.36 bioscons.c
--- sys/arch/i386/stand/libsa/bioscons.c        27 May 2016 05:37:51 -0000      
1.36
+++ sys/arch/i386/stand/libsa/bioscons.c        7 Jun 2016 20:40:16 -0000
@@ -152,7 +152,7 @@ com_init(struct consdev *cn)
 
        /* A few ms delay for the chip, using the getsecs() API */
        while (!(i++ % 1000) && getsecs() < tt)
-               ;
+               continue;
 
        /* drain the input buffer */
        while (inb(port + com_lsr) & LSR_RXRDY)
@@ -168,7 +168,7 @@ com_getc(dev_t dev)
                return (inb(port + com_lsr) & LSR_RXRDY);
 
        while ((inb(port + com_lsr) & LSR_RXRDY) == 0)
-               ;
+               continue;
 
        return (inb(port + com_data) & 0xff);
 }
@@ -234,7 +234,7 @@ com_putc(dev_t dev, int c)
        int port = (com_addr == -1) ? comports[minor(dev)] : com_addr;
 
        while ((inb(port + com_lsr) & LSR_TXRDY) == 0)
-               ;
+               continue;
 
        outb(port + com_data, c);
 }
Index: sys/arch/i386/stand/libsa/biosdev.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/i386/stand/libsa/biosdev.c,v
retrieving revision 1.92
diff -u -p -u -r1.92 biosdev.c
--- sys/arch/i386/stand/libsa/biosdev.c 1 Oct 2015 20:28:12 -0000       1.92
+++ sys/arch/i386/stand/libsa/biosdev.c 7 Jun 2016 20:40:16 -0000
@@ -559,9 +559,9 @@ biosopen(struct open_file *f, ...)
                return 0;
        }
 #endif
- 
+
        for (maj = 0; maj < nbdevs &&
-           strncmp(dev, bdevs[maj], devlen); maj++);
+           strncmp(dev, bdevs[maj], devlen); maj++) continue;
        if (maj >= nbdevs) {
                printf("Unknown device: ");
                for (cp = *file; *cp != ':'; cp++)
@@ -672,7 +672,8 @@ biosdisk_err(u_int error)
        register const u_char *p = bidos_errs;
 
        while (*p && *p != error)
-               while (*p++);
+               while (*p++)
+                       continue;
 
        return ++p;
 }
@@ -704,7 +705,8 @@ biosdisk_errno(u_int error)
        if (error == 0)
                return 0;
 
-       for (p = tab; p->error && p->error != error; p++);
+       for (p = tab; p->error && p->error != error; p++)
+               continue;
 
        return p->errno;
 }
Index: sys/arch/i386/stand/libsa/diskprobe.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/i386/stand/libsa/diskprobe.c,v
retrieving revision 1.40
diff -u -p -u -r1.40 diskprobe.c
--- sys/arch/i386/stand/libsa/diskprobe.c       2 Sep 2015 04:09:24 -0000       
1.40
+++ sys/arch/i386/stand/libsa/diskprobe.c       7 Jun 2016 20:40:16 -0000
@@ -266,7 +266,7 @@ diskprobe(void)
 
        /* Checksumming of hard disks */
        for (i = 0; disksum(i++) && i < MAX_CKSUMLEN; )
-               ;
+               continue;
        bios_cksumlen = i;
 
        /* Get space for passing bios_diskinfo stuff to kernel */
Index: sys/arch/i386/stand/libsa/gateA20.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/i386/stand/libsa/gateA20.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 gateA20.c
--- sys/arch/i386/stand/libsa/gateA20.c 19 Mar 2004 13:48:18 -0000      1.10
+++ sys/arch/i386/stand/libsa/gateA20.c 7 Jun 2016 20:40:16 -0000
@@ -72,19 +72,19 @@ gateA20(int on)
                }
        } else {
 
-               while (inb(IO_KBD + KBSTATP) & KBS_IBF);
+               while (inb(IO_KBD + KBSTATP) & KBS_IBF) continue;
 
                while (inb(IO_KBD + KBSTATP) & KBS_DIB)
                        (void)inb(IO_KBD + KBDATAP);
 
                outb(IO_KBD + KBCMDP, KBC_CMDWOUT);
-               while (inb(IO_KBD + KBSTATP) & KBS_IBF);
+               while (inb(IO_KBD + KBSTATP) & KBS_IBF) continue;
 
                if (on)
                        outb(IO_KBD + KBDATAP, KB_A20);
                else
                        outb(IO_KBD + KBDATAP, 0xcd);
-               while (inb(IO_KBD + KBSTATP) & KBS_IBF);
+               while (inb(IO_KBD + KBSTATP) & KBS_IBF) continue;
 
                while (inb(IO_KBD + KBSTATP) & KBS_DIB)
                        (void)inb(IO_KBD + KBDATAP);
Index: sys/arch/i386/stand/libsa/memprobe.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/i386/stand/libsa/memprobe.c,v
retrieving revision 1.56
diff -u -p -u -r1.56 memprobe.c
--- sys/arch/i386/stand/libsa/memprobe.c        8 Oct 2015 14:46:05 -0000       
1.56
+++ sys/arch/i386/stand/libsa/memprobe.c        7 Jun 2016 20:40:16 -0000
@@ -434,7 +434,7 @@ mem_pass(void)
        bios_memmap_t *p;
 
        for (p = bios_memmap; p->type != BIOS_MAP_END; p++)
-               ;
+               continue;
        addbootarg(BOOTARG_MEMMAP, (p - bios_memmap + 1) * sizeof *bios_memmap,
            bios_memmap);
 }
Index: sys/arch/i386/stand/libsa/time.c
===================================================================
RCS file: /home/OpenBSD/cvs/src/sys/arch/i386/stand/libsa/time.c,v
retrieving revision 1.19
diff -u -p -u -r1.19 time.c
--- sys/arch/i386/stand/libsa/time.c    23 Sep 2014 17:59:25 -0000      1.19
+++ sys/arch/i386/stand/libsa/time.c    7 Jun 2016 20:40:16 -0000
@@ -14,8 +14,8 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
@@ -142,7 +142,7 @@ sleep(u_int i)
         * so that it may handle interrupts.
         */
        for (t = getsecs() + i; getsecs() < t; cnischar())
-               ;
+               continue;
 
        return 0;
 }

Reply via email to