From patchwork Sun Jul 23 10:13:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9858311 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 27909602B9 for ; Sun, 23 Jul 2017 10:14:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14E4C28500 for ; Sun, 23 Jul 2017 10:14:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06EE928518; Sun, 23 Jul 2017 10:14:26 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 87DC928500 for ; Sun, 23 Jul 2017 10:14:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbdGWKN1 (ORCPT ); Sun, 23 Jul 2017 06:13:27 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35705 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909AbdGWKNZ (ORCPT ); Sun, 23 Jul 2017 06:13:25 -0400 Received: by mail-wm0-f67.google.com with SMTP id m75so5412375wmb.2 for ; Sun, 23 Jul 2017 03:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cp/J4IAdo9lZp0RHg1f5zQBy8ZKau28skeBawzYW2NU=; b=HaonDv8e+sTxujWb7vgHjWUGgE8VXC6RTN7YtvWTF+BjaaZ811MAohddQRB3/exISQ 7w0uDKKvoYCEPd+Z+22UFR5yMCEc8yLNY7rFNhAuHjdYHTvmLsyTyeI++55XTiOJIJUA Ui8Kk0Hgje/jnb6MPYqaOB8u/HiRGJzCTaYQ1nhfBKqpBUM/iqo5Ysm7jHR9xZAcInOX BYszvK4H86Dbiznj8UswF+/zB648YFLcd7fs2Kjk9aOhJkdMZLcDPbvBhxwFkVISa9+Q nIg6cBVCF0MtCkVTjSdpZlj/Mtt7595HTMPhp+vIIiNFV+b4eAhVVlBgTLMXbLlrG6qM yGBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cp/J4IAdo9lZp0RHg1f5zQBy8ZKau28skeBawzYW2NU=; b=qCJCoPdKkbwyJPCz0fQUp7jCC4xJp96YsdADnWz6fskjFQxhnWCMYAsjj4RkBw5G6d E+YF2PgLDtKw4U6nxXaJYn3U/CmOjFdoroxyRG7X8bahT7lGF1YfdvU6Tm5ekgRVaJ9u Ia+ADGXuVo6hFGTMPpwwyRNZYrXfUl6LwVNCZa62L43PK3LWyPfcnY7L6ePhFSERinJL 2MujtSY8Uc+y9iY22ZumKMRAjhFNUAsKI4JTF1rw4h/3gXd8HaZ12/ovm7Z91JdF0Dm5 avMFextTGX/IURLbYEY00Kam8LdCTDWvDPEarJlbcfe5Ter24khqPf1LyZ7hxZf7qPfv dJcg== X-Gm-Message-State: AIVw111YTX/Y/3Ip38FVjwVVr5RpvWJglmBb/SEXPO/qzwTyfBnGsQpP S4UedYzb63iDwNSJ X-Received: by 10.28.29.2 with SMTP id d2mr2542236wmd.152.1500804803795; Sun, 23 Jul 2017 03:13:23 -0700 (PDT) Received: from dvbdev.wuest.de (ip-84-118-193-88.unity-media.net. [84.118.193.88]) by smtp.gmail.com with ESMTPSA id i67sm10905796wri.61.2017.07.23.03.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Jul 2017 03:13:23 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: jasmin@anw.at, r.scobie@clear.net.nz Subject: [PATCH 5/7] [media] dvb-frontends/stv6111: coding style cleanup Date: Sun, 23 Jul 2017 12:13:13 +0200 Message-Id: <20170723101315.12523-6-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170723101315.12523-1-d.scheller.oss@gmail.com> References: <20170723101315.12523-1-d.scheller.oss@gmail.com> 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: Daniel Scheller Fix up all remainders reported by checkpatch-strict. Signed-off-by: Daniel Scheller --- drivers/media/dvb-frontends/stv6111.c | 38 ++++++++++++++++++++--------------- drivers/media/dvb-frontends/stv6111.h | 7 ++++--- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/drivers/media/dvb-frontends/stv6111.c b/drivers/media/dvb-frontends/stv6111.c index ce5b5ff936d5..91e24ba44c30 100644 --- a/drivers/media/dvb-frontends/stv6111.c +++ b/drivers/media/dvb-frontends/stv6111.c @@ -298,7 +298,7 @@ static inline u32 muldiv32(u32 a, u32 b, u32 c) tmp64 = (u64)a * (u64)b; do_div(tmp64, c); - return (u32) tmp64; + return (u32)tmp64; } static int i2c_read(struct i2c_adapter *adap, @@ -429,10 +429,10 @@ static int set_bandwidth(struct dvb_frontend *fe, u32 cutoff_frequency) index = 6; if (index > 50) index = 50; - if ((state->reg[0x08] & ~0xFC) == ((index-6) << 2)) + if ((state->reg[0x08] & ~0xFC) == ((index - 6) << 2)) return 0; - state->reg[0x08] = (state->reg[0x08] & ~0xFC) | ((index-6) << 2); + state->reg[0x08] = (state->reg[0x08] & ~0xFC) | ((index - 6) << 2); state->reg[0x09] = (state->reg[0x09] & ~0x0C) | 0x08; if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 1); @@ -542,12 +542,12 @@ static s32 table_lookup(struct slookup *table, int table_size, u16 reg_value) int i; /* Assumes Table[0].RegValue < Table[imax].RegValue */ - if (reg_value <= table[0].reg_value) + if (reg_value <= table[0].reg_value) { gain = table[0].value; - else if (reg_value >= table[imax].reg_value) + } else if (reg_value >= table[imax].reg_value) { gain = table[imax].value; - else { - while (imax-imin > 1) { + } else { + while ((imax - imin) > 1) { i = (imax + imin) / 2; if ((table[imin].reg_value <= reg_value) && (reg_value <= table[i].reg_value)) @@ -558,9 +558,9 @@ static s32 table_lookup(struct slookup *table, int table_size, u16 reg_value) reg_diff = table[imax].reg_value - table[imin].reg_value; gain = table[imin].value; if (reg_diff != 0) - gain += ((s32) (reg_value - table[imin].reg_value) * + gain += ((s32)(reg_value - table[imin].reg_value) * (s32)(table[imax].value - - table[imin].value))/(reg_diff); + - table[imin].value)) / reg_diff; } return gain; } @@ -587,27 +587,33 @@ static int get_rf_strength(struct dvb_frontend *fe, u16 *st) if ((state->reg[0x02] & 0x80) == 0) /* NF */ gain = table_lookup(lnagain_nf_lookup, - ARRAY_SIZE(lnagain_nf_lookup), reg & 0x1F); + ARRAY_SIZE(lnagain_nf_lookup), + reg & 0x1F); else /* IIP3 */ gain = table_lookup(lnagain_iip3_lookup, - ARRAY_SIZE(lnagain_iip3_lookup), reg & 0x1F); + ARRAY_SIZE(lnagain_iip3_lookup), + reg & 0x1F); gain += table_lookup(gain_rfagc_lookup, - ARRAY_SIZE(gain_rfagc_lookup), rfagc); + ARRAY_SIZE(gain_rfagc_lookup), rfagc); + gain -= 2400; } else { /* Channel Mode */ if ((state->reg[0x02] & 0x80) == 0) { /* NF */ - gain = table_lookup(gain_channel_agc_nf_lookup, + gain = table_lookup( + gain_channel_agc_nf_lookup, ARRAY_SIZE(gain_channel_agc_nf_lookup), rfagc); + gain += 600; } else { /* IIP3 */ - gain = table_lookup(gain_channel_agc_iip3_lookup, + gain = table_lookup( + gain_channel_agc_iip3_lookup, ARRAY_SIZE(gain_channel_agc_iip3_lookup), - rfagc); + rfagc); } } @@ -647,7 +653,7 @@ struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe, struct stv *state; int stat; - state = kzalloc(sizeof(struct stv), GFP_KERNEL); + state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state) return NULL; state->adr = adr; diff --git a/drivers/media/dvb-frontends/stv6111.h b/drivers/media/dvb-frontends/stv6111.h index 066dd70c9426..5bc1228dc9bd 100644 --- a/drivers/media/dvb-frontends/stv6111.h +++ b/drivers/media/dvb-frontends/stv6111.h @@ -3,13 +3,14 @@ #if IS_REACHABLE(CONFIG_DVB_STV6111) -extern struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, u8 adr); +struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe, + struct i2c_adapter *i2c, u8 adr); #else static inline struct dvb_frontend *stv6111_attach(struct dvb_frontend *fe, - struct i2c_adapter *i2c, u8 adr) + struct i2c_adapter *i2c, + u8 adr) { pr_warn("%s: Driver disabled by Kconfig\n", __func__); return NULL;