staging: rtl8712: Rewrite NULL comparisons
authorZhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Tue, 6 Apr 2021 11:43:44 +0000 (17:43 +0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Apr 2021 12:16:20 +0000 (14:16 +0200)
Replace NULL comparisons with boolean negation to be more consistent with
the rest of the Linux kernel code base.
Reported by checkpatch.

Signed-off-by: Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Link: https://lore.kernel.org/r/74471865b399584d73a18696d2008006301dfd71.1617708653.git.zhansayabagdaulet@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_recv.h

index 7c9995060a6f6f6968cf61277fcbca9a91f919ce..4aa39f4f3b84eb9e08957a0f6cd35f9a0b5bab0d 100644 (file)
@@ -135,7 +135,7 @@ int recv_func(struct _adapter *padapter, void *pcontext);
 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;
 }
@@ -143,7 +143,7 @@ static inline u8 *get_rxmem(union recv_frame *precvframe)
 static inline u8 *get_recvframe_data(union recv_frame *precvframe)
 {
        /* always return rx_data */
-       if (precvframe == NULL)
+       if (!precvframe)
                return NULL;
        return precvframe->u.hdr.rx_data;
 }
@@ -153,7 +153,7 @@ static inline u8 *recvframe_pull(union recv_frame *precvframe, sint 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;
        precvframe->u.hdr.rx_data += sz;
        if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) {
@@ -170,7 +170,7 @@ static inline u8 *recvframe_put(union recv_frame *precvframe, sint sz)
         * return the updated rx_tail to the caller
         * after putting, rx_tail must be still larger than rx_end.
         */
-       if (precvframe == NULL)
+       if (!precvframe)
                return NULL;
        precvframe->u.hdr.rx_tail += sz;
        if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) {
@@ -188,7 +188,7 @@ static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
         * 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;
        if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {