From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Yogesh Hegde <yogi.kernel@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8192e: Fix comparison to NULL of variable rf_set_sens
Date: Sun, 9 Apr 2023 17:12:45 +0200 [thread overview]
Message-ID: <004210bd-0ed1-58d5-0315-47499c850444@gmail.com> (raw)
In-Reply-To: <ZDK5UvVHa96ejEfU@Zephyrus-G14>
On 4/9/23 15:10, Yogesh Hegde wrote:
> Fix comparision to NULL of variable rf_set_sens as per Linux kernel
> coding-style. These issues were reported by checkpatch.pl.
>
> CHECK: Comparison to NULL could be written "priv->rf_set_sens"
> CHECK: Comparison to NULL could be written "!priv->rf_set_sens"
>
> Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
> ---
> drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> index cb28288a618b..a67edb81a820 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
> @@ -311,7 +311,7 @@ static int _rtl92e_wx_get_range(struct net_device *dev,
> /* ~130 Mb/s real (802.11n) */
> range->throughput = 130 * 1000 * 1000;
>
> - if (priv->rf_set_sens != NULL)
> + if (priv->rf_set_sens)
> /* signal level threshold range */
> range->sensitivity = priv->max_sens;
>
> @@ -813,7 +813,7 @@ static int _rtl92e_wx_get_sens(struct net_device *dev,
> {
> struct r8192_priv *priv = rtllib_priv(dev);
>
> - if (priv->rf_set_sens == NULL)
> + if (!priv->rf_set_sens)
> return -1; /* we have not this support for this radio */
> wrqu->sens.value = priv->sens;
> return 0;
> @@ -831,7 +831,7 @@ static int _rtl92e_wx_set_sens(struct net_device *dev,
> return 0;
>
> mutex_lock(&priv->wx_mutex);
> - if (priv->rf_set_sens == NULL) {
> + if (!priv->rf_set_sens) {
> err = -1; /* we have not this support for this radio */
> goto exit;
> }
I would like you to do more.
I you search for rf_set_sens you will see that it is declared as a function.
But there is no definition of the function which will cause an oops when
this function is called.
Because there is no definition of the function the priv->rf_set_sens
will result always NULL
Bye Philipp
prev parent reply other threads:[~2023-04-09 15:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-09 13:10 [PATCH] staging: rtl8192e: Fix comparison to NULL of variable rf_set_sens Yogesh Hegde
2023-04-09 15:12 ` Philipp Hortmann [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=004210bd-0ed1-58d5-0315-47499c850444@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=yogi.kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.