DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] staging: rtl8723bs: hal: Compress return logic
@ 2020-03-25 21:43 Simran Singhal
  2020-03-26 18:27 ` [Outreachy kernel] " Lakshmi Ramasubramanian
  0 siblings, 1 reply; 2+ messages in thread
From: Simran Singhal @ 2020-03-25 21:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman, devel, linux-kernel, outreachy-kernel

Simplify function returns by merging assignment and return into
one command line.
Found with Coccinelle

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Simran Singhal <singhalsimran0@gmail.com>
---
 drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
index eb7de3617d83..767e2a784f78 100644
--- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
@@ -1498,9 +1498,7 @@ s8 PHY_GetTxPowerByRate(
 		return value;
 	}
 
-	value = pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex];
-
-	return value;
+	return pHalData->TxPwrByRateOffset[Band][RFPath][TxNum][rateIndex];
 
 }
 
-- 
2.17.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: hal: Compress return logic
  2020-03-25 21:43 [PATCH] staging: rtl8723bs: hal: Compress return logic Simran Singhal
@ 2020-03-26 18:27 ` " Lakshmi Ramasubramanian
  0 siblings, 0 replies; 2+ messages in thread
From: Lakshmi Ramasubramanian @ 2020-03-26 18:27 UTC (permalink / raw)
  To: Simran Singhal, Greg Kroah-Hartman, devel, linux-kernel,
	outreachy-kernel

On 3/25/20 2:43 PM, Simran Singhal wrote:

> Simplify function returns by merging assignment and return into
> one command line.

"Simplify function returns by merging assignment and return into one line".

You could change the subject also to "Simplify function return logic".

thanks,
  -lakshmi
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 21:43 [PATCH] staging: rtl8723bs: hal: Compress return logic Simran Singhal
2020-03-26 18:27 ` [Outreachy kernel] " Lakshmi Ramasubramanian

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git