From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758189AbdCUVkQ (ORCPT ); Tue, 21 Mar 2017 17:40:16 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:35132 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757648AbdCUVkO (ORCPT ); Tue, 21 Mar 2017 17:40:14 -0400 Message-ID: <1490132410.17318.6.camel@gmail.com> Subject: Re: [PATCH] staging: wilc1000: use kernel define byte order macros From: Robert Perry Hooker To: Dan Carpenter Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, aditya.shankar@microchip.com, linux-kernel@vger.kernel.org, ganesh.krishna@microchip.com Date: Tue, 21 Mar 2017 15:40:10 -0600 In-Reply-To: <20170321201904.GD32449@mwanda> References: <1490126140-12867-1-git-send-email-perry.hooker@gmail.com> <20170321201904.GD32449@mwanda> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.2.1 (3.16.2.1-1.fc22) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for taking a look, Dan. Sorry if I missed the mark here. Can you tell me a bit more about the bug this would introduce? I see that ieee80211_is_action is defined like this: static inline bool ieee80211_is_action(__le16 fc) ...and that buff[FRAME_TYPE_ID]is a u8 (since FRAME_TYPE_ID = 0). Is there an issue with calling cpu_to_le16 on a u8 that isn't encountered by implicitly casting a u8 to __le16? Or am I missing something else? Regards, Perry On Tue, 2017-03-21 at 23:19 +0300, Dan Carpenter wrote: > On Tue, Mar 21, 2017 at 01:55:40PM -0600, Perry Hooker wrote: > > This commit fixes the following sparse warnings: > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:1473:45: warning: incorrect type in argument 1 (different base > > types) > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2006:51: warning: incorrect type in assignment (different base > > types) > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2011:52: warning: incorrect type in assignment (different base > > types) > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2012:51: warning: incorrect type in assignment (different base > > types) > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2078:51: warning: incorrect type in assignment (different base > > types) > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2083:52: warning: incorrect type in assignment (different base > > types) > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:2084:51: warning: incorrect type in assignment (different base > > types) > > > > Signed-off-by: Perry Hooker > > --- > > drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 20 +++++++++++++------- > > 1 file changed, 13 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > > index a37896f..d1c75c7 100644 > > --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > > +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c > > @@ -1470,7 +1470,7 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size) > > } else { > > s32Freq = ieee80211_channel_to_frequency(curr_channel, NL80211_BAND_2GHZ); > > > > - if (ieee80211_is_action(buff[FRAME_TYPE_ID])) { > > + if (ieee80211_is_action(cpu_to_le16(buff[FRAME_TYPE_ID]))) { > > Nah... You're just introducing bugs here. Please be more careful. > > regards, > dan carpenter >