• Mauro Carvalho Chehab's avatar
    [media] tda18271c2dd: Remove the CHK_ERROR macro · 469ffe08
    Mauro Carvalho Chehab authored
    The CHK_ERROR macro does a flow control, violating chapter 12
    of the Documentation/CodingStyle. Doing flow controls inside
    macros is a bad idea, as it hides what's happening. It also
    hides the var "status" with is also a bad idea.
    
    The changes were done by this small perl script:
    	my $blk=0;
    	while (<>) {
    		s/^\s+// if ($blk);
    		$f =~ s/\s+$// if ($blk && /^\(/);
    		$blk = 1 if (!m/\#/ && m/CHK_ERROR/);
    		$blk=0 if ($blk && m/\;/);
    		s/\n/ / if ($blk);
    		$f.=$_;
    	};
    	$f=~ s,\n(\t+)CHK_ERROR\((.*)\)\;([^\n]*),\n\1status = \2;\3\n\1if (status < 0)\n\1\tbreak;,g;
    
    	print $f;
    
    And manually fixed.
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    469ffe08
tda18271c2dd.c 28.6 KB