Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp289471img; Mon, 25 Feb 2019 23:28:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IYAw2bJ8PLpEQ/g/52tXOBm22stLJsyjAPkpkrhKBHVZDVlKcTAGtAHh5G5JedRhMdRds7e X-Received: by 2002:a62:3a47:: with SMTP id h68mr24350048pfa.202.1551166114289; Mon, 25 Feb 2019 23:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551166114; cv=none; d=google.com; s=arc-20160816; b=0utPUQ3eTqhvnNP6S7lcg9BAXxVY5jktuJTdHjehbKchMY/yU7uxZeQSAlEO+3aWzS H1INyZ4m8SPp6If6kKMYeo0k8CfAGAeJ1EuNTqftMQrZWWW3lh4dA/sAQs/VuEJ1O84x ObkJthUk6mAf6bdOhBDeUVqsRFcwxUCYfVj3dxby5ENI8Hmp2z5lczf02s3sXsR32izz wF6St/nlhKzbEGnoR8/wBhcpKjUoFxL/dpiWiQaMOdVKT9V8z25NcMbzgusbVOXxnjgX 0ckFxceJjnFcylDXyRY9NIFRHhLAk+D2Ec4FUJcSYCjj6IxKbEIHerJl2gpbQ8l4H1Mr NGaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=qBlMH40Plgz63l2W1u/VtjZ/wAgnZUhuK9hJGySITk8=; b=qmBx3rkshvM6lw14gdnF4WDCUu/fxrbg4mxzXxetnFtS7iAoOOdLKOcccWtIk4u1V1 IRWJA69YjSMRBxiBCGMxNTZt4yLID0VnJ1vsd3TqVs2nerSgOVPqsijqBfeZcGxj7xnv kU7WVom0cT/XHXrt29Yb312ccsd/GdMgL49k7U+aWN19R6BvfzGzmq1LbaSyOjj5CGfh O6I6HiwkcdV5OvhXnxpZzHbPQG1alAYKZqRJ72Pmc74nGIn7kSq+Gue4rUdk5hIawV4w RAqKtN1Y+1Hlg02G3HeHfId+SGCuoxZ0CBxp+/RB8NEXOD2waWMdNLIDCPAmLG663Jwk 1/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O4QuLL8M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 128si12643351pfz.86.2019.02.25.23.28.18; Mon, 25 Feb 2019 23:28:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O4QuLL8M; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726789AbfBZH1h (ORCPT + 99 others); Tue, 26 Feb 2019 02:27:37 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:43179 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfBZH1h (ORCPT ); Tue, 26 Feb 2019 02:27:37 -0500 Received: by mail-yb1-f193.google.com with SMTP id e200so3155742ybc.10; Mon, 25 Feb 2019 23:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qBlMH40Plgz63l2W1u/VtjZ/wAgnZUhuK9hJGySITk8=; b=O4QuLL8MOOV6dqJy4hyrqGc0ppnClbFJnNtMg+L3X9isygnGWHeHCDc4tiYpU5dXhG +eVBm/CbVKprG3woY26ivEKE5RBNN2Xc5cD//dIb6H5O3yCeO52cSZeQYYwGefxCOsgb 7Anu6VPTJGVfkHD6srbosmLFzVl02C3LDkdjMiuvSi+POh9l5HObPdngYGKvO4VEMiao KRYWMFOSTY/AmHZz6mIBRwp2UL+QHOocrmaobMufPAVJ1/Tha4/elhTDR1ZPM3aqOXJD N2YDf3eVtmyeZ8XzNRnaKHFXGvlGjW7mEKGuSlqR6qJtxrjKSiKJTyTWAj58przL3kiQ yZsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=qBlMH40Plgz63l2W1u/VtjZ/wAgnZUhuK9hJGySITk8=; b=JLMWptlqkOLDbCVmv8lj2vhZynxmz/gPJVl/FKzZ+GmOysh2orY+0czB0hHsV0nOvN KYrKhFXmVF4dR39gsKVH394iQTtldSb3+DIXG8FiQW4vjw1N74sx0XaI6Y3DJKyOkM7T GqbngkEXOEs/VZOIMiAUOPa7zOLY+R6fpMb+lp1HqtgqhcErbG6rzgVexFpS5dck2TKU JUqKs+s1nifVsG+tUktFIa31dPhQN7SlYb56qGMLczAVQsJTnDNykBSFprvk/3DY6PU+ YzHkvtbBQNcLOdThLHinIpaee3QNo32EWSv/HZJsp8TbLD9QF70OE6IfIPSGmcjqJs+h HiOQ== X-Gm-Message-State: AHQUAubeEb7UGIhz23VNcEzIEh+qBXyha7y0zciLyCuU4w1E5MwsG7Rq P7Yc6d7ATtZNTUNOC1SFXV0= X-Received: by 2002:a25:8542:: with SMTP id f2mr3680052ybn.52.1551166056183; Mon, 25 Feb 2019 23:27:36 -0800 (PST) Received: from yubo-2 ([191.101.9.198]) by smtp.gmail.com with ESMTPSA id r31sm5921675ywa.0.2019.02.25.23.27.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 23:27:36 -0800 (PST) Date: Tue, 26 Feb 2019 02:27:34 -0500 From: YU Bo To: Ajay.Kathat@microchip.com Cc: Adham.Abozaeid@microchip.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, yuzibode@126.com Subject: Re: [PATCH] staging: wilc1000: Fix incorrent type in assignment Message-ID: <20190226072733.vdxcqmwglz3kxd72@yubo-2> Mail-Followup-To: Ajay.Kathat@microchip.com, Adham.Abozaeid@microchip.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, yuzibode@126.com References: <20190226032825.26171-1-tsu.yubo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180512-62-03f98a Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 26, 2019 at 06:39:28AM +0000, Ajay.Kathat@microchip.com wrote: > > >On 2/26/2019 8:58 AM, Bo YU wrote: >> The patch fixes following sparse warning: >> >> drivers/staging/wilc1000/host_interface.c:450:30: warning: incorrect type in assignment (different base types) >> drivers/staging/wilc1000/host_interface.c:450:30: expected restricted __le16 [usertype] beacon_period >> drivers/staging/wilc1000/host_interface.c:450:30: got unsigned short [usertype] beacon_interval >> drivers/staging/wilc1000/host_interface.c:451:25: warning: incorrect type in assignment (different base types) >> drivers/staging/wilc1000/host_interface.c:451:25: expected restricted __le16 [usertype] cap_info >> drivers/staging/wilc1000/host_interface.c:451:25: got unsigned short [usertype] capability >> >> Signed-off-by: Bo YU >> --- >> I have no hardware to test it and just to compile it > >Thanks for submitting the patch. > >The correct way to fix above spare warning is by using cpu_to_le16() >while filing the information in ->beacon_period and ->cap_info because >wilc1000 module expects the data in _le_ byte order. > >Please changes the below lines in host_interface.c and resubmit the patch. > param->beacon_period = bss->beacon_interval; > param->cap_info = bss->capability; >to > param->beacon_period = cpu_to_le16(bss->beacon_interval); > param->cap_info = cpu_to_le16(bss->capability); Ok, done, thank you, Bo > >> --- >> drivers/staging/wilc1000/host_interface.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c >> index 50dc2dd942f5..cdcb52aec779 100644 >> --- a/drivers/staging/wilc1000/host_interface.c >> +++ b/drivers/staging/wilc1000/host_interface.c >> @@ -106,10 +106,10 @@ struct wilc_join_bss_param { >> u8 ssid_terminator; >> u8 bss_type; >> u8 ch; >> - __le16 cap_info; >> + u16 cap_info; >> u8 sa[ETH_ALEN]; >> u8 bssid[ETH_ALEN]; >> - __le16 beacon_period; >> + u16 beacon_period; >> u8 dtim_period; >> u8 supp_rates[WILC_MAX_RATES_SUPPORTED + 1]; >> u8 wmm_cap; >> > >Regards, >Ajay