Browse Source

[media] drxk: Remove the CHK_ERROR macro

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: Mauro Carvalho Chehab <mchehab@redhat.com>
Mauro Carvalho Chehab 14 years ago
parent
commit
ea90f011fd
2 changed files with 442 additions and 270 deletions
  1. 440 268
      drivers/media/dvb/frontends/drxk_hard.c
  2. 2 2
      drivers/media/dvb/frontends/tda18271c2dd.c

File diff suppressed because it is too large
+ 440 - 268
drivers/media/dvb/frontends/drxk_hard.c


+ 2 - 2
drivers/media/dvb/frontends/tda18271c2dd.c

@@ -817,7 +817,7 @@ static int ChannelConfiguration(struct tda_state *state,
 	u8 BP_Filter = 0;
 	u8 RF_Band = 0;
 	u8 GainTaper = 0;
-	u8 IR_Meas;
+	u8 IR_Meas = 0;
 
 	state->IF = IntermediateFrequency;
 	/* printk("%s Freq = %d Standard = %d IF = %d\n", __func__, Frequency, Standard, IntermediateFrequency); */
@@ -884,7 +884,7 @@ static int ChannelConfiguration(struct tda_state *state,
 			state->m_Regs[EB4] &= ~0x20;   /* LO_forceSrce = 0 */
 			CHK_ERROR(UpdateReg(state, EB4));
 		} else {
-			u8 PostDiv;
+			u8 PostDiv = 0;
 			u8 Div;
 			CHK_ERROR(CalcCalPLL(state, Frequency + IntermediateFrequency));
 

Some files were not shown because too many files changed in this diff