lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <878rrodw4l.fsf@kernel.org>
Date:   Fri, 29 Apr 2022 13:25:30 +0300
From:   Kalle Valo <kvalo@...nel.org>
To:     Srinivasan Raju <srini.raju@...elifi.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        "edumazet\@google.com" <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        "pabeni\@redhat.com" <pabeni@...hat.com>,
        "open list\:NETWORKING DRIVERS \(WIRELESS\)" 
        <linux-wireless@...r.kernel.org>,
        "open list\:NETWORKING DRIVERS" <netdev@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Fix le16_to_cpu warning for beacon_interval

Srinivasan Raju <srini.raju@...elifi.com> writes:

> Fixed the following warning
> drivers/net/wireless/purelifi/plfxlc/chip.c:36:31: sparse: expected unsigned short [usertype] beacon_interval
> drivers/net/wireless/purelifi/plfxlc/chip.c:36:31: sparse: got restricted __le16 [usertype]

The preferred style is this:

Fix the following sparse warnings:

drivers/net/wireless/purelifi/plfxlc/chip.c:36:31: sparse: expected unsigned short [usertype] beacon_interval
drivers/net/wireless/purelifi/plfxlc/chip.c:36:31: sparse: got restricted __le16 [usertype]

> Reported-by: kernel test robot <lkp@...el.com>
> Signed-off-by: Srinivasan Raju <srini.raju@...elifi.com>
> ---
>  drivers/net/wireless/purelifi/plfxlc/chip.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

The subject should be:

[PATCH] plfxlc: fix le16_to_cpu warning for beacon_interval

> diff --git a/drivers/net/wireless/purelifi/plfxlc/chip.c b/drivers/net/wireless/purelifi/plfxlc/chip.c
> index a5ec10b66ed5..5d952ca07195 100644
> --- a/drivers/net/wireless/purelifi/plfxlc/chip.c
> +++ b/drivers/net/wireless/purelifi/plfxlc/chip.c
> @@ -30,10 +30,10 @@ int plfxlc_set_beacon_interval(struct plfxlc_chip *chip, u16 interval,
>  {
>         if (!interval ||
>             (chip->beacon_set && 
> -            le16_to_cpu(chip->beacon_interval) == interval))
> +            chip->beacon_interval) == interval)
>                 return 0;

I think there's no need to use three lines anymore, two lines should be
enough:

       if (!interval ||
           (chip->beacon_set && chip->beacon_interval == interval))

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ