From: Jonathan Cameron <jic23@kernel.org>
To: Teodora Baluta <teodora.baluta@intel.com>,
linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH] staging: iio: ad5933: fix sparse warnings
Date: Sun, 27 Jul 2014 14:34:49 +0100 [thread overview]
Message-ID: <53D4FFF9.1040602@kernel.org> (raw)
In-Reply-To: <1406278243-7135-1-git-send-email-teodora.baluta@intel.com>
On 25/07/14 09:50, Teodora Baluta wrote:
> Fix the following sparse warnings:
>
> CHECK drivers/staging/iio/impedance-analyzer/ad5933.c
> drivers/staging/iio/impedance-analyzer/ad5933.c:241:17: warning:
> incorrect type in assignment (different base types)
> drivers/staging/iio/impedance-analyzer/ad5933.c:241:17: expected
> unsigned int [unsigned] [usertype] d32
> drivers/staging/iio/impedance-analyzer/ad5933.c:241:17: got
> restricted __be32 [usertype] <noident>
> drivers/staging/iio/impedance-analyzer/ad5933.c:263:13: warning:
> incorrect type in assignment (different base types)
> drivers/staging/iio/impedance-analyzer/ad5933.c:263:13: expected
> unsigned short [unsigned] dat
> drivers/staging/iio/impedance-analyzer/ad5933.c:263:13: got
> restricted __be16 [usertype] <noident>
> drivers/staging/iio/impedance-analyzer/ad5933.c:271:13: warning:
> incorrect type in assignment (different base types)
> drivers/staging/iio/impedance-analyzer/ad5933.c:271:13: expected
> unsigned short [unsigned] [addressable] dat
> drivers/staging/iio/impedance-analyzer/ad5933.c:271:13: got
> restricted __be16 [usertype] <noident>
> drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
> restricted __be32
> drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
> restricted __be32
> drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
> restricted __be32
> drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
> restricted __be32
> drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
> restricted __be32
> drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
> restricted __be32
> drivers/staging/iio/impedance-analyzer/ad5933.c:446:21: warning:
> incorrect type in assignment (different base types)
> drivers/staging/iio/impedance-analyzer/ad5933.c:446:21: expected
> unsigned short [unsigned] dat
> drivers/staging/iio/impedance-analyzer/ad5933.c:446:21: got
> restricted __be16 [usertype] <noident>
> drivers/staging/iio/impedance-analyzer/ad5933.c:454:21: warning:
> incorrect type in assignment (different base types)
> drivers/staging/iio/impedance-analyzer/ad5933.c:454:21: expected
> unsigned short [unsigned] [addressable] dat
> drivers/staging/iio/impedance-analyzer/ad5933.c:454:21: got
> restricted __be16 [usertype] <noident>
> drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
> restricted __be16
>
> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Applied to the togreg branch of iio.git. Pushed out as testing for now
to let the autobuilders play with it.
Also cc'd Lars who looks after most of of the Analog Devices drivers in IIO.
Jonathan
> ---
> drivers/staging/iio/impedance-analyzer/ad5933.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 2b96665..2cef4b9 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -220,7 +220,7 @@ static int ad5933_set_freq(struct ad5933_state *st,
> {
> unsigned long long freqreg;
> union {
> - u32 d32;
> + __be32 d32;
> u8 d8[4];
> } dat;
>
> @@ -244,7 +244,7 @@ static int ad5933_set_freq(struct ad5933_state *st,
>
> static int ad5933_setup(struct ad5933_state *st)
> {
> - unsigned short dat;
> + __be16 dat;
> int ret;
>
> ret = ad5933_reset(st);
> @@ -297,7 +297,7 @@ static ssize_t ad5933_show_frequency(struct device *dev,
> int ret;
> unsigned long long freqreg;
> union {
> - u32 d32;
> + __be32 d32;
> u8 d8[4];
> } dat;
>
> @@ -402,7 +402,7 @@ static ssize_t ad5933_store(struct device *dev,
> struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
> u16 val;
> int i, ret = 0;
> - unsigned short dat;
> + __be16 dat;
>
> if (this_attr->address != AD5933_IN_PGA_GAIN) {
> ret = kstrtou16(buf, 10, &val);
> @@ -521,7 +521,7 @@ static int ad5933_read_raw(struct iio_dev *indio_dev,
> long m)
> {
> struct ad5933_state *st = iio_priv(indio_dev);
> - unsigned short dat;
> + __be16 dat;
> int ret = -EINVAL;
>
> mutex_lock(&indio_dev->mlock);
>
prev parent reply other threads:[~2014-07-27 13:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 8:50 [PATCH] staging: iio: ad5933: fix sparse warnings Teodora Baluta
2014-07-27 13:34 ` 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=53D4FFF9.1040602@kernel.org \
--to=jic23@kernel.org \
--cc=lars@metafoo.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).