[PATCH] staging: dgap: Simplify get_altpin and get_useintr functions

Mark Hounschell markh at compro.net
Fri May 23 17:45:57 UTC 2014


Simplify dgap_config_get_useintr and dgap_config_get_altpin
changing the case statement to an if statement.

Signed-off-by: Mark Hounschell <markh at compro.net>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Tested-by: Mark Hounschell <markh at compro.net>
---
 drivers/staging/dgap/dgap.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index f811cbf..a89606e 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7310,14 +7310,11 @@ static uint dgap_config_get_useintr(struct board_t *bd)
 		return 0;
 
 	for (p = bd->bd_config; p; p = p->next) {
-		switch (p->type) {
-		case INTRNODE:
+		if (p->type == INTRNODE) {
 			/*
 			 * check for pcxr types.
 			 */
 			return p->u.useintr;
-		default:
-			break;
 		}
 	}
 
@@ -7336,14 +7333,11 @@ static uint dgap_config_get_altpin(struct board_t *bd)
 		return 0;
 
 	for (p = bd->bd_config; p; p = p->next) {
-		switch (p->type) {
-		case ANODE:
+		if (p->type == ANODE) {
 			/*
 			 * check for pcxr types.
 			 */
 			return p->u.altpin;
-		default:
-			break;
 		}
 	}
 
-- 
1.8.4.5



More information about the devel mailing list