public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ernestas Kulik <ernestas.kulik@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: ks7010: fix sparse warnings
Date: Sat, 4 Mar 2017 17:42:17 +0300	[thread overview]
Message-ID: <20170304144216.GE4386@mwanda> (raw)
In-Reply-To: <20170304085623.32674-1-ernestas.kulik@gmail.com>

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

      reply	other threads:[~2017-03-04 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-04  8:56 [PATCH v2] staging: ks7010: fix sparse warnings Ernestas Kulik
2017-03-04 14:42 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170304144216.GE4386@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=ernestas.kulik@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox