]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
[media] drxd: Don't use a macro for CHK_ERROR with a break inside
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 25 Mar 2011 14:45:29 +0000 (11:45 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 20 May 2011 10:26:26 +0000 (07:26 -0300)
commit58d5eaec9f877a9bcfa9b6dca0ea51850975c49f
tree6c061a242bd99df311ee36a19d1cec10e073d316
parent7fc7356f4eafa953197e1c4e2d236e199a51db28
[media] drxd: Don't use a macro for CHK_ERROR with a break inside

The macro is defined as:
#define CHK_ERROR(s) if( (status = s)<0 ) break

This sucks, as makes harder to debug if something got wrong and
there are more than one level of loops. Also, violates CodingStyle.

Fixed by this simple perl script:

while (<>) { $f.=$_; };

$f=~ s,\n\#define CHK_ERROR[^\n]+\n,\n,;

$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
$f=~ s=(CHK_ERROR\(.*\,)\n\s+=\1 =g;
$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;
$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;
$f=~ s=(CHK_ERROR\(.*)\s+(\,)\n\s+=\1\2 =g;

$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;,\n\1status = \2;\n\1if (status < 0)\n\1\tbreak;,g;

print $f;

Plus a few manual adjustments

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/drxd_hard.c