From b8f8cf02358f39231419ade073daebe2ba83f4b7 Mon Sep 17 00:00:00 2001 From: lukem Date: Mon, 30 Apr 2001 01:17:30 +0000 Subject: [PATCH] remove some lint, including ansifying some inlines --- sys/arch/i386/include/bus.h | 124 +++++++++++++---------------------- sys/arch/i386/include/intr.h | 8 +-- sys/arch/i386/include/lock.h | 4 +- sys/arch/i386/include/pio.h | 17 +++-- 4 files changed, 60 insertions(+), 93 deletions(-) diff --git a/sys/arch/i386/include/bus.h b/sys/arch/i386/include/bus.h index 7e06c507001b..f639ef129f38 100644 --- a/sys/arch/i386/include/bus.h +++ b/sys/arch/i386/include/bus.h @@ -1,4 +1,4 @@ -/* $NetBSD: bus.h,v 1.33 2001/04/25 03:31:23 thorpej Exp $ */ +/* $NetBSD: bus.h,v 1.34 2001/04/30 01:17:30 lukem Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -217,7 +217,7 @@ void i386_memio_free __P((bus_space_tag_t t, bus_space_handle_t bsh, */ #define bus_space_read_1(t, h, o) \ - ((t) == I386_BUS_SPACE_IO ? (inb((h) + (o))) : \ + ((t) == I386_BUS_SPACE_IO ? (inb((h) + (o))) :\ (*(volatile u_int8_t *)((h) + (o)))) #define bus_space_read_2(t, h, o) \ @@ -267,7 +267,7 @@ do { \ "0" ((a)), "1" ((c)), "2" ((h) + (o)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_read_multi_2(t, h, o, a, c) \ do { \ @@ -289,7 +289,7 @@ do { \ "0" ((a)), "1" ((c)), "2" ((h) + (o)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_read_multi_4(t, h, o, a, c) \ do { \ @@ -311,7 +311,7 @@ do { \ "0" ((a)), "1" ((c)), "2" ((h) + (o)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_read_multi_stream_1 bus_space_read_multi_1 #define bus_space_read_multi_stream_2 bus_space_read_multi_2 @@ -362,7 +362,7 @@ do { \ "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_read_region_2(t, h, o, a, c) \ do { \ @@ -395,7 +395,7 @@ do { \ "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_read_region_4(t, h, o, a, c) \ do { \ @@ -428,7 +428,7 @@ do { \ "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_read_region_stream_1 bus_space_read_region_1 #define bus_space_read_region_stream_2 bus_space_read_region_2 @@ -455,7 +455,7 @@ do { \ outb((h) + (o), (v)); \ else \ ((void)(*(volatile u_int8_t *)((h) + (o)) = (v))); \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_2(t, h, o, v) \ do { \ @@ -464,7 +464,7 @@ do { \ outw((h) + (o), (v)); \ else \ ((void)(*(volatile u_int16_t *)((h) + (o)) = (v))); \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_4(t, h, o, v) \ do { \ @@ -473,7 +473,7 @@ do { \ outl((h) + (o), (v)); \ else \ ((void)(*(volatile u_int32_t *)((h) + (o)) = (v))); \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_stream_1 bus_space_write_1 #define bus_space_write_stream_2 bus_space_write_2 @@ -511,7 +511,7 @@ do { \ "=S" (dummy1), "=c" (dummy2), "=r" (dummy3), "=&a" (__x) : \ "0" ((a)), "1" ((c)), "2" ((h) + (o))); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_multi_2(t, h, o, a, c) \ do { \ @@ -532,7 +532,7 @@ do { \ "=S" (dummy1), "=c" (dummy2), "=r" (dummy3), "=&a" (__x) : \ "0" ((a)), "1" ((c)), "2" ((h) + (o))); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_multi_4(t, h, o, a, c) \ do { \ @@ -553,7 +553,7 @@ do { \ "=S" (dummy1), "=c" (dummy2), "=r" (dummy3), "=&a" (__x) : \ "0" ((a)), "1" ((c)), "2" ((h) + (o))); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_multi_stream_1 bus_space_write_multi_1 #define bus_space_write_multi_stream_2 bus_space_write_multi_2 @@ -604,7 +604,7 @@ do { \ "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_region_2(t, h, o, a, c) \ do { \ @@ -637,7 +637,7 @@ do { \ "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_region_4(t, h, o, a, c) \ do { \ @@ -670,7 +670,7 @@ do { \ "0" ((h) + (o)), "1" ((a)), "2" ((c)) : \ "memory"); \ } \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_write_region_stream_1 bus_space_write_region_1 #define bus_space_write_region_stream_2 bus_space_write_region_2 @@ -706,21 +706,17 @@ static __inline void i386_memio_set_multi_4 __P((bus_space_tag_t, do { \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int16_t, "bus addr"); \ i386_memio_set_multi_2((t), (h), (o), (v), (c)); \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_set_multi_4(t, h, o, v, c) \ do { \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int32_t, "bus addr"); \ i386_memio_set_multi_4((t), (h), (o), (v), (c)); \ -} while (0) +} while (/* CONSTCOND */ 0) static __inline void -i386_memio_set_multi_1(t, h, o, v, c) - bus_space_tag_t t; - bus_space_handle_t h; - bus_size_t o; - u_int8_t v; - size_t c; +i386_memio_set_multi_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, + u_int8_t v, size_t c) { bus_addr_t addr = h + o; @@ -733,12 +729,8 @@ i386_memio_set_multi_1(t, h, o, v, c) } static __inline void -i386_memio_set_multi_2(t, h, o, v, c) - bus_space_tag_t t; - bus_space_handle_t h; - bus_size_t o; - u_int16_t v; - size_t c; +i386_memio_set_multi_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, + u_int16_t v, size_t c) { bus_addr_t addr = h + o; @@ -751,12 +743,8 @@ i386_memio_set_multi_2(t, h, o, v, c) } static __inline void -i386_memio_set_multi_4(t, h, o, v, c) - bus_space_tag_t t; - bus_space_handle_t h; - bus_size_t o; - u_int32_t v; - size_t c; +i386_memio_set_multi_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, + u_int32_t v, size_t c) { bus_addr_t addr = h + o; @@ -795,21 +783,17 @@ static __inline void i386_memio_set_region_4 __P((bus_space_tag_t, do { \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int16_t, "bus addr"); \ i386_memio_set_region_2((t), (h), (o), (v), (c)); \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_set_region_4(t, h, o, v, c) \ do { \ __BUS_SPACE_ADDRESS_SANITY((h) + (o), u_int32_t, "bus addr"); \ i386_memio_set_region_4((t), (h), (o), (v), (c)); \ -} while (0) +} while (/* CONSTCOND */ 0) static __inline void -i386_memio_set_region_1(t, h, o, v, c) - bus_space_tag_t t; - bus_space_handle_t h; - bus_size_t o; - u_int8_t v; - size_t c; +i386_memio_set_region_1(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, + u_int8_t v, size_t c) { bus_addr_t addr = h + o; @@ -822,12 +806,8 @@ i386_memio_set_region_1(t, h, o, v, c) } static __inline void -i386_memio_set_region_2(t, h, o, v, c) - bus_space_tag_t t; - bus_space_handle_t h; - bus_size_t o; - u_int16_t v; - size_t c; +i386_memio_set_region_2(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, + u_int16_t v, size_t c) { bus_addr_t addr = h + o; @@ -840,12 +820,8 @@ i386_memio_set_region_2(t, h, o, v, c) } static __inline void -i386_memio_set_region_4(t, h, o, v, c) - bus_space_tag_t t; - bus_space_handle_t h; - bus_size_t o; - u_int32_t v; - size_t c; +i386_memio_set_region_4(bus_space_tag_t t, bus_space_handle_t h, bus_size_t o, + u_int32_t v, size_t c) { bus_addr_t addr = h + o; @@ -889,23 +865,19 @@ do { \ __BUS_SPACE_ADDRESS_SANITY((h1) + (o1), u_int16_t, "bus addr 1"); \ __BUS_SPACE_ADDRESS_SANITY((h2) + (o2), u_int16_t, "bus addr 2"); \ i386_memio_copy_region_2((t), (h1), (o1), (h2), (o2), (c)); \ -} while (0) +} while (/* CONSTCOND */ 0) #define bus_space_copy_region_4(t, h1, o1, h2, o2, c) \ do { \ __BUS_SPACE_ADDRESS_SANITY((h1) + (o1), u_int32_t, "bus addr 1"); \ __BUS_SPACE_ADDRESS_SANITY((h2) + (o2), u_int32_t, "bus addr 2"); \ i386_memio_copy_region_4((t), (h1), (o1), (h2), (o2), (c)); \ -} while (0) +} while (/* CONSTCOND */ 0) static __inline void -i386_memio_copy_region_1(t, h1, o1, h2, o2, c) - bus_space_tag_t t; - bus_space_handle_t h1; - bus_size_t o1; - bus_space_handle_t h2; - bus_size_t o2; - size_t c; +i386_memio_copy_region_1(bus_space_tag_t t, + bus_space_handle_t h1, bus_size_t o1, + bus_space_handle_t h2, bus_size_t o2, size_t c) { bus_addr_t addr1 = h1 + o1; bus_addr_t addr2 = h2 + o2; @@ -938,13 +910,9 @@ i386_memio_copy_region_1(t, h1, o1, h2, o2, c) } static __inline void -i386_memio_copy_region_2(t, h1, o1, h2, o2, c) - bus_space_tag_t t; - bus_space_handle_t h1; - bus_size_t o1; - bus_space_handle_t h2; - bus_size_t o2; - size_t c; +i386_memio_copy_region_2(bus_space_tag_t t, + bus_space_handle_t h1, bus_size_t o1, + bus_space_handle_t h2, bus_size_t o2, size_t c) { bus_addr_t addr1 = h1 + o1; bus_addr_t addr2 = h2 + o2; @@ -977,13 +945,9 @@ i386_memio_copy_region_2(t, h1, o1, h2, o2, c) } static __inline void -i386_memio_copy_region_4(t, h1, o1, h2, o2, c) - bus_space_tag_t t; - bus_space_handle_t h1; - bus_size_t o1; - bus_space_handle_t h2; - bus_size_t o2; - size_t c; +i386_memio_copy_region_4(bus_space_tag_t t, + bus_space_handle_t h1, bus_size_t o1, + bus_space_handle_t h2, bus_size_t o2, size_t c) { bus_addr_t addr1 = h1 + o1; bus_addr_t addr2 = h2 + o2; diff --git a/sys/arch/i386/include/intr.h b/sys/arch/i386/include/intr.h index 8eb41ec47d93..ef4d06133ac6 100644 --- a/sys/arch/i386/include/intr.h +++ b/sys/arch/i386/include/intr.h @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.19 2001/04/14 06:49:32 thorpej Exp $ */ +/* $NetBSD: intr.h,v 1.20 2001/04/30 01:17:30 lukem Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -187,12 +187,12 @@ struct i386_soft_intr { #define i386_softintr_lock(si, s) \ do { \ (s) = splhigh(); \ -} while (/*CONSTCOND*/0) +} while (/*CONSTCOND*/ 0) #define i386_softintr_unlock(si, s) \ do { \ splx((s)); \ -} while (/*CONSTCOND*/0) +} while (/*CONSTCOND*/ 0) void *softintr_establish(int, void (*)(void *), void *); void softintr_disestablish(void *); @@ -212,7 +212,7 @@ do { \ softintr(__si->softintr_ssir); \ } \ i386_softintr_unlock(__si, __s); \ -} while (/*CONSTCOND*/0) +} while (/*CONSTCOND*/ 0) #endif /* _LOCORE */ #endif /* !_I386_INTR_H_ */ diff --git a/sys/arch/i386/include/lock.h b/sys/arch/i386/include/lock.h index eb0a64eac844..c414a079b163 100644 --- a/sys/arch/i386/include/lock.h +++ b/sys/arch/i386/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.4 2000/05/02 04:41:06 thorpej Exp $ */ +/* $NetBSD: lock.h,v 1.5 2001/04/30 01:17:31 lukem Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -88,7 +88,7 @@ __cpu_simple_lock_try(__cpu_simple_lock_t *alp) return ((__val == __SIMPLELOCK_UNLOCKED) ? 1 : 0); } -void +static __inline void __cpu_simple_unlock(__cpu_simple_lock_t *alp) { diff --git a/sys/arch/i386/include/pio.h b/sys/arch/i386/include/pio.h index 343a6b3b53c4..4e487eb16ba8 100644 --- a/sys/arch/i386/include/pio.h +++ b/sys/arch/i386/include/pio.h @@ -1,4 +1,4 @@ -/* $NetBSD: pio.h,v 1.16 2001/04/26 17:55:54 thorpej Exp $ */ +/* $NetBSD: pio.h,v 1.17 2001/04/30 01:17:31 lukem Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ #define inb(port) \ - (__use_immediate_port(port) ? __inbc(port) : __inb(port)) + (/* CONSTCOND */ __use_immediate_port(port) ? __inbc(port) : __inb(port)) static __inline u_int8_t __inbc(int port) @@ -91,7 +91,7 @@ insb(int port, void *addr, int cnt) } #define inw(port) \ - (__use_immediate_port(port) ? __inwc(port) : __inw(port)) + (/* CONSTCOND */ __use_immediate_port(port) ? __inwc(port) : __inw(port)) static __inline u_int16_t __inwc(int port) @@ -121,7 +121,7 @@ insw(int port, void *addr, int cnt) } #define inl(port) \ - (__use_immediate_port(port) ? __inlc(port) : __inl(port)) + (/* CONSTCOND */ __use_immediate_port(port) ? __inlc(port) : __inl(port)) static __inline u_int32_t __inlc(int port) @@ -151,7 +151,8 @@ insl(int port, void *addr, int cnt) } #define outb(port, data) \ - (__use_immediate_port(port) ? __outbc(port, data) : __outb(port, data)) + (/* CONSTCOND */ __use_immediate_port(port) ? __outbc(port, data) : \ + __outb(port, data)) static __inline void __outbc(int port, u_int8_t data) @@ -176,7 +177,8 @@ outsb(int port, const void *addr, int cnt) } #define outw(port, data) \ - (__use_immediate_port(port) ? __outwc(port, data) : __outw(port, data)) + (/* CONSTCOND */ __use_immediate_port(port) ? __outwc(port, data) : \ + __outw(port, data)) static __inline void __outwc(int port, u_int16_t data) @@ -201,7 +203,8 @@ outsw(int port, const void *addr, int cnt) } #define outl(port, data) \ - (__use_immediate_port(port) ? __outlc(port, data) : __outl(port, data)) + (/* CONSTCOND */ __use_immediate_port(port) ? __outlc(port, data) : \ + __outl(port, data)) static __inline void __outlc(int port, u_int32_t data)