From: Janusz Lisiecki <janusz.lisiecki@gmail.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux Driver Project Developer List
<driverdev-devel@linuxdriverproject.org>,
devel@driverdev.osuosl.org,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] staging: ks7010: Fix cast to restricted __le16 in ks_wlan_net.c
Date: Mon, 3 Jul 2017 06:43:32 +0200 [thread overview]
Message-ID: <94305dbb-1356-fd6c-63de-8c7785827451@gmail.com> (raw)
In-Reply-To: <CAExDi1SdL9vvttAnEiroEbgrz0VMxA=dNRU97QqM9E0_sfhW-g@mail.gmail.com>
W dniu 2017-07-02 o 23:23, Luc Van Oostenryck pisze:
> On Sun, Jul 2, 2017 at 10:49 PM, Janusz Lisiecki
> <janusz.lisiecki@gmail.com> wrote:
>> W dniu 2017-07-02 o 21:38, Luc Van Oostenryck pisze:
>>
>>> On Sun, Jul 2, 2017 at 4:27 PM, Janusz Lisiecki
>>> <janusz.lisiecki@gmail.com> wrote:
>>>> This patch fixes the following Sparse warnings in ks_wlan_net.c:
>>>> drivers/staging/ks7010/ks_wlan_net.c:1359:24: warning: cast to restricted
>>>> __le16
>>>> Both sides of assignment are u16 so (as 'ap' is local_ap_t type and
>>>> 'capability' member,
>>>> have the same as local 'capabilities' type of u16) 'le16_to_cpu' is not
>>>> needed
>>> It could be that it's ap->capability's type that is wrong (not
>>> annotated with __le16).
>>> Isn't it?
>>>
>>> Is ap->capability supposed to hold a little-endian value or a native
>>> order value?
>>>
>>> -- Luc
>> As I see in ks_hostif.c all assignments to link_ap_info_t->capability threat
>> this value as native order (i.e get_ap_information, get_current_ap). As this
>> is not a structure which comes from HW we can do the way you suggested.
>> Still, as all other places in code threats this as native order value I
>> decided to change only one place than many other around to fix Sparse
>> warning.
> Fine, but then please put this explanation in the commit message.
> In others words, be very clear that the change is because ap->capability is in
> native order and thus the conversion le16_to_cpu() is wrong and must be removed.
>
> -- Luc
Done. I hope my message is more verbose and clear this time.
Pozdrawiam,
Janusz Lisiecki
Pozdrawiam,
Janusz Lisiecki
next prev parent reply other threads:[~2017-07-03 4:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-02 14:27 [PATCH 0/1] Fix cast to restricted __le16 in ks7010 driver Janusz Lisiecki
2017-07-02 14:27 ` [PATCH 1/1] staging: ks7010: Fix cast to restricted __le16 in ks_wlan_net.c Janusz Lisiecki
2017-07-02 19:38 ` Luc Van Oostenryck
2017-07-02 20:49 ` Janusz Lisiecki
2017-07-02 21:23 ` Luc Van Oostenryck
2017-07-03 4:43 ` Janusz Lisiecki [this message]
2017-07-03 4:41 ` [PATCH 0/1] Fix cast to restricted __le16 in ks7010 driver Janusz Lisiecki
2017-07-03 4:41 ` [PATCH 1/1] staging: ks7010: Fix cast to restricted __le16 in ks_wlan_net.c Janusz Lisiecki
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=94305dbb-1356-fd6c-63de-8c7785827451@gmail.com \
--to=janusz.lisiecki@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=wsa@the-dreams.de \
/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
all inboxes | Powered by JetHome®