diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-18 15:44:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-21 07:29:44 -0400 |
commit | db6d8d5fdf9537641c76ba7f32e02b4bcc600972 (patch) | |
tree | df8e3bf54f3d1cfaa048e21654d3b980ec8d3566 /drivers/media/pci/tw68 | |
parent | 008e6ff9b9bf57a22b49643923bfa4dcaa792fa9 (diff) |
[media] tw68: 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/pci/tw68')
-rw-r--r-- | drivers/media/pci/tw68/tw68-video.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c index a45e02367321..58c4dd75bfa1 100644 --- a/drivers/media/pci/tw68/tw68-video.c +++ b/drivers/media/pci/tw68/tw68-video.c | |||
@@ -279,9 +279,8 @@ static int tw68_set_scale(struct tw68_dev *dev, unsigned int width, | |||
279 | height /= 2; /* we must set for 1-frame */ | 279 | height /= 2; /* we must set for 1-frame */ |
280 | 280 | ||
281 | pr_debug("%s: width=%d, height=%d, both=%d\n" | 281 | pr_debug("%s: width=%d, height=%d, both=%d\n" |
282 | " tvnorm h_delay=%d, h_start=%d, h_stop=%d, " | 282 | " tvnorm h_delay=%d, h_start=%d, h_stop=%d, v_delay=%d, v_start=%d, v_stop=%d\n", |
283 | "v_delay=%d, v_start=%d, v_stop=%d\n" , __func__, | 283 | __func__, width, height, V4L2_FIELD_HAS_BOTH(field), |
284 | width, height, V4L2_FIELD_HAS_BOTH(field), | ||
285 | norm->h_delay, norm->h_start, norm->h_stop, | 284 | norm->h_delay, norm->h_start, norm->h_stop, |
286 | norm->v_delay, norm->video_v_start, | 285 | norm->v_delay, norm->video_v_start, |
287 | norm->video_v_stop); | 286 | norm->video_v_stop); |
@@ -309,16 +308,15 @@ static int tw68_set_scale(struct tw68_dev *dev, unsigned int width, | |||
309 | V4L2_FIELD_HAS_TOP(field) ? "T" : "", | 308 | V4L2_FIELD_HAS_TOP(field) ? "T" : "", |
310 | V4L2_FIELD_HAS_BOTTOM(field) ? "B" : "", | 309 | V4L2_FIELD_HAS_BOTTOM(field) ? "B" : "", |
311 | v4l2_norm_to_name(dev->tvnorm->id)); | 310 | v4l2_norm_to_name(dev->tvnorm->id)); |
312 | pr_debug("%s: hactive=%d, hdelay=%d, hscale=%d; " | 311 | pr_debug("%s: hactive=%d, hdelay=%d, hscale=%d; vactive=%d, vdelay=%d, vscale=%d\n", |
313 | "vactive=%d, vdelay=%d, vscale=%d\n", __func__, | 312 | __func__, |
314 | hactive, hdelay, hscale, vactive, vdelay, vscale); | 313 | hactive, hdelay, hscale, vactive, vdelay, vscale); |
315 | 314 | ||
316 | comb = ((vdelay & 0x300) >> 2) | | 315 | comb = ((vdelay & 0x300) >> 2) | |
317 | ((vactive & 0x300) >> 4) | | 316 | ((vactive & 0x300) >> 4) | |
318 | ((hdelay & 0x300) >> 6) | | 317 | ((hdelay & 0x300) >> 6) | |
319 | ((hactive & 0x300) >> 8); | 318 | ((hactive & 0x300) >> 8); |
320 | pr_debug("%s: setting CROP_HI=%02x, VDELAY_LO=%02x, " | 319 | pr_debug("%s: setting CROP_HI=%02x, VDELAY_LO=%02x, VACTIVE_LO=%02x, HDELAY_LO=%02x, HACTIVE_LO=%02x\n", |
321 | "VACTIVE_LO=%02x, HDELAY_LO=%02x, HACTIVE_LO=%02x\n", | ||
322 | __func__, comb, vdelay, vactive, hdelay, hactive); | 320 | __func__, comb, vdelay, vactive, hdelay, hactive); |
323 | tw_writeb(TW68_CROP_HI, comb); | 321 | tw_writeb(TW68_CROP_HI, comb); |
324 | tw_writeb(TW68_VDELAY_LO, vdelay & 0xff); | 322 | tw_writeb(TW68_VDELAY_LO, vdelay & 0xff); |
@@ -327,8 +325,8 @@ static int tw68_set_scale(struct tw68_dev *dev, unsigned int width, | |||
327 | tw_writeb(TW68_HACTIVE_LO, hactive & 0xff); | 325 | tw_writeb(TW68_HACTIVE_LO, hactive & 0xff); |
328 | 326 | ||
329 | comb = ((vscale & 0xf00) >> 4) | ((hscale & 0xf00) >> 8); | 327 | comb = ((vscale & 0xf00) >> 4) | ((hscale & 0xf00) >> 8); |
330 | pr_debug("%s: setting SCALE_HI=%02x, VSCALE_LO=%02x, " | 328 | pr_debug("%s: setting SCALE_HI=%02x, VSCALE_LO=%02x, HSCALE_LO=%02x\n", |
331 | "HSCALE_LO=%02x\n", __func__, comb, vscale, hscale); | 329 | __func__, comb, vscale, hscale); |
332 | tw_writeb(TW68_SCALE_HI, comb); | 330 | tw_writeb(TW68_SCALE_HI, comb); |
333 | tw_writeb(TW68_VSCALE_LO, vscale); | 331 | tw_writeb(TW68_VSCALE_LO, vscale); |
334 | tw_writeb(TW68_HSCALE_LO, hscale); | 332 | tw_writeb(TW68_HSCALE_LO, hscale); |