All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Christophe DUBOIS <jcd@tribudubois.net>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	peter.chubb@nicta.com.au, qemu-devel@nongnu.org,
	afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH v2 2/4] Add i.MX I2C controller driver.
Date: Sun, 05 May 2013 14:28:37 +0200	[thread overview]
Message-ID: <51865075.6040000@tribudubois.net> (raw)
In-Reply-To: <CAEgOgz6n-nLA-WY5ym8neHC-EqGbQ_VhMbZjPWQ6NSLxOcxSDQ@mail.gmail.com>

On 05/05/2013 01:53 PM, Peter Crosthwaite wrote:
> Hi Peter,
>
> On Sun, May 5, 2013 at 9:41 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> On 5 May 2013 11:53, Peter Crosthwaite <peter.crosthwaite@xilinx.com> wrote:
>>> On Sun, May 5, 2013 at 8:47 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>>>> On 5 May 2013 04:58, Jean-Christophe DUBOIS <jcd@tribudubois.net> wrote:
>>>>> no extract16() macro spotted.
>>>>> Should one be added?
>>>> There's no need for one -- just use extract32. The only
>>>> reason for having a separate extract64 is to avoid doing
>>>> 64 bit arithmetic when we don't have to, I think.
>>>>
>>> perhaps a quick:
>>>
>>> #define extract16(a, b, c) (uint16_t)extract32((uint16_t)(a), (b), (c))
>>>
>>> would keep the 16bit device code explicit and clean? Save on
>>> dummy casts in certain situations as well (but not this one).
>> Hmm, what situations would ever require a cast of the result
>> or the input of extract32?
>>
> The one off the top of my head:
>
> fprintf(stderr, "your 16 field is :%" PRIx16 "\n", extract16(foo, bar, baz));
>
> Otherwise you would have to match PRIx32 to extract 16 which is clumsy.
>
> But aren't there there some other varargs situations that may require
> casts as well?
>
> As for the input cast, I got nothin, I just put it in there for
> completeness. Meet you half way and drop the input cast and keep the
> output?
>
> Regards,
> Peter

I will use extract32() for now.

JC

>
>> -- PMM
>>

  reply	other threads:[~2013-05-05 12:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-04 14:09 [Qemu-devel] [PATCH v2 0/4] Add i.MX25 support through the 3DS evaluation board Jean-Christophe DUBOIS
2013-05-04 14:09 ` [Qemu-devel] [PATCH v2 1/4] Add i.MX FEC Ethernet driver Jean-Christophe DUBOIS
2013-05-05  3:11   ` Peter Crosthwaite
2013-05-05 11:46     ` Andreas Färber
2013-05-05 11:59       ` Peter Crosthwaite
2013-05-05 12:41         ` Peter Maydell
2013-05-05 13:14     ` Jean-Christophe DUBOIS
2013-05-05 13:31       ` Andreas Färber
2013-05-05 14:05         ` Jean-Christophe DUBOIS
2013-05-05 17:49   ` Michael S. Tsirkin
2013-05-05 18:01     ` Peter Maydell
2013-05-05 21:15       ` Michael S. Tsirkin
2013-05-05 22:00         ` Peter Maydell
2013-05-06  8:51           ` Michael S. Tsirkin
2013-05-06  9:08             ` Peter Maydell
2013-05-06  9:24               ` Michael S. Tsirkin
2013-05-06 12:01                 ` Peter Maydell
2013-05-07  0:39                   ` Peter Crosthwaite
2013-05-07  9:03                     ` Peter Maydell
2013-05-04 14:09 ` [Qemu-devel] [PATCH v2 2/4] Add i.MX I2C controller driver Jean-Christophe DUBOIS
2013-05-05  3:14   ` Peter Crosthwaite
2013-05-05  3:58     ` Jean-Christophe DUBOIS
2013-05-05 10:47       ` Peter Maydell
2013-05-05 10:53         ` Peter Crosthwaite
2013-05-05 11:41           ` Peter Maydell
2013-05-05 11:53             ` Peter Crosthwaite
2013-05-05 12:28               ` Jean-Christophe DUBOIS [this message]
2013-05-05 11:34     ` Andreas Färber
2013-05-05 12:34       ` Jean-Christophe DUBOIS
2013-05-04 14:09 ` [Qemu-devel] [PATCH v2 3/4] Add i.MX25 3DS evaluation board support Jean-Christophe DUBOIS
2013-05-04 14:09 ` [Qemu-devel] [PATCH v2 4/4] Add qtest support for i.MX I2C device emulation Jean-Christophe DUBOIS
2013-05-04 16:53   ` Andreas Färber
2013-05-04 19:02     ` Jean-Christophe DUBOIS
2013-05-04 19:48       ` [Qemu-devel] compile the latest source in mac error Peter Cheung
2013-05-04 20:51         ` Peter Maydell

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=51865075.6040000@tribudubois.net \
    --to=jcd@tribudubois.net \
    --cc=afaerber@suse.de \
    --cc=peter.chubb@nicta.com.au \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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 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.