From patchwork Sat Oct 8 11:49:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9368109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DC02608A6 for ; Sat, 8 Oct 2016 11:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F418329980 for ; Sat, 8 Oct 2016 11:49:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5C1929986; Sat, 8 Oct 2016 11:49:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77B9029980 for ; Sat, 8 Oct 2016 11:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935154AbcJHLtS (ORCPT ); Sat, 8 Oct 2016 07:49:18 -0400 Received: from mout.web.de ([212.227.15.14]:60011 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934975AbcJHLtM (ORCPT ); Sat, 8 Oct 2016 07:49:12 -0400 Received: from [192.168.1.3] ([77.182.84.69]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0M8hxz-1ayFMi1vGN-00wFW4; Sat, 08 Oct 2016 13:49:03 +0200 Subject: [PATCH 2/2] [media] cx88-dsp: Add some spaces for better code readability To: linux-media@vger.kernel.org, Mauro Carvalho Chehab References: Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Sat, 8 Oct 2016 13:49:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:r9tKIAm7kI39LZvVXagI5/CvpidQn3vSWq7Y0//7unWJplfNGUT vFtp2Kv9pjLMMSvK910u9R+G/9vt0SRy0pcjve/L4J/ecyj0eU7KtPPDnBxZhqsiyb0O/3Y W2c5QB6/wsCVKlGwXUeF1RptqnfpqEp9tH6a/CTi6PUnQkSIMtLNSHcxHYMKb7Psek1Ak+f SjNz7jgnkQj3L2zagGOxQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:VStAGEuBXFI=:gclx9CZ3yLYRK11yJLDbMj GDM3eYzDMYxmvaasFOlOUR0WnYS+KfjjIlEFOvZGWlLGVVp1EQUIskinqiDUBqVav9iRbvMOf IZINZ51C67v5idf5iopB4PmyhK6D/GS6cQD67kjkegLlLw1+udu8Ct48xhho61iaor3kLiQUv xWH/CorFYOqruOnMFE9pFbVWWzmt5vEvhY7e/6qeZYClv6gL/5qK79ylG1t9rkt5NpCZF6IBh qGMgGrXoUFfcgJL9ByCDdH2TTE/WoduIJCPP91+bKR872BUqdzKPGLnSONLKWrKkhHPSv8tNw JuCIruxMJdq+EYnD6LAJC5OvbM659bgOZsZFEFxCEmEgU6YQtCqr8K2hJHYrJ8bHWtQZUyj+3 5LO5yuFlXvo4Ov4bZ8o3BEcqQT3b+BDH5m55cg3f3rpjMapqrg+viCaz6KlgHjmxWxAf6+bVl dlJMPj65ctFBCZCD2ixqQARMb/xI7hjw1hITkf1725WBrcmVKcYiq56UD1JeeM8i0A1+fAD06 dftJDA+A5/Fo40RMb/OxZqpJz1C1ka135METxTAkVL1p1Al+YslU80wRD37v41JhPFEN9hQk0 McgKRUW8eldqN3PhBvna3RLjiW0hdUjj3Ly9llntO2P9ldrb3sT3pUmPMV+PFmUND2JjrSNVK tnd5KN5Kib1DgqbCJtxbFmd34KQlhuqNw/LOCVXMJlMGZarqky37NIRoQVNiRd20cz8IGcPS0 +GTiC4RCiYlR2oos/t51xSjqVVJjhUsmd9SF+cjkFfhCg4Pk6IkltN2KZ9NutMnYumbfUCxd/ fmIl1gg Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 7 Oct 2016 22:30:40 +0200 Use space characters at some source code places according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/media/pci/cx88/cx88-dsp.c | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/media/pci/cx88/cx88-dsp.c b/drivers/media/pci/cx88/cx88-dsp.c index 9acda12..13f3a66 100644 --- a/drivers/media/pci/cx88/cx88-dsp.c +++ b/drivers/media/pci/cx88/cx88-dsp.c @@ -31,7 +31,7 @@ #define INT_PI ((s32)(3.141592653589 * 32768.0)) #define compat_remainder(a, b) \ - ((float)(((s32)((a)*100))%((s32)((b)*100)))/100.0) + ((float)(((s32)((a) * 100)) % ((s32)((b) * 100))) / 100.0) #define baseband_freq(carrier, srate, tone) ((s32)( \ (compat_remainder(carrier + tone, srate)) / srate * 2 * INT_PI)) @@ -82,15 +82,15 @@ static s32 int_cos(u32 x) if (period % 2) return -int_cos(x - INT_PI); x = x % INT_PI; - if (x > INT_PI/2) - return -int_cos(INT_PI/2 - (x % (INT_PI/2))); + if (x > INT_PI / 2) + return -int_cos(INT_PI / 2 - (x % (INT_PI / 2))); /* Now x is between 0 and INT_PI/2. * To calculate cos(x) we use it's Taylor polinom. */ - t2 = x*x/32768/2; - t4 = t2*x/32768*x/32768/3/4; - t6 = t4*x/32768*x/32768/5/6; - t8 = t6*x/32768*x/32768/7/8; - ret = 32768-t2+t4-t6+t8; + t2 = x * x / 32768 / 2; + t4 = t2 * x / 32768 * x / 32768 / 3 / 4; + t6 = t4 * x / 32768 * x / 32768 / 5 / 6; + t8 = t6 * x / 32768 * x / 32768 / 7 / 8; + ret = 32768 - t2 + t4 - t6 + t8; return ret; } @@ -100,14 +100,14 @@ static u32 int_goertzel(s16 x[], u32 N, u32 freq) * given frequency in the signal */ s32 s_prev = 0; s32 s_prev2 = 0; - s32 coeff = 2*int_cos(freq); + s32 coeff = 2 * int_cos(freq); u32 i; u64 tmp; u32 divisor; for (i = 0; i < N; i++) { - s32 s = x[i] + ((s64)coeff*s_prev/32768) - s_prev2; + s32 s = x[i] + ((s64)coeff * s_prev / 32768) - s_prev2; s_prev2 = s_prev; s_prev = s; } @@ -138,7 +138,7 @@ static u32 noise_magnitude(s16 x[], u32 N, u32 freq_start, u32 freq_end) if (N > 192) { /* The last 192 samples are enough for noise detection */ - x += (N-192); + x += (N - 192); N = 192; } @@ -196,8 +196,8 @@ static s32 detect_a2_a2m_eiaj(struct cx88_core *core, s16 x[], u32 N) if (core->tvaudio == WW_EIAJ) { /* EIAJ checks may need adjustments */ - if ((carrier > max(stereo, dual)*2) && - (carrier < max(stereo, dual)*6) && + if ((carrier > max(stereo, dual) * 2) && + (carrier < max(stereo, dual) * 6) && (carrier > 20 && carrier < 200) && (max(stereo, dual) > min(stereo, dual))) { /* For EIAJ the carrier is always present, @@ -205,11 +205,11 @@ static s32 detect_a2_a2m_eiaj(struct cx88_core *core, s16 x[], u32 N) return ret; } } else { - if ((carrier > max(stereo, dual)*2) && - (carrier < max(stereo, dual)*8) && + if ((carrier > max(stereo, dual) * 2) && + (carrier < max(stereo, dual) * 8) && (carrier > 20 && carrier < 200) && (noise < 10) && - (max(stereo, dual) > min(stereo, dual)*2)) { + (max(stereo, dual) > min(stereo, dual) * 2)) { return ret; } } @@ -234,9 +234,9 @@ static s16 *read_rds_samples(struct cx88_core *core, u32 *N) s16 *samples; unsigned int i; - unsigned int bpl = srch->fifo_size/AUD_RDS_LINES; - unsigned int spl = bpl/4; - unsigned int sample_count = spl*(AUD_RDS_LINES-1); + unsigned int bpl = srch->fifo_size / AUD_RDS_LINES; + unsigned int spl = bpl / 4; + unsigned int sample_count = spl * (AUD_RDS_LINES - 1); u32 current_address = cx_read(srch->ptr1_reg); u32 offset = (current_address - srch->fifo_start + bpl); @@ -252,7 +252,7 @@ static s16 *read_rds_samples(struct cx88_core *core, u32 *N) *N = sample_count; for (i = 0; i < sample_count; i++) { - offset = offset % (AUD_RDS_LINES*bpl); + offset = offset % (AUD_RDS_LINES * bpl); samples[i] = cx_read(srch->fifo_start + offset); offset += 4; }