summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pvrusb2/pvrusb2-ioread.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-18 17:44:18 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-21 09:51:20 -0200
commit96292c89cf1fa700ba086fd7c0e431ac90adba10 (patch)
treeaa0dc1f8350dd4950d30343f726c782b8d386456 /drivers/media/usb/pvrusb2/pvrusb2-ioread.c
parent4d5ded751e8651707d5b6b59bcd45576c1b04bff (diff)
downloadlinux-96292c89cf1fa700ba086fd7c0e431ac90adba10.tar.bz2
[media] pvrusb2: 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/usb/pvrusb2/pvrusb2-ioread.c')
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-ioread.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c
index 614d55767a4e..70b8a052eb5b 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-ioread.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-ioread.c
@@ -169,9 +169,7 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp)
stat = pvr2_buffer_queue(bp);
if (stat < 0) {
pvr2_trace(PVR2_TRACE_DATA_FLOW,
- "/*---TRACE_READ---*/"
- " pvr2_ioread_start id=%p"
- " error=%d",
+ "/*---TRACE_READ---*/ pvr2_ioread_start id=%p error=%d",
cp,stat);
pvr2_ioread_stop(cp);
return stat;
@@ -209,8 +207,8 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
do {
if (cp->stream) {
pvr2_trace(PVR2_TRACE_START_STOP,
- "/*---TRACE_READ---*/"
- " pvr2_ioread_setup (tear-down) id=%p",cp);
+ "/*---TRACE_READ---*/ pvr2_ioread_setup (tear-down) id=%p",
+ cp);
pvr2_ioread_stop(cp);
pvr2_stream_kill(cp->stream);
if (pvr2_stream_get_buffer_count(cp->stream)) {
@@ -220,8 +218,8 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
}
if (sp) {
pvr2_trace(PVR2_TRACE_START_STOP,
- "/*---TRACE_READ---*/"
- " pvr2_ioread_setup (setup) id=%p",cp);
+ "/*---TRACE_READ---*/ pvr2_ioread_setup (setup) id=%p",
+ cp);
pvr2_stream_kill(sp);
ret = pvr2_stream_set_buffer_count(sp,BUFFER_COUNT);
if (ret < 0) {
@@ -270,9 +268,7 @@ static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
if (stat < 0) {
// Streaming error...
pvr2_trace(PVR2_TRACE_DATA_FLOW,
- "/*---TRACE_READ---*/"
- " pvr2_ioread_read id=%p"
- " queue_error=%d",
+ "/*---TRACE_READ---*/ pvr2_ioread_read id=%p queue_error=%d",
cp,stat);
pvr2_ioread_stop(cp);
return 0;
@@ -292,9 +288,7 @@ static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
if (stat < 0) {
// Streaming error...
pvr2_trace(PVR2_TRACE_DATA_FLOW,
- "/*---TRACE_READ---*/"
- " pvr2_ioread_read id=%p"
- " buffer_error=%d",
+ "/*---TRACE_READ---*/ pvr2_ioread_read id=%p buffer_error=%d",
cp,stat);
pvr2_ioread_stop(cp);
// Give up.
@@ -347,8 +341,7 @@ static void pvr2_ioread_filter(struct pvr2_ioread *cp)
if (cp->sync_buf_offs >= cp->sync_key_len) {
cp->sync_trashed_count -= cp->sync_key_len;
pvr2_trace(PVR2_TRACE_DATA_FLOW,
- "/*---TRACE_READ---*/"
- " sync_state <== 2 (skipped %u bytes)",
+ "/*---TRACE_READ---*/ sync_state <== 2 (skipped %u bytes)",
cp->sync_trashed_count);
cp->sync_state = 2;
cp->sync_buf_offs = 0;
@@ -358,8 +351,7 @@ static void pvr2_ioread_filter(struct pvr2_ioread *cp)
if (cp->c_data_offs < cp->c_data_len) {
// Sanity check - should NEVER get here
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
- "ERROR: pvr2_ioread filter sync problem"
- " len=%u offs=%u",
+ "ERROR: pvr2_ioread filter sync problem len=%u offs=%u",
cp->c_data_len,cp->c_data_offs);
// Get out so we don't get stuck in an infinite
// loop.
@@ -418,8 +410,8 @@ int pvr2_ioread_read(struct pvr2_ioread *cp,void __user *buf,unsigned int cnt)
if (!cnt) {
pvr2_trace(PVR2_TRACE_TRAP,
- "/*---TRACE_READ---*/ pvr2_ioread_read id=%p"
- " ZERO Request? Returning zero.",cp);
+ "/*---TRACE_READ---*/ pvr2_ioread_read id=%p ZERO Request? Returning zero.",
+cp);
return 0;
}
@@ -477,8 +469,7 @@ int pvr2_ioread_read(struct pvr2_ioread *cp,void __user *buf,unsigned int cnt)
// Consumed entire key; switch mode
// to normal.
pvr2_trace(PVR2_TRACE_DATA_FLOW,
- "/*---TRACE_READ---*/"
- " sync_state <== 0");
+ "/*---TRACE_READ---*/ sync_state <== 0");
cp->sync_state = 0;
}
} else {
@@ -502,8 +493,7 @@ int pvr2_ioread_read(struct pvr2_ioread *cp,void __user *buf,unsigned int cnt)
}
pvr2_trace(PVR2_TRACE_DATA_FLOW,
- "/*---TRACE_READ---*/ pvr2_ioread_read"
- " id=%p request=%d result=%d",
+ "/*---TRACE_READ---*/ pvr2_ioread_read id=%p request=%d result=%d",
cp,req_cnt,ret);
return ret;
}