Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: echo: coding style cleanups

Some remaining coding style cleanups to the header files
and the echo.c file.

Cc: David Rowe <david@rowetel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+67 -63
+5 -5
drivers/staging/echo/echo.c
··· 220 220 } 221 221 #endif 222 222 223 - static __inline__ int top_bit(unsigned int bits) 223 + static inline int top_bit(unsigned int bits) 224 224 { 225 225 if (bits == 0) 226 - return -1; 227 - else 228 - return (int)fls((int32_t)bits)-1; 226 + return -1; 227 + else 228 + return (int)fls((int32_t)bits)-1; 229 229 } 230 230 231 231 struct oslec_state *oslec_create(int len, int adaption_mode) ··· 466 466 467 467 factor = (2^30) * (2^-2) * clean_bg_rx/P 468 468 469 - (30 - 2 - log2(P)) 469 + (30 - 2 - log2(P)) 470 470 factor = clean_bg_rx 2 ----- (3) 471 471 472 472 To avoid a divide we approximate log2(P) as top_bit(P),
+10 -5
drivers/staging/echo/echo.h
··· 28 28 #ifndef __ECHO_H 29 29 #define __ECHO_H 30 30 31 - /*! \page echo_can_page Line echo cancellation for voice 31 + /* 32 + Line echo cancellation for voice 32 33 33 - \section echo_can_page_sec_1 What does it do? 34 + What does it do? 35 + 34 36 This module aims to provide G.168-2002 compliant echo cancellation, to remove 35 37 electrical echoes (e.g. from 2-4 wire hybrids) from voice calls. 36 38 37 - \section echo_can_page_sec_2 How does it work? 39 + 40 + How does it work? 41 + 38 42 The heart of the echo cancellor is FIR filter. This is adapted to match the 39 43 echo impulse response of the telephone line. It must be long enough to 40 44 adequately cover the duration of that impulse response. The signal transmitted ··· 112 108 needed which produces a fairly accurate result from a very short burst of far 113 109 end energy. 114 110 115 - \section echo_can_page_sec_3 How do I use it? 111 + How do I use it? 112 + 116 113 The echo cancellor processes both the transmit and receive streams sample by 117 114 sample. The processing function is not declared inline. Unfortunately, 118 115 cancellation requires many operations per sample, so the call overhead is only ··· 123 118 #include "fir.h" 124 119 #include "oslec.h" 125 120 126 - /*! 121 + /* 127 122 G.168 echo canceller descriptor. This defines the working state for a line 128 123 echo canceller. 129 124 */
+13 -22
drivers/staging/echo/fir.h
··· 23 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 24 */ 25 25 26 - /*! \page fir_page FIR filtering 27 - \section fir_page_sec_1 What does it do? 28 - ???. 29 - 30 - \section fir_page_sec_2 How does it work? 31 - ???. 32 - */ 33 - 34 26 #if !defined(_FIR_H_) 35 27 #define _FIR_H_ 36 28 ··· 54 62 can. 55 63 */ 56 64 57 - /*! 58 - 16 bit integer FIR descriptor. This defines the working state for a single 59 - instance of an FIR filter using 16 bit integer coefficients. 60 - */ 65 + /* 66 + * 16 bit integer FIR descriptor. This defines the working state for a single 67 + * instance of an FIR filter using 16 bit integer coefficients. 68 + */ 61 69 struct fir16_state_t { 62 70 int taps; 63 71 int curr_pos; ··· 65 73 int16_t *history; 66 74 }; 67 75 68 - /*! 69 - 32 bit integer FIR descriptor. This defines the working state for a single 70 - instance of an FIR filter using 32 bit integer coefficients, and filtering 71 - 16 bit integer data. 72 - */ 76 + /* 77 + * 32 bit integer FIR descriptor. This defines the working state for a single 78 + * instance of an FIR filter using 32 bit integer coefficients, and filtering 79 + * 16 bit integer data. 80 + */ 73 81 struct fir32_state_t { 74 82 int taps; 75 83 int curr_pos; ··· 77 85 int16_t *history; 78 86 }; 79 87 80 - /*! 81 - Floating point FIR descriptor. This defines the working state for a single 82 - instance of an FIR filter using floating point coefficients and data. 83 - */ 88 + /* 89 + * Floating point FIR descriptor. This defines the working state for a single 90 + * instance of an FIR filter using floating point coefficients and data. 91 + */ 84 92 struct fir_float_state_t { 85 93 int taps; 86 94 int curr_pos; ··· 214 222 } 215 223 216 224 #endif 217 - /*- End of file ------------------------------------------------------------*/
+39 -31
drivers/staging/echo/oslec.h
··· 27 27 #ifndef __OSLEC_H 28 28 #define __OSLEC_H 29 29 30 - /* TODO: document interface */ 31 - 32 30 /* Mask bits for the adaption mode */ 33 31 #define ECHO_CAN_USE_ADAPTION 0x01 34 32 #define ECHO_CAN_USE_NLP 0x02 ··· 36 38 #define ECHO_CAN_USE_RX_HPF 0x20 37 39 #define ECHO_CAN_DISABLE 0x40 38 40 39 - /*! 40 - G.168 echo canceller descriptor. This defines the working state for a line 41 - echo canceller. 42 - */ 41 + /** 42 + * oslec_state: G.168 echo canceller descriptor. 43 + * 44 + * This defines the working state for a line echo canceller. 45 + */ 43 46 struct oslec_state; 44 47 45 - /*! Create a voice echo canceller context. 46 - \param len The length of the canceller, in samples. 47 - \return The new canceller context, or NULL if the canceller could not be created. 48 - */ 48 + /** 49 + * oslec_create - Create a voice echo canceller context. 50 + * @len: The length of the canceller, in samples. 51 + * @return: The new canceller context, or NULL if the canceller could not be 52 + * created. 53 + */ 49 54 struct oslec_state *oslec_create(int len, int adaption_mode); 50 55 51 - /*! Free a voice echo canceller context. 52 - \param ec The echo canceller context. 53 - */ 56 + /** 57 + * oslec_free - Free a voice echo canceller context. 58 + * @ec: The echo canceller context. 59 + */ 54 60 void oslec_free(struct oslec_state *ec); 55 61 56 - /*! Flush (reinitialise) a voice echo canceller context. 57 - \param ec The echo canceller context. 58 - */ 62 + /** 63 + * oslec_flush - Flush (reinitialise) a voice echo canceller context. 64 + * @ec: The echo canceller context. 65 + */ 59 66 void oslec_flush(struct oslec_state *ec); 60 67 61 - /*! Set the adaption mode of a voice echo canceller context. 62 - \param ec The echo canceller context. 63 - \param adapt The mode. 64 - */ 68 + /** 69 + * oslec_adaption_mode - set the adaption mode of a voice echo canceller context. 70 + * @ec The echo canceller context. 71 + * @adaption_mode: The mode. 72 + */ 65 73 void oslec_adaption_mode(struct oslec_state *ec, int adaption_mode); 66 74 67 75 void oslec_snapshot(struct oslec_state *ec); 68 76 69 - /*! Process a sample through a voice echo canceller. 70 - \param ec The echo canceller context. 71 - \param tx The transmitted audio sample. 72 - \param rx The received audio sample. 73 - \return The clean (echo cancelled) received sample. 74 - */ 77 + /** 78 + * oslec_update: Process a sample through a voice echo canceller. 79 + * @ec: The echo canceller context. 80 + * @tx: The transmitted audio sample. 81 + * @rx: The received audio sample. 82 + * 83 + * The return value is the clean (echo cancelled) received sample. 84 + */ 75 85 int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx); 76 86 77 - /*! Process to high pass filter the tx signal. 78 - \param ec The echo canceller context. 79 - \param tx The transmitted auio sample. 80 - \return The HP filtered transmit sample, send this to your D/A. 81 - */ 87 + /** 88 + * oslec_hpf_tx: Process to high pass filter the tx signal. 89 + * @ec: The echo canceller context. 90 + * @tx: The transmitted auio sample. 91 + * 92 + * The return value is the HP filtered transmit sample, send this to your D/A. 93 + */ 82 94 int16_t oslec_hpf_tx(struct oslec_state *ec, int16_t tx); 83 95 84 96 #endif /* __OSLEC_H */