aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-18 15:44:17 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-21 07:42:04 -0400
commit4d5ded751e8651707d5b6b59bcd45576c1b04bff (patch)
treed681c5cc151bca2ecc50ce9db5f23558b30a3147
parent1ddc9f75a4c95dd284cd33783b72ed0ae4709a09 (diff)
[media] hdpvr: 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>
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-core.c9
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-i2c.c7
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-video.c4
3 files changed, 7 insertions, 13 deletions
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index a61d8fd63c12..15f016ad5b89 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -41,13 +41,11 @@ MODULE_PARM_DESC(hdpvr_debug, "enable debugging output");
41 41
42static uint default_video_input = HDPVR_VIDEO_INPUTS; 42static uint default_video_input = HDPVR_VIDEO_INPUTS;
43module_param(default_video_input, uint, S_IRUGO|S_IWUSR); 43module_param(default_video_input, uint, S_IRUGO|S_IWUSR);
44MODULE_PARM_DESC(default_video_input, "default video input: 0=Component / " 44MODULE_PARM_DESC(default_video_input, "default video input: 0=Component / 1=S-Video / 2=Composite");
45 "1=S-Video / 2=Composite");
46 45
47static uint default_audio_input = HDPVR_AUDIO_INPUTS; 46static uint default_audio_input = HDPVR_AUDIO_INPUTS;
48module_param(default_audio_input, uint, S_IRUGO|S_IWUSR); 47module_param(default_audio_input, uint, S_IRUGO|S_IWUSR);
49MODULE_PARM_DESC(default_audio_input, "default audio input: 0=RCA back / " 48MODULE_PARM_DESC(default_audio_input, "default audio input: 0=RCA back / 1=RCA front / 2=S/PDIF");
50 "1=RCA front / 2=S/PDIF");
51 49
52static bool boost_audio; 50static bool boost_audio;
53module_param(boost_audio, bool, S_IRUGO|S_IWUSR); 51module_param(boost_audio, bool, S_IRUGO|S_IWUSR);
@@ -165,8 +163,7 @@ static int device_authorization(struct hdpvr_device *dev)
165 dev->flags |= HDPVR_FLAG_AC3_CAP; 163 dev->flags |= HDPVR_FLAG_AC3_CAP;
166 break; 164 break;
167 default: 165 default:
168 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might" 166 v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might not work.\n");
169 " not work.\n");
170 if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3) 167 if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)
171 dev->flags |= HDPVR_FLAG_AC3_CAP; 168 dev->flags |= HDPVR_FLAG_AC3_CAP;
172 else 169 else
diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c
index 9b641c4d4431..fcab55038d99 100644
--- a/drivers/media/usb/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c
@@ -145,15 +145,14 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs,
145 msgs[0].len); 145 msgs[0].len);
146 } else if (num == 2) { 146 } else if (num == 2) {
147 if (msgs[0].addr != msgs[1].addr) { 147 if (msgs[0].addr != msgs[1].addr) {
148 v4l2_warn(&dev->v4l2_dev, "refusing 2-phase i2c xfer " 148 v4l2_warn(&dev->v4l2_dev, "refusing 2-phase i2c xfer with conflicting target addresses\n");
149 "with conflicting target addresses\n");
150 retval = -EINVAL; 149 retval = -EINVAL;
151 goto out; 150 goto out;
152 } 151 }
153 152
154 if ((msgs[0].flags & I2C_M_RD) || !(msgs[1].flags & I2C_M_RD)) { 153 if ((msgs[0].flags & I2C_M_RD) || !(msgs[1].flags & I2C_M_RD)) {
155 v4l2_warn(&dev->v4l2_dev, "refusing complex xfer with " 154 v4l2_warn(&dev->v4l2_dev, "refusing complex xfer with r0=%d, r1=%d\n",
156 "r0=%d, r1=%d\n", msgs[0].flags & I2C_M_RD, 155 msgs[0].flags & I2C_M_RD,
157 msgs[1].flags & I2C_M_RD); 156 msgs[1].flags & I2C_M_RD);
158 retval = -EINVAL; 157 retval = -EINVAL;
159 goto out; 158 goto out;
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index 474c11e1d495..e3e7682d0f0e 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -336,9 +336,7 @@ static int hdpvr_stop_streaming(struct hdpvr_device *dev)
336 336
337 buf = kmalloc(dev->bulk_in_size, GFP_KERNEL); 337 buf = kmalloc(dev->bulk_in_size, GFP_KERNEL);
338 if (!buf) 338 if (!buf)
339 v4l2_err(&dev->v4l2_dev, "failed to allocate temporary buffer " 339 v4l2_err(&dev->v4l2_dev, "failed to allocate temporary buffer for emptying the internal device buffer. Next capture start will be slow\n");
340 "for emptying the internal device buffer. "
341 "Next capture start will be slow\n");
342 340
343 dev->status = STATUS_SHUTTING_DOWN; 341 dev->status = STATUS_SHUTTING_DOWN;
344 hdpvr_config_call(dev, CTRL_STOP_STREAMING_VALUE, 0x00); 342 hdpvr_config_call(dev, CTRL_STOP_STREAMING_VALUE, 0x00);