Skip to contentSkip to conversation

staging: rtl8712: Simplify return

PATCH In review Bhaktipriya Shridhar 2 participants 2 messages Feb 22, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8712: Simplify return

Simplified the multiline check to a single return statement.

---
Changes in v2:
- Removed if-else and replaced it with a single return statement

 drivers/staging/rtl8712/xmit_linux.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/rtl8712/xmit_linux.c +1 -4
index f8866d7..f708d95 100644
@@ -70,10 +70,7 @@ uint _r8712_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
 
 sint r8712_endofpktfile(struct pkt_file *pfile)
 {
-	if (pfile->pkt_len == 0)
-		return true;
-	else
-		return false;
+	return (pfile->pkt_len == 0);
 }
 
 

--
2.1.4

Acked-by on v2 1/1
#1 lore raw
Quoted 3 lines · Bhaktipriya Shridhar

Simplified the multiline check to a single return statement.

Quoted 31 lines

---
Changes in v2:
- Removed if-else and replaced it with a single return statement

 drivers/staging/rtl8712/xmit_linux.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/rtl8712/xmit_linux.c +1 -5
index f8866d7..f708d95 100644
@@ -70,10 +70,7 @@ uint _r8712_pktfile_read(struct pkt_file *pfile, u8 *rmem, uint rlen)
 
 sint r8712_endofpktfile(struct pkt_file *pfile)
 {
-       if (pfile->pkt_len == 0)
-               return true;
-       else
-               return false;
+       return (pfile->pkt_len == 0);
 }
 
 
--

2.1.4

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160222132944.GA18018%40Karyakshetra.
For more options, visit https://groups.google.com/d/optout.