]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8723bs: simplify NULL pointer comparisons in rtw_recv.h
authorAbhai Kollara <abhai@protonmail.com>
Thu, 30 Apr 2026 20:12:06 +0000 (20:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 May 2026 14:49:14 +0000 (16:49 +0200)
Fix checkpatch.pl warnings regarding explicit comparisons to NULL.
The kernel coding style prefers the shorter if (!ptr) idiom over
if (ptr == NULL). Clean up the inline functions in rtw_recv.h to
match this standard.

Signed-off-by: Abhai Kollara <abhai@protonmail.com>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260430201158.2807823-1-abhai@protonmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/include/rtw_recv.h

index 8e45871f07f088e124c16417333038d103d59227..9c32d480a20a1cc35bbb0c40b69a4f44b26b8642 100644 (file)
@@ -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;