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: signature.asc
Description: OpenPGP digital signature

Reply via email to