[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 2/5] Add Error **errp for xen_host_pci_device
From: |
Cao jin |
Subject: |
Re: [Qemu-devel] [PATCH v4 2/5] Add Error **errp for xen_host_pci_device_get() |
Date: |
Sat, 9 Jan 2016 19:20:31 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 01/09/2016 06:50 AM, Eric Blake wrote:
On 01/08/2016 01:37 AM, Cao jin wrote:
buf[rc] = 0;
rc = qemu_strtoul(buf, &endptr, base, &value);
Do you still need a local 'value' variable, or can you just reuse pvalue
here?
I guess so, or else it won`t compile, because, *pvalue* is int*, *value* is
unsigned long*, and qemu_strtoul() require a unsigned long* for the last
param.
And I guess that is why author use a local 'value'. I just want to make
the patch
small for the reviewer, so I reuse most of original code.
but yes, maybe it can be:
rc = qemu_strtoul(buf, &endptr, base, (unsigned long *)pvalue);
--
Yours Sincerely,
Cao jin
- [Qemu-devel] [PATCH v4 0/5] Xen PCI passthru: Convert to realize(), Cao jin, 2016/01/08
- [Qemu-devel] [PATCH v4 1/5] Use qemu_strtoul instead of strtol, Cao jin, 2016/01/08
- [Qemu-devel] [PATCH v4 3/5] Add Error **errp for xen_pt_setup_vga(), Cao jin, 2016/01/08
- [Qemu-devel] [PATCH v4 2/5] Add Error **errp for xen_host_pci_device_get(), Cao jin, 2016/01/08
- [Qemu-devel] [PATCH v4 5/5] Xen PCI passthru: convert to realize(), Cao jin, 2016/01/08
- [Qemu-devel] [PATCH v4 4/5] Add Error **errp for xen_pt_config_init(), Cao jin, 2016/01/08