On Wed, Dec 04, 2013 at 05:04:13PM +0100, Mark Kettenis wrote: > > Date: Wed, 4 Dec 2013 12:53:20 +0100 > > From: Joerg Sonnenberger <jo...@britannica.bec.de> > > > > On Wed, Dec 04, 2013 at 12:24:50PM +0100, Mark Kettenis wrote: > > > Sorry, but I disagree with LLVM here. It shouldn't complain about > > > static inline functions. > > > > Then mark them as unused, just like you would with a static variable you > > insist on keeping. > > Thanks Joerg, that might work. > > Brad, does LLVM like the diff below? Note this changes ohci.c not > uhci.c since I happened to have some uncommtted changes in the latter > that I didn't want to touch. > > > Index: ohci.c > =================================================================== > RCS file: /cvs/src/sys/dev/usb/ohci.c,v > retrieving revision 1.116 > diff -u -p -r1.116 ohci.c > --- ohci.c 9 Nov 2013 08:46:05 -0000 1.116 > +++ ohci.c 4 Dec 2013 16:01:42 -0000 > @@ -189,21 +189,21 @@ void ohci_dump_itds(struct ohci_soft_it > #define OWRITE4(sc, r, x) \ > do { OBARR(sc); bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)); } while > (0) > > -static __inline u_int8_t > +__unused static __inline u_int8_t > OREAD1(struct ohci_softc *sc, bus_size_t r) > { > OBARR(sc); > return bus_space_read_1(sc->iot, sc->ioh, r); > } > > -static __inline u_int16_t > +__unused static __inline u_int16_t > OREAD2(struct ohci_softc *sc, bus_size_t r) > { > OBARR(sc); > return bus_space_read_2(sc->iot, sc->ioh, r); > } > > -static __inline u_int32_t > +__unused static __inline u_int32_t > OREAD4(struct ohci_softc *sc, bus_size_t r) > { > OBARR(sc);
Yes, this does indeed silence the warning. So you want something like the following? Index: ohci.c =================================================================== RCS file: /home/cvs/src/sys/dev/usb/ohci.c,v retrieving revision 1.116 diff -u -p -r1.116 ohci.c --- ohci.c 9 Nov 2013 08:46:05 -0000 1.116 +++ ohci.c 5 Dec 2013 20:41:53 -0000 @@ -189,21 +189,21 @@ void ohci_dump_itds(struct ohci_soft_it #define OWRITE4(sc, r, x) \ do { OBARR(sc); bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)); } while (0) -static __inline u_int8_t +__unused static __inline u_int8_t OREAD1(struct ohci_softc *sc, bus_size_t r) { OBARR(sc); return bus_space_read_1(sc->iot, sc->ioh, r); } -static __inline u_int16_t +__unused static __inline u_int16_t OREAD2(struct ohci_softc *sc, bus_size_t r) { OBARR(sc); return bus_space_read_2(sc->iot, sc->ioh, r); } -static __inline u_int32_t +__unused static __inline u_int32_t OREAD4(struct ohci_softc *sc, bus_size_t r) { OBARR(sc); Index: uhci.c =================================================================== RCS file: /home/cvs/src/sys/dev/usb/uhci.c,v retrieving revision 1.104 diff -u -p -r1.104 uhci.c --- uhci.c 9 Nov 2013 08:46:05 -0000 1.104 +++ uhci.c 5 Dec 2013 20:42:24 -0000 @@ -238,21 +238,21 @@ void uhci_dump(void); do { UBARR(sc); bus_space_write_4((sc)->iot, (sc)->ioh, (r), (x)); \ } while (/*CONSTCOND*/0) -static __inline u_int8_t +__unused static __inline u_int8_t UREAD1(struct uhci_softc *sc, bus_size_t r) { UBARR(sc); return bus_space_read_1(sc->iot, sc->ioh, r); } -static __inline u_int16_t +__unused static __inline u_int16_t UREAD2(struct uhci_softc *sc, bus_size_t r) { UBARR(sc); return bus_space_read_2(sc->iot, sc->ioh, r); } -static __inline u_int32_t +__unused static __inline u_int32_t UREAD4(struct uhci_softc *sc, bus_size_t r) { UBARR(sc); -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.