All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Teodora Baluta <teodora.baluta@intel.com>, linux-iio@vger.kernel.org
Subject: Re: [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type
Date: Sat, 02 Aug 2014 17:44:55 +0100	[thread overview]
Message-ID: <53DD1587.2080502@kernel.org> (raw)
In-Reply-To: <1406546313-23031-6-git-send-email-teodora.baluta@intel.com>

On 28/07/14 12:18, Teodora Baluta wrote:
> Silence the following sparse warnings by changing cast from u16 to
> __be16:
> 
>   CHECK   drivers/staging/iio/accel/adis16240_core.c
> drivers/staging/iio/accel/adis16240_core.c:128:51: warning: incorrect
> type in argument 3 (different signedness)
> drivers/staging/iio/accel/adis16240_core.c:128:51:    expected unsigned
> short [usertype] *val
> drivers/staging/iio/accel/adis16240_core.c:128:51:    got signed short
> *<noident>
> drivers/staging/iio/accel/adis16240_core.c:142:51: warning: incorrect
> type in argument 3 (different signedness)
> drivers/staging/iio/accel/adis16240_core.c:142:51:    expected unsigned
> short [usertype] *val
> drivers/staging/iio/accel/adis16240_core.c:142:51:    got signed short
> *<noident>
> 
> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Applied to the togreg branch of iio.git pushed out as testing for the
autobuilders to play.  Note that this is unlikely to go to Greg until
after the coming merge window (unless the merge window is significantly
delayed).

Thanks,

Jonathan
> ---
>  drivers/staging/iio/resolver/ad2s1210.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
> index 7fbaba4..1360099 100644
> --- a/drivers/staging/iio/resolver/ad2s1210.c
> +++ b/drivers/staging/iio/resolver/ad2s1210.c
> @@ -491,7 +491,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
>  
>  	switch (chan->type) {
>  	case IIO_ANGL:
> -		pos = be16_to_cpup((u16 *)st->rx);
> +		pos = be16_to_cpup((__be16 *) st->rx);
>  		if (st->hysteresis)
>  			pos >>= 16 - st->resolution;
>  		*val = pos;
> @@ -499,7 +499,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
>  		break;
>  	case IIO_ANGL_VEL:
>  		negative = st->rx[0] & 0x80;
> -		vel = be16_to_cpup((s16 *)st->rx);
> +		vel = be16_to_cpup((__be16 *) st->rx);
>  		vel >>= 16 - st->resolution;
>  		if (vel & 0x8000) {
>  			negative = (0xffff >> st->resolution) << st->resolution;
> 

      reply	other threads:[~2014-08-02 16:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 11:18 [PATCH 0/5] staging: iio: minor fixes for sparse warnings Teodora Baluta
2014-07-28 11:18 ` [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16 Teodora Baluta
2014-08-02 11:56   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 2/5] staging: iio: ad5933: " Teodora Baluta
2014-08-02 11:57   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 3/5] staging: iio: hmc5843_core: fix sparse warnings Teodora Baluta
2014-08-02 16:33   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 4/5] staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness) Teodora Baluta
2014-08-02 16:35   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type Teodora Baluta
2014-08-02 16:44   ` Jonathan Cameron [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=53DD1587.2080502@kernel.org \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=teodora.baluta@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.