Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753042AbdFMJX4 (ORCPT ); Tue, 13 Jun 2017 05:23:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54738 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752565AbdFMJXy (ORCPT ); Tue, 13 Jun 2017 05:23:54 -0400 Date: Tue, 13 Jun 2017 11:23:41 +0200 From: Greg KH To: sunil.m@techveda.org Cc: devel@driverdev.osuosl.org, geo.emmnl@gmail.com, karniksayli1995@gmail.com, linux-kernel@vger.kernel.org, sergio.paracuellos@gmail.com, sfaragnaus@gmail.com, fransklaver@gmail.com Subject: Re: [PATCH] staging: wlan-ng: Amend type mismatch warnings Message-ID: <20170613092341.GD5677@kroah.com> References: <1497287738-28567-1-git-send-email-sunil.m@techveda.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497287738-28567-1-git-send-email-sunil.m@techveda.org> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1173 Lines: 31 On Mon, Jun 12, 2017 at 10:45:38PM +0530, sunil.m@techveda.org wrote: > From: Suniel Mahesh > > The following type mismatch warnings reported by sparse > have been amended: > warning: cast to restricted __le16 > warning: incorrect type in assignment (different base types) > > Signed-off-by: Suniel Mahesh > --- > drivers/staging/wlan-ng/prism2mgmt.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c > index f4d6e48..358b556 100644 > --- a/drivers/staging/wlan-ng/prism2mgmt.c > +++ b/drivers/staging/wlan-ng/prism2mgmt.c > @@ -185,7 +185,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp) > > /* set up the txrate to be 2MBPS. Should be fastest basicrate... */ > word = HFA384x_RATEBIT_2; > - scanreq.tx_rate = cpu_to_le16(word); > + scanreq.tx_rate = (__force u16)cpu_to_le16(word); If you ever find yourself using __force, it is almost always the wrong solution. Please step back and understand what is going on here before making a change like this. good luck! greg k-h