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

[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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b01fbc10
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -817,7 +817,7 @@ static int ChannelConfiguration(struct tda_state *state, ...@@ -817,7 +817,7 @@ static int ChannelConfiguration(struct tda_state *state,
u8 BP_Filter = 0; u8 BP_Filter = 0;
u8 RF_Band = 0; u8 RF_Band = 0;
u8 GainTaper = 0; u8 GainTaper = 0;
u8 IR_Meas; u8 IR_Meas = 0;
state->IF = IntermediateFrequency; state->IF = IntermediateFrequency;
/* printk("%s Freq = %d Standard = %d IF = %d\n", __func__, Frequency, Standard, 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, ...@@ -884,7 +884,7 @@ static int ChannelConfiguration(struct tda_state *state,
state->m_Regs[EB4] &= ~0x20; /* LO_forceSrce = 0 */ state->m_Regs[EB4] &= ~0x20; /* LO_forceSrce = 0 */
CHK_ERROR(UpdateReg(state, EB4)); CHK_ERROR(UpdateReg(state, EB4));
} else { } else {
u8 PostDiv; u8 PostDiv = 0;
u8 Div; u8 Div;
CHK_ERROR(CalcCalPLL(state, Frequency + IntermediateFrequency)); CHK_ERROR(CalcCalPLL(state, Frequency + IntermediateFrequency));
......
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