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>
This commit is contained in:
Zhansaya Bagdauletkyzy 2021-04-06 17:43:44 +06:00 коммит произвёл Greg Kroah-Hartman
Родитель a11fbe6bf1
Коммит b0a7b3aee5
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -135,7 +135,7 @@ int recv_func(struct _adapter *padapter, void *pcontext);
static inline u8 *get_rxmem(union recv_frame *precvframe) static inline u8 *get_rxmem(union recv_frame *precvframe)
{ {
/* always return rx_head... */ /* always return rx_head... */
if (precvframe == NULL) if (!precvframe)
return NULL; return NULL;
return precvframe->u.hdr.rx_head; 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) static inline u8 *get_recvframe_data(union recv_frame *precvframe)
{ {
/* always return rx_data */ /* always return rx_data */
if (precvframe == NULL) if (!precvframe)
return NULL; return NULL;
return precvframe->u.hdr.rx_data; 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 /* used for extract sz bytes from rx_data, update rx_data and return
* the updated rx_data to the caller * the updated rx_data to the caller
*/ */
if (precvframe == NULL) if (!precvframe)
return NULL; return NULL;
precvframe->u.hdr.rx_data += sz; precvframe->u.hdr.rx_data += sz;
if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) { 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 * return the updated rx_tail to the caller
* after putting, rx_tail must be still larger than rx_end. * after putting, rx_tail must be still larger than rx_end.
*/ */
if (precvframe == NULL) if (!precvframe)
return NULL; return NULL;
precvframe->u.hdr.rx_tail += sz; precvframe->u.hdr.rx_tail += sz;
if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) { 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 * updated rx_end to the caller
* after pulling, rx_end must be still larger than rx_data. * after pulling, rx_end must be still larger than rx_data.
*/ */
if (precvframe == NULL) if (!precvframe)
return NULL; return NULL;
precvframe->u.hdr.rx_tail -= sz; precvframe->u.hdr.rx_tail -= sz;
if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) { if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {