Staging: echo cleanup
PATCH 1/1 Staging: echo cleanup
before:
errors lines of code errors/KLOCdrivers/staging/echo/ 213 1701 125.2
after:
errors lines of code errors/KLOCdrivers/staging/echo/ 8 1685 4.7
Compile tested.
Signed-off-by Alexander Beregalov <[email protected]>
---
drivers/staging/echo/bit_operations.h | 30 ++-- drivers/staging/echo/echo.c | 42 ++-- drivers/staging/echo/echo.h | 2 - drivers/staging/echo/fir.h | 28 +-- drivers/staging/echo/mmx.h | 408 ++++++++++++++++---------------- 5 files changed, 247 insertions(+), 263 deletions(-)
drivers/staging/echo/bit_operations.h +14 -16
@@ -21,8 +21,6 @@* You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* -* $Id: bit_operations.h,v 1.11 2006/11/28 15:37:03 steveu Exp $ */ /*! \file */
@@ -34,7 +32,7 @@/*! \brief Find the bit position of the highest set bit in a word \param bits The word to be searched \return The bit number of the highest set bit, or -1 if the word is zero. */ -static __inline__int top_bit (unsigned int bits) +static inline int top_bit (unsigned int bits) {int res;
@@ -50,7 +48,7 @@ static __inline__ int top_bit(unsigned int bits)/*! \brief Find the bit position of the lowest set bit in a word \param bits The word to be searched \return The bit number of the lowest set bit, or -1 if the word is zero. */ -static __inline__int bottom_bit (unsigned int bits) +static inline int bottom_bit (unsigned int bits) {int res;
@@ -63,7 +61,7 @@ static __inline__ int bottom_bit(unsigned int bits) return res; }#else -static __inline__int top_bit (unsigned int bits) +static inline int top_bit (unsigned int bits) {int i;
@@ -93,7 +91,7 @@ static __inline__ int top_bit(unsigned int bits)return i; } -static __inline__int bottom_bit (unsigned int bits) +static inline int bottom_bit (unsigned int bits) {int i;
@@ -127,7 +125,7 @@ static __inline__ int bottom_bit(unsigned int bits)/*! \brief Bit reverse a byte. \param data The byte to be reversed. \return The bit reversed version of data. */ -static __inline__uint8_t bit_reverse8 (uint8_t x) +static inline uint8_t bit_reverse8 (uint8_t x) {#if defined(__i386__) || defined(__x86_64__)/* If multiply is fast */
@@ -172,32 +170,32 @@ uint32_t make_mask32(uint32_t x);uint16_t make_mask16 (uint16_t x);/*! \brief Find the least significant one in a word, and return a word -with just that bit set. +with just that bit set. \param x The word to be searched. \return The word with the single set bit. */ -static __inline__uint32_t least_significant_one32 (uint32_t x) +static inline uint32_t least_significant_one32 (uint32_t x) { -return (x & (-(int32_t ) x)); +return x & (-(int32_t ) x); }/*! \brief Find the most significant one in a word, and return a word -with just that bit set. +with just that bit set. \param x The word to be searched. \return The word with the single set bit. */ -static __inline__uint32_t most_significant_one32 (uint32_t x) +static inline uint32_t most_significant_one32 (uint32_t x) {#if defined(__i386__) || defined(__x86_64__)return 1 <<top_bit (x);#else x =make_mask32 (x); -return (x ^ (x >>1 )); +return x ^ (x >>1 );#endif }/*! \brief Find the parity of a byte. \param x The byte to be checked. \return 1 for odd, or 0 for even. */ -static __inline__int parity8 (uint8_t x) +static inline int parity8 (uint8_t x) { x = (x ^ (x >>4 )) &0x0F ;return (0x6996 >> x) &1 ;
@@ -206,7 +204,7 @@ static __inline__ int parity8(uint8_t x)/*! \brief Find the parity of a 16 bit word. \param x The word to be checked. \return 1 for odd, or 0 for even. */ -static __inline__int parity16 (uint16_t x) +static inline int parity16 (uint16_t x) { x ^= (x >>8 ); x = (x ^ (x >>4 )) &0x0F ;
@@ -216,7 +214,7 @@ static __inline__ int parity16(uint16_t x)/*! \brief Find the parity of a 32 bit word. \param x The word to be checked. \return 1 for odd, or 0 for even. */ -static __inline__int parity32 (uint32_t x) +static inline int parity32 (uint32_t x) { x ^= (x >>16 ); x ^= (x >>8 );
drivers/staging/echo/echo.c +16 -26
155 lines not on this page · raw message
drivers/staging/echo/echo.h +0 -2
@@ -23,8 +23,6 @@* You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* -* $Id: echo.h,v 1.9 2006/10/24 13:45:28 steveu Exp $ */ #ifndef __ECHO_H
drivers/staging/echo/fir.h +13 -15
@@ -21,8 +21,6 @@* You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* -* $Id: fir.h,v 1.8 2006/10/24 13:45:28 steveu Exp $ */ /*! \page fir_page FIR filtering
@@ -102,8 +100,8 @@ struct fir_float_state_t {float *history; }; -static __inline__const int16_t *fir16_create (struct fir16_state_t *fir, -const int16_t * coeffs,int taps) +static inline const int16_t *fir16_create (struct fir16_state_t *fir, +const int16_t *coeffs,int taps) { fir->taps = taps; fir->curr_pos = taps -1 ;
@@ -116,7 +114,7 @@ static __inline__ const int16_t *fir16_create(struct fir16_state_t *fir,return fir->history; } -static __inline__void fir16_flush (struct fir16_state_t *fir) +static inline void fir16_flush (struct fir16_state_t *fir) {#if defined(USE_MMX ) || defined(USE_SSE2 ) || defined(__bfin__)memset (fir->history,0 ,2 * fir->taps *sizeof (int16_t ));
@@ -125,7 +123,7 @@ static __inline__ void fir16_flush(struct fir16_state_t *fir)#endif } -static __inline__void fir16_free (struct fir16_state_t *fir) +static inline void fir16_free (struct fir16_state_t *fir) {kfree (fir->history); }
@@ -148,16 +146,16 @@ static inline int32_t dot_asm(short *x, short *y, int len)"A0 += R0.L*R1.L (IS);\n\t" "R0 = A0;\n\t" "%0 = R0;\n\t" - :"=&d"(dot) - :"a"(x), "a"(y), "a"(len) - :"I0", "I1", "A1", "A0", "R0", "R1" + : "=&d"(dot) + : "a"(x), "a"(y), "a"(len) + : "I0", "I1", "A1", "A0", "R0", "R1" ); return dot; }#endif -static __inline__int16_t fir16 (struct fir16_state_t *fir,int16_t sample) +static inline int16_t fir16 (struct fir16_state_t *fir,int16_t sample) {int32_t y;#if defined(USE_MMX )
@@ -250,8 +248,8 @@ static __inline__ int16_t fir16(struct fir16_state_t *fir, int16_t sample)return (int16_t ) (y >>15 ); } -static __inline__const int16_t *fir32_create (struct fir32_state_t *fir, -const int32_t * coeffs,int taps) +static inline const int16_t *fir32_create (struct fir32_state_t *fir, +const int32_t *coeffs,int taps) { fir->taps = taps; fir->curr_pos = taps -1 ;
@@ -260,17 +258,17 @@ static __inline__ const int16_t *fir32_create(struct fir32_state_t *fir,return fir->history; } -static __inline__void fir32_flush (struct fir32_state_t *fir) +static inline void fir32_flush (struct fir32_state_t *fir) {memset (fir->history,0 , fir->taps *sizeof (int16_t )); } -static __inline__void fir32_free (struct fir32_state_t *fir) +static inline void fir32_free (struct fir32_state_t *fir) {kfree (fir->history); } -static __inline__int16_t fir32 (struct fir32_state_t *fir,int16_t sample) +static inline int16_t fir32 (struct fir32_state_t *fir,int16_t sample) {int i;int32_t y;
drivers/staging/echo/mmx.h +204 -204
442 lines not on this page · raw message