All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Scheller <d.scheller.oss@gmail.com>
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	[thread overview]
Message-ID: <20170723101315.12523-6-d.scheller.oss@gmail.com> (raw)
In-Reply-To: <20170723101315.12523-1-d.scheller.oss@gmail.com>

From: Daniel Scheller <d.scheller@gmx.net>

Fix up all remainders reported by checkpatch-strict.

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
---
 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;
-- 
2.13.0

  parent reply	other threads:[~2017-07-23 10:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-23 10:13 [PATCH 0/7] stv0910/stv6111 updates Daniel Scheller
2017-07-23 10:13 ` [PATCH 1/7] [media] dvb-frontends/stv0910: fix STR assignment, remove unneeded var Daniel Scheller
2017-07-23 10:13 ` [PATCH 2/7] [media] dvb-frontends/stv0910: implement diseqc_send_burst Daniel Scheller
2017-07-23 10:13 ` [PATCH 3/7] [media] dvb-frontends/stv0910: further coding style cleanup Daniel Scheller
2017-07-23 10:13 ` [PATCH 4/7] [media] dvb-frontends/stv0910: cosmetics: fixup comments, misc Daniel Scheller
2017-07-23 10:13 ` Daniel Scheller [this message]
2017-07-23 10:13 ` [PATCH 6/7] [media] dvb-frontends/stv6111: cosmetics: comments fixup, misc Daniel Scheller
2017-07-23 10:13 ` [PATCH 7/7] [media] dvb-frontends/stv{0910,6111}: constify tables Daniel Scheller
2017-07-23 15:22 ` [PATCH 0/7] stv0910/stv6111 updates Jasmin J.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170723101315.12523-6-d.scheller.oss@gmail.com \
    --to=d.scheller.oss@gmail.com \
    --cc=jasmin@anw.at \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mchehab@s-opensource.com \
    --cc=r.scobie@clear.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.