diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-18 17:44:26 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-21 10:08:13 -0200 |
commit | 8ca2e927eb29cdfb67439b5894307e7d3872f2ee (patch) | |
tree | 91b4b3946b56273819d682f76377a7ebed1090ba /drivers/media/tuners/tuner-simple.c | |
parent | 25ec587c02c3008ead4046a998eb412ce41c72ec (diff) | |
download | talos-op-linux-8ca2e927eb29cdfb67439b5894307e7d3872f2ee.tar.gz talos-op-linux-8ca2e927eb29cdfb67439b5894307e7d3872f2ee.zip |
[media] tuners: don't break long lines
Due to the 80-cols restrictions, and latter due to checkpatch
warnings, several strings were broken into multiple lines. This
is not considered a good practice anymore, as it makes harder
to grep for strings at the source code.
As we're right now fixing other drivers due to KERN_CONT, we need
to be able to identify what printk strings don't end with a "\n".
It is a way easier to detect those if we don't break long lines.
So, join those continuation lines.
The patch was generated via the script below, and manually
adjusted if needed.
</script>
use Text::Tabs;
while (<>) {
if ($next ne "") {
$c=$_;
if ($c =~ /^\s+\"(.*)/) {
$c2=$1;
$next =~ s/\"\n$//;
$n = expand($next);
$funpos = index($n, '(');
$pos = index($c2, '",');
if ($funpos && $pos > 0) {
$s1 = substr $c2, 0, $pos + 2;
$s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2;
$s2 =~ s/^\s+//;
$s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne "");
print unexpand("$next$s1\n");
print unexpand("$s2\n") if ($s2 ne "");
} else {
print "$next$c2\n";
}
$next="";
next;
} else {
print $next;
}
$next="";
} else {
if (m/\"$/) {
if (!m/\\n\"$/) {
$next=$_;
next;
}
}
}
print $_;
}
</script>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/tuners/tuner-simple.c')
-rw-r--r-- | drivers/media/tuners/tuner-simple.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/drivers/media/tuners/tuner-simple.c b/drivers/media/tuners/tuner-simple.c index 9ba9582e7765..315f45cd0778 100644 --- a/drivers/media/tuners/tuner-simple.c +++ b/drivers/media/tuners/tuner-simple.c @@ -275,8 +275,7 @@ static int simple_config_lookup(struct dvb_frontend *fe, *config = t_params->ranges[i].config; *cb = t_params->ranges[i].cb; - tuner_dbg("freq = %d.%02d (%d), range = %d, " - "config = 0x%02x, cb = 0x%02x\n", + tuner_dbg("freq = %d.%02d (%d), range = %d, config = 0x%02x, cb = 0x%02x\n", *frequency / 16, *frequency % 16 * 100 / 16, *frequency, i, *config, *cb); @@ -404,12 +403,12 @@ static int simple_std_setup(struct dvb_frontend *fe, i2c.addr = 0x0a; rc = tuner_i2c_xfer_send(&i2c, &buffer[0], 2); if (2 != rc) - tuner_warn("i2c i/o error: rc == %d " - "(should be 2)\n", rc); + tuner_warn("i2c i/o error: rc == %d (should be 2)\n", + rc); rc = tuner_i2c_xfer_send(&i2c, &buffer[2], 2); if (2 != rc) - tuner_warn("i2c i/o error: rc == %d " - "(should be 2)\n", rc); + tuner_warn("i2c i/o error: rc == %d (should be 2)\n", + rc); break; } } @@ -463,8 +462,8 @@ static int simple_post_tune(struct dvb_frontend *fe, u8 *buffer, rc = tuner_i2c_xfer_recv(&priv->i2c_props, &status_byte, 1); if (1 != rc) { - tuner_warn("i2c i/o read error: rc == %d " - "(should be 1)\n", rc); + tuner_warn("i2c i/o read error: rc == %d (should be 1)\n", + rc); break; } if (status_byte & TUNER_PLL_LOCKED) @@ -483,8 +482,8 @@ static int simple_post_tune(struct dvb_frontend *fe, u8 *buffer, rc = tuner_i2c_xfer_send(&priv->i2c_props, buffer, 4); if (4 != rc) - tuner_warn("i2c i/o error: rc == %d " - "(should be 4)\n", rc); + tuner_warn("i2c i/o error: rc == %d (should be 4)\n", + rc); break; } } @@ -499,8 +498,7 @@ static int simple_radio_bandswitch(struct dvb_frontend *fe, u8 *buffer) switch (priv->type) { case TUNER_TENA_9533_DI: case TUNER_YMEC_TVF_5533MF: - tuner_dbg("This tuner doesn't have FM. " - "Most cards have a TEA5767 for FM\n"); + tuner_dbg("This tuner doesn't have FM. Most cards have a TEA5767 for FM\n"); return 0; case TUNER_PHILIPS_FM1216ME_MK3: case TUNER_PHILIPS_FM1236_MK3: @@ -586,8 +584,7 @@ static int simple_set_tv_freq(struct dvb_frontend *fe, div = params->frequency + IFPCoff + offset; - tuner_dbg("Freq= %d.%02d MHz, V_IF=%d.%02d MHz, " - "Offset=%d.%02d MHz, div=%0d\n", + tuner_dbg("Freq= %d.%02d MHz, V_IF=%d.%02d MHz, Offset=%d.%02d MHz, div=%0d\n", params->frequency / 16, params->frequency % 16 * 100 / 16, IFPCoff / 16, IFPCoff % 16 * 100 / 16, offset / 16, offset % 16 * 100 / 16, div); @@ -858,8 +855,7 @@ static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, if (!tun->stepsize) { /* tuner-core was loaded before the digital tuner was * configured and somehow picked the wrong tuner type */ - tuner_err("attempt to treat tuner %d (%s) as digital tuner " - "without stepsize defined.\n", + tuner_err("attempt to treat tuner %d (%s) as digital tuner without stepsize defined.\n", priv->type, priv->tun->name); return 0; /* failure */ } @@ -1077,8 +1073,7 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, fe->ops.i2c_gate_ctrl(fe, 1); if (1 != i2c_transfer(i2c_adap, &msg, 1)) - printk(KERN_WARNING "tuner-simple %d-%04x: " - "unable to probe %s, proceeding anyway.", + printk(KERN_WARNING "tuner-simple %d-%04x: unable to probe %s, proceeding anyway.", i2c_adapter_id(i2c_adap), i2c_addr, tuners[type].name); @@ -1123,18 +1118,16 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, if ((debug) || ((atv_input[priv->nr] > 0) || (dtv_input[priv->nr] > 0))) { if (0 == atv_input[priv->nr]) - tuner_info("tuner %d atv rf input will be " - "autoselected\n", priv->nr); + tuner_info("tuner %d atv rf input will be autoselected\n", + priv->nr); else - tuner_info("tuner %d atv rf input will be " - "set to input %d (insmod option)\n", + tuner_info("tuner %d atv rf input will be set to input %d (insmod option)\n", priv->nr, atv_input[priv->nr]); if (0 == dtv_input[priv->nr]) - tuner_info("tuner %d dtv rf input will be " - "autoselected\n", priv->nr); + tuner_info("tuner %d dtv rf input will be autoselected\n", + priv->nr); else - tuner_info("tuner %d dtv rf input will be " - "set to input %d (insmod option)\n", + tuner_info("tuner %d dtv rf input will be set to input %d (insmod option)\n", priv->nr, dtv_input[priv->nr]); } |