Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8712: Rewrite NULL comparisons

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>

authored by

Zhansaya Bagdauletkyzy and committed by
Greg Kroah-Hartman
b0a7b3ae a11fbe6b

+5 -5
+5 -5
drivers/staging/rtl8712/rtl871x_recv.h
··· 135 135 static inline u8 *get_rxmem(union recv_frame *precvframe) 136 136 { 137 137 /* always return rx_head... */ 138 - if (precvframe == NULL) 138 + if (!precvframe) 139 139 return NULL; 140 140 return precvframe->u.hdr.rx_head; 141 141 } ··· 143 143 static inline u8 *get_recvframe_data(union recv_frame *precvframe) 144 144 { 145 145 /* always return rx_data */ 146 - if (precvframe == NULL) 146 + if (!precvframe) 147 147 return NULL; 148 148 return precvframe->u.hdr.rx_data; 149 149 } ··· 153 153 /* used for extract sz bytes from rx_data, update rx_data and return 154 154 * the updated rx_data to the caller 155 155 */ 156 - if (precvframe == NULL) 156 + if (!precvframe) 157 157 return NULL; 158 158 precvframe->u.hdr.rx_data += sz; 159 159 if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) { ··· 170 170 * return the updated rx_tail to the caller 171 171 * after putting, rx_tail must be still larger than rx_end. 172 172 */ 173 - if (precvframe == NULL) 173 + if (!precvframe) 174 174 return NULL; 175 175 precvframe->u.hdr.rx_tail += sz; 176 176 if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) { ··· 188 188 * updated rx_end to the caller 189 189 * after pulling, rx_end must be still larger than rx_data. 190 190 */ 191 - if (precvframe == NULL) 191 + if (!precvframe) 192 192 return NULL; 193 193 precvframe->u.hdr.rx_tail -= sz; 194 194 if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {