Skip to contentSkip to conversation

staging: rtl8723bs: remove redundant ternary operators from return

PATCH Superseded Ashmit Kumar 2 participants 2 messages Aug 3 – Aug 4 Staging

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging: rtl8723bs: remove redundant ternary operators from return

The Linux kernel coding style specifies that boolean expressions do not need a redundant ? true : false ternary operator. Additionally, return is not a function and therefore parentheses are not required.

---
 drivers/staging/rtl8723bs/os_dep/osdep_service.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/osdep_service.c +2 -2
index 4cfdf7c6234..214c1fd9b3e 100644
@@ -130,7 +130,7 @@ void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len)
  */
 inline bool rtw_cbuf_full(struct rtw_cbuf *cbuf)
 {
-	return (cbuf->write == cbuf->read - 1) ? true : false;
+	return cbuf->write == cbuf->read - 1;
 }
 
 /**
@@ -141,7 +141,7 @@ inline bool rtw_cbuf_full(struct rtw_cbuf *cbuf)
  */
 inline bool rtw_cbuf_empty(struct rtw_cbuf *cbuf)
 {
-	return (cbuf->write == cbuf->read) ? true : false;
+	return cbuf->write == cbuf->read;
 }
 
 /**
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 4 lines · Ashmit Kumar

The Linux kernel coding style specifies that boolean expressions do not need a redundant ? true : false ternary operator. Additionally, return is not a function and therefore parentheses are not required.

Why is this mixed with the media patches? And they didn't seem to be threaded, how was this sent?

And it's a resend?

thanks,

greg k-h