Commit ded026e0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] davinci: 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>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent db6d8d5f
...@@ -334,8 +334,8 @@ static int ccdc_set_params(void __user *params) ...@@ -334,8 +334,8 @@ static int ccdc_set_params(void __user *params)
x = copy_from_user(&ccdc_raw_params, params, sizeof(ccdc_raw_params)); x = copy_from_user(&ccdc_raw_params, params, sizeof(ccdc_raw_params));
if (x) { if (x) {
dev_dbg(ccdc_cfg.dev, "ccdc_set_params: error in copying ccdc" dev_dbg(ccdc_cfg.dev, "ccdc_set_params: error in copying ccdcparams, %d\n",
"params, %d\n", x); x);
return -EFAULT; return -EFAULT;
} }
......
...@@ -354,8 +354,8 @@ static int ccdc_set_params(void __user *params) ...@@ -354,8 +354,8 @@ static int ccdc_set_params(void __user *params)
x = copy_from_user(&ccdc_raw_params, params, sizeof(ccdc_raw_params)); x = copy_from_user(&ccdc_raw_params, params, sizeof(ccdc_raw_params));
if (x) { if (x) {
dev_dbg(ccdc_cfg.dev, "ccdc_set_params: error in copying" dev_dbg(ccdc_cfg.dev, "ccdc_set_params: error in copyingccdc params, %d\n",
"ccdc params, %d\n", x); x);
return -EFAULT; return -EFAULT;
} }
......
...@@ -705,15 +705,13 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) ...@@ -705,15 +705,13 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev)
"v4l2 sub device %s registered\n", "v4l2 sub device %s registered\n",
enc_info->module_name); enc_info->module_name);
else { else {
v4l2_err(&vpbe_dev->v4l2_dev, "encoder %s" v4l2_err(&vpbe_dev->v4l2_dev, "encoder %s failed to register",
" failed to register",
enc_info->module_name); enc_info->module_name);
ret = -ENODEV; ret = -ENODEV;
goto fail_kfree_encoders; goto fail_kfree_encoders;
} }
} else } else
v4l2_warn(&vpbe_dev->v4l2_dev, "non-i2c encoders" v4l2_warn(&vpbe_dev->v4l2_dev, "non-i2c encoders currently not supported");
" currently not supported");
} }
/* Add amplifier subdevice for dm365 */ /* Add amplifier subdevice for dm365 */
if ((strcmp(vpbe_dev->cfg->module_name, "dm365-vpbe-display") == 0) && if ((strcmp(vpbe_dev->cfg->module_name, "dm365-vpbe-display") == 0) &&
...@@ -735,8 +733,7 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) ...@@ -735,8 +733,7 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev)
amp_info->module_name); amp_info->module_name);
} else { } else {
vpbe_dev->amp = NULL; vpbe_dev->amp = NULL;
v4l2_warn(&vpbe_dev->v4l2_dev, "non-i2c amplifiers" v4l2_warn(&vpbe_dev->v4l2_dev, "non-i2c amplifiers currently not supported");
" currently not supported");
} }
} else { } else {
vpbe_dev->amp = NULL; vpbe_dev->amp = NULL;
...@@ -835,15 +832,13 @@ static int vpbe_probe(struct platform_device *pdev) ...@@ -835,15 +832,13 @@ static int vpbe_probe(struct platform_device *pdev)
if (!cfg->module_name[0] || if (!cfg->module_name[0] ||
!cfg->osd.module_name[0] || !cfg->osd.module_name[0] ||
!cfg->venc.module_name[0]) { !cfg->venc.module_name[0]) {
v4l2_err(pdev->dev.driver, "vpbe display module names not" v4l2_err(pdev->dev.driver, "vpbe display module names not defined\n");
" defined\n");
return ret; return ret;
} }
vpbe_dev = kzalloc(sizeof(*vpbe_dev), GFP_KERNEL); vpbe_dev = kzalloc(sizeof(*vpbe_dev), GFP_KERNEL);
if (vpbe_dev == NULL) { if (vpbe_dev == NULL) {
v4l2_err(pdev->dev.driver, "Unable to allocate memory" v4l2_err(pdev->dev.driver, "Unable to allocate memory for vpbe_device\n");
" for vpbe_device\n");
return -ENOMEM; return -ENOMEM;
} }
vpbe_dev->cfg = cfg; vpbe_dev->cfg = cfg;
......
...@@ -919,8 +919,7 @@ static const struct vpfe_pixel_format * ...@@ -919,8 +919,7 @@ static const struct vpfe_pixel_format *
else else
pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height; pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;
v4l2_info(&vpfe_dev->v4l2_dev, "adjusted width = %d, height =" v4l2_info(&vpfe_dev->v4l2_dev, "adjusted width = %d, height = %d, bpp = %d, bytesperline = %d, sizeimage = %d\n",
" %d, bpp = %d, bytesperline = %d, sizeimage = %d\n",
pixfmt->width, pixfmt->height, vpfe_pix_fmt->bpp, pixfmt->width, pixfmt->height, vpfe_pix_fmt->bpp,
pixfmt->bytesperline, pixfmt->sizeimage); pixfmt->bytesperline, pixfmt->sizeimage);
return vpfe_pix_fmt; return vpfe_pix_fmt;
...@@ -1088,8 +1087,7 @@ static int vpfe_enum_input(struct file *file, void *priv, ...@@ -1088,8 +1087,7 @@ static int vpfe_enum_input(struct file *file, void *priv,
&subdev, &subdev,
&index, &index,
inp->index) < 0) { inp->index) < 0) {
v4l2_err(&vpfe_dev->v4l2_dev, "input information not found" v4l2_err(&vpfe_dev->v4l2_dev, "input information not found for the subdev\n");
" for the subdev\n");
return -EINVAL; return -EINVAL;
} }
sdinfo = &vpfe_dev->cfg->sub_devs[subdev]; sdinfo = &vpfe_dev->cfg->sub_devs[subdev];
......
...@@ -1152,11 +1152,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, ...@@ -1152,11 +1152,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
timings->bt.vfrontporch && timings->bt.vfrontporch &&
(timings->bt.vbackporch || (timings->bt.vbackporch ||
timings->bt.vsync))) { timings->bt.vsync))) {
vpif_dbg(2, debug, "Timings for width, height, " vpif_dbg(2, debug, "Timings for width, height, horizontal back porch, horizontal sync, horizontal front porch, vertical back porch, vertical sync and vertical back porch must be defined\n");
"horizontal back porch, horizontal sync, "
"horizontal front porch, vertical back porch, "
"vertical sync and vertical back porch "
"must be defined\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1181,8 +1177,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, ...@@ -1181,8 +1177,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
std_info->l11 = std_info->vsize - std_info->l11 = std_info->vsize -
(bt->il_vfrontporch - 1); (bt->il_vfrontporch - 1);
} else { } else {
vpif_dbg(2, debug, "Required timing values for " vpif_dbg(2, debug, "Required timing values for interlaced BT format missing\n");
"interlaced BT format missing\n");
return -EINVAL; return -EINVAL;
} }
} else { } else {
......
...@@ -954,11 +954,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, ...@@ -954,11 +954,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
timings->bt.vfrontporch && timings->bt.vfrontporch &&
(timings->bt.vbackporch || (timings->bt.vbackporch ||
timings->bt.vsync))) { timings->bt.vsync))) {
vpif_dbg(2, debug, "Timings for width, height, " vpif_dbg(2, debug, "Timings for width, height, horizontal back porch, horizontal sync, horizontal front porch, vertical back porch, vertical sync and vertical back porch must be defined\n");
"horizontal back porch, horizontal sync, "
"horizontal front porch, vertical back porch, "
"vertical sync and vertical back porch "
"must be defined\n");
return -EINVAL; return -EINVAL;
} }
...@@ -983,8 +979,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, ...@@ -983,8 +979,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
std_info->l11 = std_info->vsize - std_info->l11 = std_info->vsize -
(bt->il_vfrontporch - 1); (bt->il_vfrontporch - 1);
} else { } else {
vpif_dbg(2, debug, "Required timing values for " vpif_dbg(2, debug, "Required timing values for interlaced BT format missing\n");
"interlaced BT format missing\n");
return -EINVAL; return -EINVAL;
} }
} else { } else {
......
...@@ -261,8 +261,8 @@ static int dm355_enable_clock(enum vpss_clock_sel clock_sel, int en) ...@@ -261,8 +261,8 @@ static int dm355_enable_clock(enum vpss_clock_sel clock_sel, int en)
shift = 6; shift = 6;
break; break;
default: default:
printk(KERN_ERR "dm355_enable_clock:" printk(KERN_ERR "dm355_enable_clock: Invalid selector: %d\n",
" Invalid selector: %d\n", clock_sel); clock_sel);
return -EINVAL; return -EINVAL;
} }
...@@ -421,8 +421,7 @@ static int vpss_probe(struct platform_device *pdev) ...@@ -421,8 +421,7 @@ static int vpss_probe(struct platform_device *pdev)
else if (!strcmp(platform_name, "dm644x_vpss")) else if (!strcmp(platform_name, "dm644x_vpss"))
oper_cfg.platform = DM644X; oper_cfg.platform = DM644X;
else { else {
dev_err(&pdev->dev, "vpss driver not supported on" dev_err(&pdev->dev, "vpss driver not supported on this platform\n");
" this platform\n");
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment