public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Niranjan Dighe <niranjan.dighe@gmail.com>
Cc: "Oleg Drokin" <oleg.drokin@intel.com>,
	"Andreas Dilger" <andreas.dilger@intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Shivani Bhardwaj" <shivanib134@gmail.com>,
	"Dmitry Eremin" <dmitry.eremin@intel.com>,
	"Mike Rapoport" <mike.rapoport@gmail.com>,
	"Shraddha Barke" <shraddha.6596@gmail.com>,
	"Frank Zago" <fzago@cray.com>,
	"Hatice ERTÜRK" <haticeerturk27@gmail.com>,
	"Mike Shuey" <shuey@purdue.edu>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	lustre-devel@lists.lustre.org
Subject: Re: [PATCH] staging: lustre/lnet: Fix wrong type casting warning generated by sparse
Date: Sun, 14 Feb 2016 00:49:32 +0300	[thread overview]
Message-ID: <20160213214932.GE32153@mwanda> (raw)
In-Reply-To: <20160213180435.GA16246@codebox>

On Sat, Feb 13, 2016 at 11:34:35PM +0530, Niranjan Dighe wrote:
> diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c
> index 366211e..64b6a70 100644
> --- a/drivers/staging/lustre/lnet/selftest/console.c
> +++ b/drivers/staging/lustre/lnet/selftest/console.c
> @@ -1461,9 +1461,9 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg,
>  
>  	sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0];
>  	srpc_stat = (srpc_counters_t __user *)
> -				      ((char *)sfwk_stat + sizeof(*sfwk_stat));
> +				((char __user *)sfwk_stat + sizeof(*sfwk_stat));

This is uglier than necessary.  Do it either like this:

	srpc_stat = (void __user *)sfwk_stat + sizeof(*sfwk_stat);

Or probably it's actually nicer to say:

	srpc_stat = sfwk_stat + 1;

regards,
dan carpenter

  reply	other threads:[~2016-02-13 21:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-13 18:04 [PATCH] staging: lustre/lnet: Fix wrong type casting warning generated by sparse Niranjan Dighe
2016-02-13 21:49 ` Dan Carpenter [this message]
2016-02-14  2:45   ` Niranjan Dighe

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=20160213214932.GE32153@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dmitry.eremin@intel.com \
    --cc=fzago@cray.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haticeerturk27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=mike.rapoport@gmail.com \
    --cc=niranjan.dighe@gmail.com \
    --cc=oleg.drokin@intel.com \
    --cc=shivanib134@gmail.com \
    --cc=shraddha.6596@gmail.com \
    --cc=shuey@purdue.edu \
    /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