From: Luka Gejak <luka.gejak@linux.dev>
To: abhai@protonmail.com
Cc: gregkh@linuxfoundation.org, hansg@kernel.org,
linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
straube.linux@gmail.com, luka.gejak@linux.dev
Subject: Re: [PATCH] staging: rtl8723bs: simplify NULL pointer comparisons in rtw_recv.h
Date: Thu, 30 Apr 2026 22:27:26 +0200 [thread overview]
Message-ID: <E34BC08B-D9F1-444A-8D67-692B44819B29@linux.dev> (raw)
In-Reply-To: <20260430201158.2807823-1-abhai@protonmail.com>
> 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>
> ---
> 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
>
LGTM,
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Best regards,
Luka Gejak
prev parent reply other threads:[~2026-04-30 20:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 20:12 [PATCH] staging: rtl8723bs: simplify NULL pointer comparisons in rtw_recv.h Abhai Kollara
2026-04-30 20:27 ` Luka Gejak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E34BC08B-D9F1-444A-8D67-692B44819B29@linux.dev \
--to=luka.gejak@linux.dev \
--cc=abhai@protonmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox