linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
Cc: michael.hennerich@analog.com,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"device-drivers-devel@blackfin.uclinux.org"
	<device-drivers-devel@blackfin.uclinux.org>
Subject: Re: [PATCH] iio: ad9523: Fix argument type mismatch
Date: Mon, 11 Jun 2012 13:36:30 +0200	[thread overview]
Message-ID: <4FD5D83E.3040504@metafoo.de> (raw)
In-Reply-To: <CAM=Q2csVnSs_gicDyMdKZYPNf6qC8FYD1sOcBBJ+5tSEScpu8Q@mail.gmail.com>

On 06/11/2012 01:17 PM, Shubhrajyoti Datta wrote:
> Hi Michael,
> 
> On Mon, Jun 11, 2012 at 2:45 PM, Michael Hennerich
> <michael.hennerich@analog.com> wrote:
> [..]
>>>>  static int ad9523_vco_out_map(struct iio_dev *indio_dev,
>>>> -                             unsigned ch, bool out)
>>>> +                             unsigned ch, unsigned out)
>>>
>>> Unsigned defaults to unsigned int right shouldnt it be a char?
>>> Or am I missing something.
>>>
>> Hi Shubhrajyoti,
>>
>> can you explain why this matters?
>> If you take a closer look at the disassembly -
>> you will notice that 'unsigned int' will generate nicer code.
>>
> 
> What I was thinking is that
> 
> 
> +       }
> +
> +       st->vco_out_map[ch] = out;
> +
> +       return ret;
> +}
> Here
> 
> and
> +struct ad9523_state {
> +       struct spi_device               *spi;
> +       struct regulator                *reg;
> +       struct ad9523_platform_data     *pdata;
> +       struct iio_chan_spec            ad9523_channels[AD9523_NUM_CHAN];
> +
> +       unsigned long           vcxo_freq;
> +       unsigned long           vco_freq;
> +       unsigned long           vco_out_freq[AD9523_NUM_CLK_SRC];
> +       unsigned char           vco_out_map[AD9523_NUM_CHAN_ALT_CLK_SRC];
> 
> So that may not work well with all the endianness etc,

The code is fine as it is, the assignment does an implicit type cast.

  reply	other threads:[~2012-06-11 11:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11  7:51 [PATCH] iio: ad9523: Fix argument type mismatch michael.hennerich
2012-06-11  9:02 ` Shubhrajyoti Datta
2012-06-11  9:15   ` Michael Hennerich
2012-06-11 11:17     ` Shubhrajyoti Datta
2012-06-11 11:36       ` Lars-Peter Clausen [this message]
2012-06-11 12:29         ` Shubhrajyoti Datta
  -- strict thread matches above, loose matches on Subject: below --
2012-06-08 11:04 michael.hennerich

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=4FD5D83E.3040504@metafoo.de \
    --to=lars@metafoo.de \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=omaplinuxkernel@gmail.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).