svn commit: r228471 - in head/sys: boot/arm/at91/libat91 dev/cm dev/de dev/fdc dev/pccard dev/spibus dev/xen/netback pc98/cbus

2011-12-13 Thread Ed Schouten
Author: ed
Date: Tue Dec 13 14:06:01 2011
New Revision: 228471
URL: http://svn.freebsd.org/changeset/base/228471

Log:
  Replace `inline static' by `static inline'.
  
  If I interpret the C standard correctly, the storage specifier should be
  placed before the inline keyword. While at it, replace __inline by
  inline in the files affected.

Modified:
  head/sys/boot/arm/at91/libat91/sd-card.c
  head/sys/dev/cm/smc90cx6.c
  head/sys/dev/de/if_de.c
  head/sys/dev/fdc/fdc.c
  head/sys/dev/pccard/pccardvar.h
  head/sys/dev/spibus/spibusvar.h
  head/sys/dev/xen/netback/netback.c
  head/sys/pc98/cbus/scterm-sck.c
  head/sys/pc98/cbus/scvtb.c

Modified: head/sys/boot/arm/at91/libat91/sd-card.c
==
--- head/sys/boot/arm/at91/libat91/sd-card.cTue Dec 13 14:00:27 2011
(r228470)
+++ head/sys/boot/arm/at91/libat91/sd-card.cTue Dec 13 14:06:01 2011
(r228471)
@@ -94,14 +94,14 @@ MCIDeviceWaitReady(unsigned int timeout)
}   // End of if AT91C_MCI_RXBUFF
 }
 
-inline static unsigned int
+static inline unsigned int
 swap(unsigned int a)
 {
 return (((a  0xff)  24) | ((a  0xff00)  8) | ((a  0xff)  8)
   | ((a  0xff00)  24));
 }
 
-inline static void
+static inline void
 wait_ready()
 {
int status;

Modified: head/sys/dev/cm/smc90cx6.c
==
--- head/sys/dev/cm/smc90cx6.c  Tue Dec 13 14:00:27 2011(r228470)
+++ head/sys/dev/cm/smc90cx6.c  Tue Dec 13 14:06:01 2011(r228471)
@@ -596,7 +596,7 @@ cleanup:
}
 }
 
-__inline static void
+static inline void
 cm_tint_locked(sc, isr)
struct cm_softc *sc;
int isr;

Modified: head/sys/dev/de/if_de.c
==
--- head/sys/dev/de/if_de.c Tue Dec 13 14:00:27 2011(r228470)
+++ head/sys/dev/de/if_de.c Tue Dec 13 14:06:01 2011(r228471)
@@ -1567,7 +1567,7 @@ tulip_null_media_poll(tulip_softc_t * co
 #endif
 }
 
-__inline static void
+static inline void
 tulip_21140_mediainit(tulip_softc_t * const sc, tulip_media_info_t * const mip,
 tulip_media_t const media, unsigned gpdata, unsigned cmdmode)
 {

Modified: head/sys/dev/fdc/fdc.c
==
--- head/sys/dev/fdc/fdc.c  Tue Dec 13 14:00:27 2011(r228470)
+++ head/sys/dev/fdc/fdc.c  Tue Dec 13 14:06:01 2011(r228471)
@@ -314,14 +314,14 @@ fdsettype(struct fd_data *fd, struct fd_
 /*
  * Bus space handling (access to low-level IO).
  */
-__inline static void
+static inline void
 fdregwr(struct fdc_data *fdc, int reg, uint8_t v)
 {
 
bus_space_write_1(fdc-iot, fdc-ioh[reg], fdc-ioff[reg], v);
 }
 
-__inline static uint8_t
+static inline uint8_t
 fdregrd(struct fdc_data *fdc, int reg)
 {
 

Modified: head/sys/dev/pccard/pccardvar.h
==
--- head/sys/dev/pccard/pccardvar.h Tue Dec 13 14:00:27 2011
(r228470)
+++ head/sys/dev/pccard/pccardvar.h Tue Dec 13 14:06:01 2011
(r228471)
@@ -106,7 +106,7 @@ typedef int (*pccard_product_match_fn) (
  * make this inline so that we don't have to worry about dangling references
  * to it in the modules or the code.
  */
-static __inline const struct pccard_product *
+static inline const struct pccard_product *
 pccard_product_lookup(device_t dev, const struct pccard_product *tab,
 size_t ent_size, pccard_product_match_fn matchfn)
 {
@@ -150,31 +150,31 @@ pccard_product_lookup(device_t dev, cons
 
 /* Convenience functions */
 
-static __inline int
+static inline int
 pccard_cis_scan(device_t dev, pccard_scan_t fct, void *arg)
 {
return (CARD_CIS_SCAN(device_get_parent(dev), dev, fct, arg));
 }
 
-static __inline int
+static inline int
 pccard_attr_read_1(device_t dev, uint32_t offset, uint8_t *val)
 {
return (CARD_ATTR_READ(device_get_parent(dev), dev, offset, val));
 }
 
-static __inline int
+static inline int
 pccard_attr_write_1(device_t dev, uint32_t offset, uint8_t val)
 {
return (CARD_ATTR_WRITE(device_get_parent(dev), dev, offset, val));
 }
 
-static __inline int
+static inline int
 pccard_ccr_read_1(device_t dev, uint32_t offset, uint8_t *val)
 {
return (CARD_CCR_READ(device_get_parent(dev), dev, offset, val));
 }
 
-static __inline int
+static inline int
 pccard_ccr_write_1(device_t dev, uint32_t offset, uint8_t val)
 {
return (CARD_CCR_WRITE(device_get_parent(dev), dev, offset, val));
@@ -199,7 +199,7 @@ enum {
 };
 
 #define PCCARD_ACCESSOR(A, B, T)   \
-__inline static int\
+static inline int  \
 pccard_get_ ## A(device_t dev, T *t)   \
 { 

Re: svn commit: r228471 - in head/sys: boot/arm/at91/libat91 dev/cm dev/de dev/fdc dev/pccard dev/spibus dev/xen/netback pc98/cbus

2011-12-13 Thread Bruce Evans

On Tue, 13 Dec 2011, Stefan Farfeleder wrote:


Log:
  Replace `inline static' by `static inline'.

  If I interpret the C standard correctly, the storage specifier should be
  placed before the inline keyword. While at it, replace __inline by
  inline in the files affected.


No, declaration-specifier is defined recursively - any order is allowed.
Still I think having a consistent order is a good idea.


And using inline instead of __inline breaks C90 compilers.  Unline const
and signed, inline is new in C99, and there are still usable C90 compilers
(e.g., c89, gcc -std=c89 and old(?) versions of TenDRA) which will break
if it is spelled inline.  C90 compilers should also break if it is spelled
__inline, but it is easier to annul if is spelled __inline, and
sys/cdefs.h already supports this.

c89 and gcc -std=c89 apparently are not C compilers (even with -pedantic),
since they accept __inline.  They don't accept inline.

The support in sys/cdefs.h for annuling __inline works automatically
for TenDRA-4.20040902 -Ysystem (-Ysystem makes it use the system
headers).  When __inline is attached to static, annuling it doesn't
change the semantics.  Annuling it is not so safe for extern inline,
but might work for at least individual source files.  I mainly use
TenDRA for its portability checks and better diagnostics of standards
violations.  Support for C90 in headers and no C99 code in the files
being checked is enough for this.

Bruce
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org