qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, Ernest Esene <eroken1@gmail.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-devel@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] chardev/char-i2c: Implement Linux I2C character device
Date: Tue, 7 May 2019 12:45:02 -0500	[thread overview]
Message-ID: <85baf98a-0309-8168-a0f7-6d7e9d4e447b@redhat.com> (raw)
In-Reply-To: <87ftpqb25m.fsf@dusky.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

On 5/7/19 12:33 PM, Markus Armbruster wrote:

>> +static int i2c_ioctl(Chardev *chr, int cmd, void *arg)
>> +{
>> +    FDChardev *fd_chr = FD_CHARDEV(chr);
>> +    QIOChannelFile *floc = QIO_CHANNEL_FILE(fd_chr->ioc_in);
>> +    int fd = floc->fd;
>> +    int addr;
>> +
>> +    switch (cmd) {
>> +    case CHR_IOCTL_I2C_SET_ADDR:
>> +        addr = (int) (long) arg;
> 
> Would (int)arg make the compiler unhappy?

If you're trying to pass an integer through void*, it's probably best to
write:

addr = (intptr_t) arg;

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-05-07 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-04 18:11 [Qemu-devel] [PATCH v2] chardev/char-i2c: Implement Linux I2C character device Ernest Esene
2019-05-04 18:11 ` Ernest Esene
2019-05-07 17:33 ` Markus Armbruster
2019-05-07 17:45   ` Eric Blake [this message]
2019-05-10 14:19   ` Ernest Esene
2019-05-10 15:51     ` Markus Armbruster
2019-05-09 13:00 ` Stefan Hajnoczi
2019-05-10 17:38   ` Ernest Esene

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=85baf98a-0309-8168-a0f7-6d7e9d4e447b@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eroken1@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).