From: Dan Carpenter <dan.carpenter@linaro.org>
To: Aleksandr Mishin <amishin@t-argos.ru>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Zhang Shurong <zhang_shurong@foxmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH] staging: ks7010: Remove unneeded check in ks_wlan_get_range()
Date: Fri, 5 Jul 2024 23:15:54 +0200 [thread overview]
Message-ID: <dd8d077d-4e04-490b-bf2c-dbeba8010db0@suswa.mountain> (raw)
In-Reply-To: <20240705204434.10541-1-amishin@t-argos.ru>
On Fri, Jul 05, 2024 at 11:44:34PM +0300, Aleksandr Mishin wrote:
> In ks_wlan_get_range() variable 'i' which value is always 12, is compared
> to 2. This check is unneeded and should be removed.
>
> Remove unneeded check to clean up the code.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository")
> Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
> ---
> drivers/staging/ks7010/ks_wlan_net.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
> index 0fb97a79ad0b..d56dae73e7ed 100644
> --- a/drivers/staging/ks7010/ks_wlan_net.c
> +++ b/drivers/staging/ks7010/ks_wlan_net.c
> @@ -972,10 +972,7 @@ static int ks_wlan_get_range(struct net_device *dev,
> * in bit/s that we can expect using this interface.
> * May be use for QoS stuff... Jean II
> */
> - if (i > 2)
> - range->throughput = 5000 * 1000;
> - else
> - range->throughput = 1500 * 1000;
> + range->throughput = 5000 * 1000;
>
This is part of a custom IOCTL. According to the comment, we're
providing the 5 million as information to the user which I guess they
might use for QoS stuff... It's kind of pointless.
Anway, the patch doesn't make anything worse.
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
KTODO: delete custom ioctls in ks7010. (requires careful audit or testing)
regards,
dan carpenter
next prev parent reply other threads:[~2024-07-05 21:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 20:44 [PATCH] staging: ks7010: Remove unneeded check in ks_wlan_get_range() Aleksandr Mishin
2024-07-05 21:15 ` Dan Carpenter [this message]
2024-07-06 14:16 ` Wolfram Sang
2024-07-06 14:23 ` Philipp Hortmann
2024-07-06 14:34 ` Wolfram Sang
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=dd8d077d-4e04-490b-bf2c-dbeba8010db0@suswa.mountain \
--to=dan.carpenter@linaro.org \
--cc=amishin@t-argos.ru \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=lvc-project@linuxtesting.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=zhang_shurong@foxmail.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