[PATCH 3/5] staging: vt6656: channel.c: Rewrite ChannelValid function

From: Marcos Paulo de Souza
Date: Thu Dec 01 2011 - 21:03:02 EST


This patch simplifies the code of ChannelValid fucntion.

Signed-off-by: Marcos Paulo de Souza <marcos.mage@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxx>
Cc: Forest Bond <forest@xxxxxxxxxxxxxxxxxxx>
Cc: devel@xxxxxxxxxxxxxxxxxxxx
---
drivers/staging/vt6656/channel.c | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/vt6656/channel.c b/drivers/staging/vt6656/channel.c
index 99e054d..954aee7 100644
--- a/drivers/staging/vt6656/channel.c
+++ b/drivers/staging/vt6656/channel.c
@@ -392,25 +392,16 @@ static struct
BOOL
ChannelValid(unsigned int CountryCode, unsigned int ChannelIndex)
{
- BOOL bValid;
+ /*
+ * If Channel Index is invalid, return invalid
+ */
+ if ((ChannelIndex > CB_MAX_CHANNEL) ||
+ (ChannelIndex == 0))
+ return FALSE;

- bValid = FALSE;
- /*
- * If Channel Index is invalid, return invalid
- */
- if ((ChannelIndex > CB_MAX_CHANNEL) ||
- (ChannelIndex == 0))
- {
- bValid = FALSE;
- goto exit;
- }
-
- bValid = sChannelTbl[ChannelIndex].bValid;
+ return sChannelTbl[ChannelIndex].bValid;

-exit:
- return (bValid);
-
-} /* end ChannelValid */
+}

/************************************************************************
* CHvChannelGetList
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/