Skip to contentSkip to conversation

staging: dgnc: clean up the dgnc_get_modem_info()

PATCH Superseded Daeseok Youn 1 participant 1 message May 4, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 staging: dgnc: clean up the dgnc_get_modem_info()

the "ch" in dgnc_get_modem_info() was already checked before calling this function and also if "ch" is not NULL, dgnc_get_mstat() returns valid value so it doesn't need to check an error.

---
 drivers/staging/dgnc/dgnc_tty.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/staging/dgnc/dgnc_tty.c +1 -11
index 46ca01d..f67d7d4 100644
@@ -2013,17 +2013,7 @@ static inline int dgnc_get_mstat(struct channel_t *ch)
 static int dgnc_get_modem_info(struct channel_t *ch,
 			       unsigned int  __user *value)
 {
-	int result;
-
-	if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
-		return -ENXIO;
-
-	result = dgnc_get_mstat(ch);
-
-	if (result < 0)
-		return -ENXIO;
-
-	return put_user(result, value);
+	return put_user(dgnc_get_mstat(ch), value);
 }
 
 /*
Signature · 1 line
2.8.2