From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754136AbbFAVnh (ORCPT ); Mon, 1 Jun 2015 17:43:37 -0400 Received: from smtprelay0252.hostedemail.com ([216.40.44.252]:53928 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751628AbbFAVnc (ORCPT ); Mon, 1 Jun 2015 17:43:32 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3872:4321:5007:6261:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12296:12438:12517:12519:12555:12740:13069:13255:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: girls14_15be673ed962 X-Filterd-Recvd-Size: 2200 Message-ID: <1433195008.4861.53.camel@perches.com> Subject: Re: [PATCH RESEND 2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings From: Joe Perches To: Gaston Gonzalez Cc: gregkh@linuxfoundation.org, cristina.opriceana@gmail.com, hamohammed.sa@gmail.com, gdonald@gmail.com, mahfouz.saif.elyazal@gmail.com, paul.gortmaker@windriver.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Mon, 01 Jun 2015 14:43:28 -0700 In-Reply-To: <1433194203-3373-1-git-send-email-gascoar@gmail.com> References: <1433194203-3373-1-git-send-email-gascoar@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 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 On Mon, 2015-06-01 at 18:30 -0300, Gaston Gonzalez wrote: > Fix the following sparse warnings: [] > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c [] > @@ -660,8 +660,9 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be > auth = (struct ieee80211_authentication *) > skb_put(skb, sizeof(struct ieee80211_authentication)); > > - auth->header.frame_ctl = IEEE80211_STYPE_AUTH; > - if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP; > + auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH); > + if (challengelen) > + auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP); It'd be better to use normal tab indentation and likely it'd also be better to set this only once if (challengelen) auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH | IEEE80211_FCTL_WEP); else auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH); or maybe a single line auth->header.frame_ctl = cpu_to_le16(challengelen ? IEEE80211_STYPE_AUTH | IEEE80211_FCTL_WEP : IEEE80211_STYPE_AUTH); though I think the first is simpler to read.