[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/8] xen: Remove useless casts
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 4/8] xen: Remove useless casts |
Date: |
Thu, 5 Jul 2018 12:36:33 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 07/05/2018 07:16 AM, Peter Maydell wrote:
> On 4 July 2018 at 16:39, Philippe Mathieu-Daudé <address@hidden> wrote:
>> Patch created mechanically by rerunning:
>>
>> $ spatch --sp-file scripts/coccinelle/typecast.cocci \
>> --macro-file scripts/cocci-macro-file.h \
>> --dir . --in-place
>>
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> hw/xen/xen_pt_config_init.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
>> index aee31c62bb..55a83333f2 100644
>> --- a/hw/xen/xen_pt_config_init.c
>> +++ b/hw/xen/xen_pt_config_init.c
>> @@ -543,7 +543,7 @@ static int
>> xen_pt_exp_rom_bar_reg_write(XenPCIPassthroughState *s,
>> {
>> XenPTRegInfo *reg = cfg_entry->reg;
>> XenPTRegion *base = NULL;
>> - PCIDevice *d = (PCIDevice *)&s->dev;
>> + PCIDevice *d = &s->dev;
>
> This line of code is odd even without the cast. XenPCIPassthroughState*
> is a QOM object (TYPE_XEN_PT_DEVICE) which is a subclass of TYPE_PCI_DEVICE,
> so the standard way to get the PCIDevice pointer for s would be
> PCIDevice *d = PCI_DEVICE(s);
You have eagle eyes...
Thanks for your review :)
Phil.
- [Qemu-devel] [PATCH 2/8] error: Remove NULL checks on error_propagate() calls, (continued)
- [Qemu-devel] [PATCH 2/8] error: Remove NULL checks on error_propagate() calls, Philippe Mathieu-Daudé, 2018/07/04
- [Qemu-devel] [PATCH 3/8] crypto: Remove useless casts, Philippe Mathieu-Daudé, 2018/07/04
- [Qemu-devel] [PATCH 4/8] xen: Remove useless casts, Philippe Mathieu-Daudé, 2018/07/04
- [Qemu-devel] [PATCH 5/8] tests/bios-tables-test: Remove useless casts, Philippe Mathieu-Daudé, 2018/07/04
- [Qemu-devel] [PATCH 6/8] ui/vnc: Remove useless parenthesis around DIV_ROUND_UP macro, Philippe Mathieu-Daudé, 2018/07/04
- [Qemu-devel] [PATCH 8/8] hw/intc/gicv3: Remove useless parenthesis around DIV_ROUND_UP macro, Philippe Mathieu-Daudé, 2018/07/04
- [Qemu-devel] [PATCH 7/8] hw/pci-host: Remove useless parenthesis around DIV_ROUND_UP macro, Philippe Mathieu-Daudé, 2018/07/04
- Re: [Qemu-devel] [PATCH 0/8] Coccinelle cleanups, Markus Armbruster, 2018/07/05
- Re: [Qemu-devel] [PATCH 0/8] Coccinelle cleanups, Michael S. Tsirkin, 2018/07/05