Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1592506

Re: [PATCH v2] staging: ks7010: fix sparse warnings

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!news.unit0.net!news.panservice.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] staging: ks7010: fix sparse warnings
Date Sat, 04 Mar 2017 15:50:01 +0100
Message-ID <thjap-2aI-3@gated-at.bofh.it> (permalink)
References <thdHI-6xy-11@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent Mutt/1.5.21 (2010-09-15)
X-Source-IP userv0022.oracle.com [156.151.31.74]
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 31
Organization linux.* mail to news gateway
X-Original-Cc gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
X-Original-Date Sat, 4 Mar 2017 17:42:17 +0300
X-Original-Message-ID <20170304144216.GE4386@mwanda>
X-Original-References <20170304085623.32674-1-ernestas.kulik@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1592506

Show key headers only | View raw


On Sat, Mar 04, 2017 at 10:56:23AM +0200, Ernestas Kulik wrote:
> Currently, sparse generates many warnings for the driver. This commit
> changes the types of struct fields/function variables to match the
> endianness at their assignment.
> 
> Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com>
> ---
> Changes from v1:
> * Change the type of the variable being passed to ntohs() instead of casting it
> * Don’t remove any struct fields

[ snip ]

> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> index 6f9f746a3a61..8e644ff8eca8 100644
> --- a/drivers/staging/ks7010/ks7010_sdio.c
> +++ b/drivers/staging/ks7010/ks7010_sdio.c
> @@ -297,7 +297,8 @@ static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
>  	hdr = (struct hostif_hdr *)buffer;
>  
>  	DPRINTK(4, "size=%d\n", hdr->size);
> -	if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
> +	if (le16_to_cpu(hdr->event) < HIF_DATA_REQ ||
> +	    HIF_REQ_MAX < le16_to_cpu(hdr->event)) {

Don't mix cleanups and bugfixes.  They have to be done in separate
patches.  Also this change wasn't described in the changelog like Joe
explained.

regards,
dan carpenter

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v2] staging: ks7010: fix sparse warnings Ernestas Kulik <ernestas.kulik@gmail.com> - 2017-03-04 10:00 +0100
  Re: [PATCH v2] staging: ks7010: fix sparse warnings Dan Carpenter <dan.carpenter@oracle.com> - 2017-03-04 15:50 +0100

csiph-web