lkml.org 
[lkml]   [2017]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] staging: ks7010: Fix cast to restricted __le16 in ks_wlan_net.c
From
Date
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.

Pozdrawiam,
Janusz Lisiecki

\
 
 \ /
  Last update: 2017-07-02 22:50    [W:0.080 / U:5.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site