* [PATCH] staging: rtl8723bs: simplify NULL pointer checks @ 2026-05-02 11:20 msohail22 2026-05-03 9:25 ` Nikolay Kulikov 0 siblings, 1 reply; 5+ messages in thread From: msohail22 @ 2026-05-02 11:20 UTC (permalink / raw) To: gregkh; +Cc: linux-staging, linux-kernel, msohail22 Replace ptr == NULL with !ptr in rtw_recv.h and ioctl_cfg80211.c. Improves readability and follows kernel coding style. No functional changes. Signed-off-by: msohail22 <mohd.sohail.biz@gmail.com> --- drivers/staging/rtl8723bs/include/rtw_recv.h | 8 ++++---- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- 2 files changed, 5 insertions(+), 5 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; diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index fd3bae31b0ed..8ae3adecafd9 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -2429,7 +2429,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, spin_lock_bh(&pstapriv->asoc_list_lock); psta = rtw_sta_info_get_by_idx(idx, pstapriv); spin_unlock_bh(&pstapriv->asoc_list_lock); - if (psta == NULL) { + if (!psta) { ret = -ENOENT; goto exit; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: rtl8723bs: simplify NULL pointer checks 2026-05-02 11:20 [PATCH] staging: rtl8723bs: simplify NULL pointer checks msohail22 @ 2026-05-03 9:25 ` Nikolay Kulikov 2026-05-06 1:49 ` [PATCH v2] " Mohammed Sohail 2026-05-06 19:02 ` Mohammed Sohail 0 siblings, 2 replies; 5+ messages in thread From: Nikolay Kulikov @ 2026-05-03 9:25 UTC (permalink / raw) To: msohail22; +Cc: gregkh, linux-staging, linux-kernel On Sat, May 02, 2026 at 04:50:17PM +0530, msohail22 wrote: > Replace ptr == NULL with !ptr in rtw_recv.h and ioctl_cfg80211.c. > > Improves readability and follows kernel coding style. > No functional changes. > > Signed-off-by: msohail22 <mohd.sohail.biz@gmail.com> You should use your "real" name, like this: Signed-off-by: From Author <from@author.example.org> Thanks, Nikolay ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] staging: rtl8723bs: simplify NULL pointer checks 2026-05-03 9:25 ` Nikolay Kulikov @ 2026-05-06 1:49 ` Mohammed Sohail 2026-05-06 5:01 ` Greg KH 2026-05-06 19:02 ` Mohammed Sohail 1 sibling, 1 reply; 5+ messages in thread From: Mohammed Sohail @ 2026-05-06 1:49 UTC (permalink / raw) To: gregkh; +Cc: linux-staging, linux-kernel, nikolayof23, Mohammed Sohail Replace ptr == NULL with !ptr in rtw_recv.h and ioctl_cfg80211.c. Improves readability and follows kernel coding style. No functional changes. Signed-off-by: Mohammed Sohail <mohd.sohail.biz@gmail.com> --- drivers/staging/rtl8723bs/include/rtw_recv.h | 8 ++++---- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- 2 files changed, 5 insertions(+), 5 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; diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index fd3bae31b0ed..8ae3adecafd9 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -2429,7 +2429,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, spin_lock_bh(&pstapriv->asoc_list_lock); psta = rtw_sta_info_get_by_idx(idx, pstapriv); spin_unlock_bh(&pstapriv->asoc_list_lock); - if (psta == NULL) { + if (!psta) { ret = -ENOENT; goto exit; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] staging: rtl8723bs: simplify NULL pointer checks 2026-05-06 1:49 ` [PATCH v2] " Mohammed Sohail @ 2026-05-06 5:01 ` Greg KH 0 siblings, 0 replies; 5+ messages in thread From: Greg KH @ 2026-05-06 5:01 UTC (permalink / raw) To: Mohammed Sohail; +Cc: linux-staging, linux-kernel, nikolayof23 On Wed, May 06, 2026 at 07:19:59AM +0530, Mohammed Sohail wrote: > Replace ptr == NULL with !ptr in rtw_recv.h and ioctl_cfg80211.c. > > Improves readability and follows kernel coding style. > No functional changes. > > Signed-off-by: Mohammed Sohail <mohd.sohail.biz@gmail.com> > --- > drivers/staging/rtl8723bs/include/rtw_recv.h | 8 ++++---- > drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- > 2 files changed, 5 insertions(+), 5 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; > diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c > index fd3bae31b0ed..8ae3adecafd9 100644 > --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c > +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c > @@ -2429,7 +2429,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, > spin_lock_bh(&pstapriv->asoc_list_lock); > psta = rtw_sta_info_get_by_idx(idx, pstapriv); > spin_unlock_bh(&pstapriv->asoc_list_lock); > - if (psta == NULL) { > + if (!psta) { > ret = -ENOENT; > goto exit; > } > -- > 2.43.0 > > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] staging: rtl8723bs: simplify NULL pointer checks 2026-05-03 9:25 ` Nikolay Kulikov 2026-05-06 1:49 ` [PATCH v2] " Mohammed Sohail @ 2026-05-06 19:02 ` Mohammed Sohail 1 sibling, 0 replies; 5+ messages in thread From: Mohammed Sohail @ 2026-05-06 19:02 UTC (permalink / raw) To: gregkh; +Cc: linux-staging, linux-kernel, nikolayof23, Mohammed Sohail Replace ptr == NULL with !ptr in rtw_recv.h and ioctl_cfg80211.c. Improves readability and follows kernel coding style. No functional changes. Signed-off-by: Mohammed Sohail <mohd.sohail.biz@gmail.com> --- v2: - Use real name in Signed-off-by as requested by reviewer --- drivers/staging/rtl8723bs/include/rtw_recv.h | 8 ++++---- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- 2 files changed, 5 insertions(+), 5 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; diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index fd3bae31b0ed..8ae3adecafd9 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -2429,7 +2429,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy, spin_lock_bh(&pstapriv->asoc_list_lock); psta = rtw_sta_info_get_by_idx(idx, pstapriv); spin_unlock_bh(&pstapriv->asoc_list_lock); - if (psta == NULL) { + if (!psta) { ret = -ENOENT; goto exit; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-05-06 19:02 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-02 11:20 [PATCH] staging: rtl8723bs: simplify NULL pointer checks msohail22 2026-05-03 9:25 ` Nikolay Kulikov 2026-05-06 1:49 ` [PATCH v2] " Mohammed Sohail 2026-05-06 5:01 ` Greg KH 2026-05-06 19:02 ` Mohammed Sohail
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox