The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: simplify NULL pointer checks in rtw_recv.h
@ 2026-06-03  9:14 Jeeva Anandh
  2026-07-07 11:16 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jeeva Anandh @ 2026-06-03  9:14 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Jeeva Anandh

Replace explicit NULL pointer comparisons with idiomatic
pointer checks to improve readability and follow kernel style.

Signed-off-by: Jeeva Anandh <anandhjeeva215@gmail.com>
---
 drivers/staging/rtl8723bs/include/rtw_recv.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/rtw_recv.h b/drivers/staging/rtl8723bs/include/rtw_recv.h
index 8e45871f07f0..9c32d480a20a 100644
--- a/drivers/staging/rtl8723bs/include/rtw_recv.h
+++ b/drivers/staging/rtl8723bs/include/rtw_recv.h
@@ -349,7 +349,7 @@ s32  rtw_recv_entry(union recv_frame *precv_frame);
 static inline u8 *get_rxmem(union recv_frame *precvframe)
 {
 	/* always return rx_head... */
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 	return precvframe->u.hdr.rx_head;
@@ -362,7 +362,7 @@ static inline u8 *recvframe_pull(union recv_frame *precvframe, signed int sz)
 	/* used for extract sz bytes from rx_data, update rx_data and return the updated rx_data to the caller */
 
 
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 
@@ -387,7 +387,7 @@ static inline u8 *recvframe_put(union recv_frame *precvframe, signed int sz)
 	/* after putting, rx_tail must be still larger than rx_end. */
 	unsigned char *prev_rx_tail;
 
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 	prev_rx_tail = precvframe->u.hdr.rx_tail;
@@ -414,7 +414,7 @@ static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, signed int s
 	/* used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller */
 	/* after pulling, rx_end must be still larger than rx_data. */
 
-	if (precvframe == NULL)
+	if (!precvframe)
 		return NULL;
 
 	precvframe->u.hdr.rx_tail -= sz;
-- 
2.43.0


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

* Re: [PATCH] staging: rtl8723bs: simplify NULL pointer checks in rtw_recv.h
  2026-06-03  9:14 [PATCH] staging: rtl8723bs: simplify NULL pointer checks in rtw_recv.h Jeeva Anandh
@ 2026-07-07 11:16 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-07-07 11:16 UTC (permalink / raw)
  To: Jeeva Anandh; +Cc: linux-staging, linux-kernel

On Wed, Jun 03, 2026 at 09:14:11AM +0000, Jeeva Anandh wrote:
> Replace explicit NULL pointer comparisons with idiomatic
> pointer checks to improve readability and follow kernel style.
> 
> Signed-off-by: Jeeva Anandh <anandhjeeva215@gmail.com>
> ---
>  drivers/staging/rtl8723bs/include/rtw_recv.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/include/rtw_recv.h b/drivers/staging/rtl8723bs/include/rtw_recv.h
> index 8e45871f07f0..9c32d480a20a 100644
> --- a/drivers/staging/rtl8723bs/include/rtw_recv.h
> +++ b/drivers/staging/rtl8723bs/include/rtw_recv.h
> @@ -349,7 +349,7 @@ s32  rtw_recv_entry(union recv_frame *precv_frame);
>  static inline u8 *get_rxmem(union recv_frame *precvframe)
>  {
>  	/* always return rx_head... */
> -	if (precvframe == NULL)
> +	if (!precvframe)
>  		return NULL;
>  
>  	return precvframe->u.hdr.rx_head;
> @@ -362,7 +362,7 @@ static inline u8 *recvframe_pull(union recv_frame *precvframe, signed int sz)
>  	/* used for extract sz bytes from rx_data, update rx_data and return the updated rx_data to the caller */
>  
>  
> -	if (precvframe == NULL)
> +	if (!precvframe)
>  		return NULL;
>  
>  
> @@ -387,7 +387,7 @@ static inline u8 *recvframe_put(union recv_frame *precvframe, signed int sz)
>  	/* after putting, rx_tail must be still larger than rx_end. */
>  	unsigned char *prev_rx_tail;
>  
> -	if (precvframe == NULL)
> +	if (!precvframe)
>  		return NULL;
>  
>  	prev_rx_tail = precvframe->u.hdr.rx_tail;
> @@ -414,7 +414,7 @@ static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, signed int s
>  	/* used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller */
>  	/* after pulling, rx_end must be still larger than rx_data. */
>  
> -	if (precvframe == NULL)
> +	if (!precvframe)
>  		return NULL;
>  
>  	precvframe->u.hdr.rx_tail -= sz;
> -- 
> 2.43.0
> 
> 

Does not apply to the tree :(

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

end of thread, other threads:[~2026-07-07 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03  9:14 [PATCH] staging: rtl8723bs: simplify NULL pointer checks in rtw_recv.h Jeeva Anandh
2026-07-07 11:16 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox