Commit c82895b8 authored by J.R. Mauro's avatar J.R. Mauro Committed by Greg Kroah-Hartman

Staging: echo: remove typedefs

Remove typedefs in drivers/staging/echo

Signed-off by: J.R. Mauro <jrm8005@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent e9133972
TODO: TODO:
- checkpatch.pl cleanups - checkpatch.pl cleanups
- Lindent - Lindent
- typedef removals
- handle bit_operations.h (merge in or make part of common code?) - handle bit_operations.h (merge in or make part of common code?)
- remove proc interface, only use echo.h interface (proc interface is - remove proc interface, only use echo.h interface (proc interface is
racy and not correct.) racy and not correct.)
......
...@@ -149,8 +149,8 @@ struct oslec_state { ...@@ -149,8 +149,8 @@ struct oslec_state {
int Lbgn, Lbgn_acc, Lbgn_upper, Lbgn_upper_acc; int Lbgn, Lbgn_acc, Lbgn_upper, Lbgn_upper_acc;
/* foreground and background filter states */ /* foreground and background filter states */
fir16_state_t fir_state; struct fir16_state_t fir_state;
fir16_state_t fir_state_bg; struct fir16_state_t fir_state_bg;
int16_t *fir_taps16[2]; int16_t *fir_taps16[2];
/* DC blocking filter states */ /* DC blocking filter states */
......
...@@ -72,37 +72,37 @@ ...@@ -72,37 +72,37 @@
16 bit integer FIR descriptor. This defines the working state for a single 16 bit integer FIR descriptor. This defines the working state for a single
instance of an FIR filter using 16 bit integer coefficients. instance of an FIR filter using 16 bit integer coefficients.
*/ */
typedef struct { struct fir16_state_t {
int taps; int taps;
int curr_pos; int curr_pos;
const int16_t *coeffs; const int16_t *coeffs;
int16_t *history; int16_t *history;
} fir16_state_t; };
/*! /*!
32 bit integer FIR descriptor. This defines the working state for a single 32 bit integer FIR descriptor. This defines the working state for a single
instance of an FIR filter using 32 bit integer coefficients, and filtering instance of an FIR filter using 32 bit integer coefficients, and filtering
16 bit integer data. 16 bit integer data.
*/ */
typedef struct { struct fir32_state_t {
int taps; int taps;
int curr_pos; int curr_pos;
const int32_t *coeffs; const int32_t *coeffs;
int16_t *history; int16_t *history;
} fir32_state_t; };
/*! /*!
Floating point FIR descriptor. This defines the working state for a single Floating point FIR descriptor. This defines the working state for a single
instance of an FIR filter using floating point coefficients and data. instance of an FIR filter using floating point coefficients and data.
*/ */
typedef struct { struct fir_float_state_t {
int taps; int taps;
int curr_pos; int curr_pos;
const float *coeffs; const float *coeffs;
float *history; float *history;
} fir_float_state_t; };
static __inline__ const int16_t *fir16_create(fir16_state_t * fir, static __inline__ const int16_t *fir16_create(struct fir16_state_t * fir,
const int16_t * coeffs, int taps) const int16_t * coeffs, int taps)
{ {
fir->taps = taps; fir->taps = taps;
...@@ -116,7 +116,7 @@ static __inline__ const int16_t *fir16_create(fir16_state_t * fir, ...@@ -116,7 +116,7 @@ static __inline__ const int16_t *fir16_create(fir16_state_t * fir,
return fir->history; return fir->history;
} }
static __inline__ void fir16_flush(fir16_state_t * fir) static __inline__ void fir16_flush(struct fir16_state_t * fir)
{ {
#if defined(USE_MMX) || defined(USE_SSE2) || defined(__bfin__) #if defined(USE_MMX) || defined(USE_SSE2) || defined(__bfin__)
memset(fir->history, 0, 2 * fir->taps * sizeof(int16_t)); memset(fir->history, 0, 2 * fir->taps * sizeof(int16_t));
...@@ -125,7 +125,7 @@ static __inline__ void fir16_flush(fir16_state_t * fir) ...@@ -125,7 +125,7 @@ static __inline__ void fir16_flush(fir16_state_t * fir)
#endif #endif
} }
static __inline__ void fir16_free(fir16_state_t * fir) static __inline__ void fir16_free(struct fir16_state_t * fir)
{ {
kfree(fir->history); kfree(fir->history);
} }
...@@ -157,19 +157,19 @@ static inline int32_t dot_asm(short *x, short *y, int len) ...@@ -157,19 +157,19 @@ static inline int32_t dot_asm(short *x, short *y, int len)
} }
#endif #endif
static __inline__ int16_t fir16(fir16_state_t * fir, int16_t sample) static __inline__ int16_t fir16(struct fir16_state_t * fir, int16_t sample)
{ {
int32_t y; int32_t y;
#if defined(USE_MMX) #if defined(USE_MMX)
int i; int i;
mmx_t *mmx_coeffs; union mmx_t *mmx_coeffs;
mmx_t *mmx_hist; union mmx_t *mmx_hist;
fir->history[fir->curr_pos] = sample; fir->history[fir->curr_pos] = sample;
fir->history[fir->curr_pos + fir->taps] = sample; fir->history[fir->curr_pos + fir->taps] = sample;
mmx_coeffs = (mmx_t *) fir->coeffs; mmx_coeffs = (union mmx_t *) fir->coeffs;
mmx_hist = (mmx_t *) & fir->history[fir->curr_pos]; mmx_hist = (union mmx_t *) & fir->history[fir->curr_pos];
i = fir->taps; i = fir->taps;
pxor_r2r(mm4, mm4); pxor_r2r(mm4, mm4);
/* 8 samples per iteration, so the filter must be a multiple of 8 long. */ /* 8 samples per iteration, so the filter must be a multiple of 8 long. */
...@@ -193,14 +193,14 @@ static __inline__ int16_t fir16(fir16_state_t * fir, int16_t sample) ...@@ -193,14 +193,14 @@ static __inline__ int16_t fir16(fir16_state_t * fir, int16_t sample)
emms(); emms();
#elif defined(USE_SSE2) #elif defined(USE_SSE2)
int i; int i;
xmm_t *xmm_coeffs; union xmm_t *xmm_coeffs;
xmm_t *xmm_hist; union xmm_t *xmm_hist;
fir->history[fir->curr_pos] = sample; fir->history[fir->curr_pos] = sample;
fir->history[fir->curr_pos + fir->taps] = sample; fir->history[fir->curr_pos + fir->taps] = sample;
xmm_coeffs = (xmm_t *) fir->coeffs; xmm_coeffs = (union xmm_t *) fir->coeffs;
xmm_hist = (xmm_t *) & fir->history[fir->curr_pos]; xmm_hist = (union xmm_t *) & fir->history[fir->curr_pos];
i = fir->taps; i = fir->taps;
pxor_r2r(xmm4, xmm4); pxor_r2r(xmm4, xmm4);
/* 16 samples per iteration, so the filter must be a multiple of 16 long. */ /* 16 samples per iteration, so the filter must be a multiple of 16 long. */
...@@ -250,7 +250,7 @@ static __inline__ int16_t fir16(fir16_state_t * fir, int16_t sample) ...@@ -250,7 +250,7 @@ static __inline__ int16_t fir16(fir16_state_t * fir, int16_t sample)
return (int16_t) (y >> 15); return (int16_t) (y >> 15);
} }
static __inline__ const int16_t *fir32_create(fir32_state_t * fir, static __inline__ const int16_t *fir32_create(struct fir32_state_t * fir,
const int32_t * coeffs, int taps) const int32_t * coeffs, int taps)
{ {
fir->taps = taps; fir->taps = taps;
...@@ -260,17 +260,17 @@ static __inline__ const int16_t *fir32_create(fir32_state_t * fir, ...@@ -260,17 +260,17 @@ static __inline__ const int16_t *fir32_create(fir32_state_t * fir,
return fir->history; return fir->history;
} }
static __inline__ void fir32_flush(fir32_state_t * fir) static __inline__ void fir32_flush(struct fir32_state_t * fir)
{ {
memset(fir->history, 0, fir->taps * sizeof(int16_t)); memset(fir->history, 0, fir->taps * sizeof(int16_t));
} }
static __inline__ void fir32_free(fir32_state_t * fir) static __inline__ void fir32_free(struct fir32_state_t * fir)
{ {
kfree(fir->history); kfree(fir->history);
} }
static __inline__ int16_t fir32(fir32_state_t * fir, int16_t sample) static __inline__ int16_t fir32(struct fir32_state_t * fir, int16_t sample)
{ {
int i; int i;
int32_t y; int32_t y;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* values by ULL, lest they be truncated by the compiler) * values by ULL, lest they be truncated by the compiler)
*/ */
typedef union { union mmx_t {
long long q; /* Quadword (64-bit) value */ long long q; /* Quadword (64-bit) value */
unsigned long long uq; /* Unsigned Quadword */ unsigned long long uq; /* Unsigned Quadword */
int d[2]; /* 2 Doubleword (32-bit) values */ int d[2]; /* 2 Doubleword (32-bit) values */
...@@ -37,12 +37,12 @@ typedef union { ...@@ -37,12 +37,12 @@ typedef union {
char b[8]; /* 8 Byte (8-bit) values */ char b[8]; /* 8 Byte (8-bit) values */
unsigned char ub[8]; /* 8 Unsigned Byte */ unsigned char ub[8]; /* 8 Unsigned Byte */
float s[2]; /* Single-precision (32-bit) value */ float s[2]; /* Single-precision (32-bit) value */
} mmx_t; /* On an 8-byte (64-bit) boundary */ }; /* On an 8-byte (64-bit) boundary */
/* SSE registers */ /* SSE registers */
typedef union { union xmm_t {
char b[16]; char b[16];
} xmm_t; };
#define mmx_i2r(op,imm,reg) \ #define mmx_i2r(op,imm,reg) \
__asm__ __volatile__ (#op " %0, %%" #reg \ __asm__ __volatile__ (#op " %0, %%" #reg \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment