diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-18 22:44:10 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-21 14:34:16 +0300 |
commit | d26da99058869a5a655820ea43b86f246bf6874a (patch) | |
tree | d09506c8edefef64651faad8a5be35c642fd4a89 /drivers/media/platform/omap3isp/ispstat.c | |
parent | bc39030bb2d49cf197bf9714d71ea3fc4a970e60 (diff) | |
download | linux-d26da99058869a5a655820ea43b86f246bf6874a.tar.xz |
[media] omap3isp: 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/platform/omap3isp/ispstat.c')
-rw-r--r-- | drivers/media/platform/omap3isp/ispstat.c | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c index 1b9217d3b1b6..47cbc7e3d825 100644 --- a/drivers/media/platform/omap3isp/ispstat.c +++ b/drivers/media/platform/omap3isp/ispstat.c @@ -113,8 +113,9 @@ static int isp_stat_buf_check_magic(struct ispstat *stat, ret = 0; if (ret) { - dev_dbg(stat->isp->dev, "%s: beginning magic check does not " - "match.\n", stat->subdev.name); + dev_dbg(stat->isp->dev, + "%s: beginning magic check does not match.\n", + stat->subdev.name); return ret; } @@ -122,8 +123,9 @@ static int isp_stat_buf_check_magic(struct ispstat *stat, for (w = buf->virt_addr + buf_size, end = w + MAGIC_SIZE; w < end; w++) { if (unlikely(*w != MAGIC_NUM)) { - dev_dbg(stat->isp->dev, "%s: ending magic check does " - "not match.\n", stat->subdev.name); + dev_dbg(stat->isp->dev, + "%s: ending magic check does not match.\n", + stat->subdev.name); return -EINVAL; } } @@ -256,9 +258,9 @@ static void isp_stat_buf_next(struct ispstat *stat) { if (unlikely(stat->active_buf)) /* Overwriting unused active buffer */ - dev_dbg(stat->isp->dev, "%s: new buffer requested without " - "queuing active one.\n", - stat->subdev.name); + dev_dbg(stat->isp->dev, + "%s: new buffer requested without queuing active one.\n", + stat->subdev.name); else stat->active_buf = isp_stat_buf_find_oldest_or_empty(stat); } @@ -292,8 +294,9 @@ static struct ispstat_buffer *isp_stat_buf_get(struct ispstat *stat, return ERR_PTR(-EBUSY); } if (isp_stat_buf_check_magic(stat, buf)) { - dev_dbg(stat->isp->dev, "%s: current buffer has " - "corrupted data\n.", stat->subdev.name); + dev_dbg(stat->isp->dev, + "%s: current buffer has corrupted data\n.", + stat->subdev.name); /* Mark empty because it doesn't have valid data. */ buf->empty = 1; } else { @@ -307,8 +310,9 @@ static struct ispstat_buffer *isp_stat_buf_get(struct ispstat *stat, spin_unlock_irqrestore(&stat->isp->stat_lock, flags); if (buf->buf_size > data->buf_size) { - dev_warn(stat->isp->dev, "%s: userspace's buffer size is " - "not enough.\n", stat->subdev.name); + dev_warn(stat->isp->dev, + "%s: userspace's buffer size is not enough.\n", + stat->subdev.name); isp_stat_buf_release(stat); return ERR_PTR(-EINVAL); } @@ -531,20 +535,22 @@ int omap3isp_stat_config(struct ispstat *stat, void *new_conf) mutex_lock(&stat->ioctl_lock); - dev_dbg(stat->isp->dev, "%s: configuring module with buffer " - "size=0x%08lx\n", stat->subdev.name, (unsigned long)buf_size); + dev_dbg(stat->isp->dev, + "%s: configuring module with buffer size=0x%08lx\n", + stat->subdev.name, (unsigned long)buf_size); ret = stat->ops->validate_params(stat, new_conf); if (ret) { mutex_unlock(&stat->ioctl_lock); - dev_dbg(stat->isp->dev, "%s: configuration values are " - "invalid.\n", stat->subdev.name); + dev_dbg(stat->isp->dev, "%s: configuration values are invalid.\n", + stat->subdev.name); return ret; } if (buf_size != user_cfg->buf_size) - dev_dbg(stat->isp->dev, "%s: driver has corrected buffer size " - "request to 0x%08lx\n", stat->subdev.name, + dev_dbg(stat->isp->dev, + "%s: driver has corrected buffer size request to 0x%08lx\n", + stat->subdev.name, (unsigned long)user_cfg->buf_size); /* @@ -595,8 +601,9 @@ int omap3isp_stat_config(struct ispstat *stat, void *new_conf) /* Module has a valid configuration. */ stat->configured = 1; - dev_dbg(stat->isp->dev, "%s: module has been successfully " - "configured.\n", stat->subdev.name); + dev_dbg(stat->isp->dev, + "%s: module has been successfully configured.\n", + stat->subdev.name); mutex_unlock(&stat->ioctl_lock); @@ -762,8 +769,8 @@ int omap3isp_stat_enable(struct ispstat *stat, u8 enable) if (!stat->configured && enable) { spin_unlock_irqrestore(&stat->isp->stat_lock, irqflags); mutex_unlock(&stat->ioctl_lock); - dev_dbg(stat->isp->dev, "%s: cannot enable module as it's " - "never been successfully configured so far.\n", + dev_dbg(stat->isp->dev, + "%s: cannot enable module as it's never been successfully configured so far.\n", stat->subdev.name); return -EINVAL; } @@ -859,8 +866,8 @@ static void __stat_isr(struct ispstat *stat, int from_dma) if (stat->state == ISPSTAT_ENABLED) { spin_unlock_irqrestore(&stat->isp->stat_lock, irqflags); dev_err(stat->isp->dev, - "%s: interrupt occurred when module was still " - "processing a buffer.\n", stat->subdev.name); + "%s: interrupt occurred when module was still processing a buffer.\n", + stat->subdev.name); ret = STAT_NO_BUF; goto out; } else { @@ -964,8 +971,9 @@ static void __stat_isr(struct ispstat *stat, int from_dma) atomic_set(&stat->buf_err, 1); ret = STAT_NO_BUF; - dev_dbg(stat->isp->dev, "%s: cannot process buffer, " - "device is busy.\n", stat->subdev.name); + dev_dbg(stat->isp->dev, + "%s: cannot process buffer, device is busy.\n", + stat->subdev.name); } out: |