Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] cx231xx: 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>

+6 -8
+4 -6
drivers/media/usb/cx231xx/cx231xx-core.c
··· 241 241 int rc, i; 242 242 243 243 if (reg_debug) { 244 - printk(KERN_DEBUG "%s: (pipe 0x%08x): " 245 - "%s: %02x %02x %02x %02x %02x %02x %02x %02x ", 244 + printk(KERN_DEBUG "%s: (pipe 0x%08x): %s: %02x %02x %02x %02x %02x %02x %02x %02x ", 246 245 dev->name, 247 246 pipe, 248 247 (requesttype & USB_DIR_IN) ? "IN" : "OUT", ··· 440 441 if (reg_debug) { 441 442 int byte; 442 443 443 - cx231xx_isocdbg("(pipe 0x%08x): " 444 - "OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>", 444 + cx231xx_isocdbg("(pipe 0x%08x): OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>", 445 445 pipe, 446 446 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 447 447 req, 0, val, reg & 0xff, ··· 598 600 return -1; 599 601 } 600 602 601 - cx231xx_coredbg("setting alternate %d with wMaxPacketSize=%u," 602 - "Interface = %d\n", alt, max_pkt_size, 603 + cx231xx_coredbg("setting alternate %d with wMaxPacketSize=%u,Interface = %d\n", 604 + alt, max_pkt_size, 603 605 usb_interface_index); 604 606 605 607 if (usb_interface_index > 0) {
+2 -2
drivers/media/usb/cx231xx/cx231xx-dvb.c
··· 377 377 cfg.i2c_addr = addr; 378 378 379 379 if (!dev->dvb->frontend) { 380 - dev_err(dev->dev, "%s/2: dvb frontend not attached. " 381 - "Can't attach xc5000\n", dev->name); 380 + dev_err(dev->dev, "%s/2: dvb frontend not attached. Can't attach xc5000\n", 381 + dev->name); 382 382 return -EINVAL; 383 383 } 384 384