Message ID | 1398091304-10677-3-git-send-email-quintela@redhat.com |
---|---|
State | New |
Headers | show |
Eric Blake <eblake@redhat.com> wrote: > On 04/21/2014 08:39 AM, Juan Quintela wrote: > > s/unneded/unneeded/ in the subject > >> After previous Peter patch, they are redundant. This way we don't asign them > > s/asign/assign/ > >> except when needed. Once there, there were lots of case where the ".fields" >> indentation was wrong: >> >> .fields = (VMStateField []) { >> and >> .fields = (VMStateField []) { >> >> Change all the combinations to: >> >> .fields = (VMStateField[]){ >> >> The biggest problem (appart of aesthetics) was that checkpatch complained > > s/appart of/apart from/ > >> when we copy&pasted the code from one place to another. >> >> Signed-off-by: Juan Quintela <quintela@redhat.com> >> --- Applied all of your fixes. Thanks a lot.
Juan Quintela <quintela@redhat.com> wrote: kraxel, could you ack this? And should this got it through my tree or yours? Thanks, Juan. > After previous Peter patch, they are redundant. This way we don't asign them > except when needed. Once there, there were lots of case where the ".fields" > indentation was wrong: > > .fields = (VMStateField []) { > and > .fields = (VMStateField []) { > > Change all the combinations to: > > .fields = (VMStateField[]){ > > The biggest problem (appart of aesthetics) was that checkpatch complained > when we copy&pasted the code from one place to another. > > Signed-off-by: Juan Quintela <quintela@redhat.com> > --- > hw/usb/bus.c | 2 +- > hw/usb/dev-hid.c | 4 ++-- > hw/usb/dev-hub.c | 4 ++-- > hw/usb/dev-storage.c | 2 +- > hw/usb/hcd-ehci-pci.c | 2 +- > hw/usb/hcd-ehci-sysbus.c | 2 +- > hw/usb/hcd-ehci.c | 2 +- > hw/usb/hcd-uhci.c | 6 ++---- > 8 files changed, 11 insertions(+), 13 deletions(-) > > diff --git a/hw/usb/bus.c b/hw/usb/bus.c > index fe70429..5f201cb 100644 > --- a/hw/usb/bus.c > +++ b/hw/usb/bus.c > @@ -61,7 +61,7 @@ const VMStateDescription vmstate_usb_device = { > .version_id = 1, > .minimum_version_id = 1, > .post_load = usb_device_post_load, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_UINT8(addr, USBDevice), > VMSTATE_INT32(state, USBDevice), > VMSTATE_INT32(remote_wakeup, USBDevice), > diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c > index f36e617..d097d93 100644 > --- a/hw/usb/dev-hid.c > +++ b/hw/usb/dev-hid.c > @@ -622,7 +622,7 @@ static const VMStateDescription vmstate_usb_ptr = { > .version_id = 1, > .minimum_version_id = 1, > .post_load = usb_ptr_post_load, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_USB_DEVICE(dev, USBHIDState), > VMSTATE_HID_POINTER_DEVICE(hid, USBHIDState), > VMSTATE_END_OF_LIST() > @@ -633,7 +633,7 @@ static const VMStateDescription vmstate_usb_kbd = { > .name = "usb-kbd", > .version_id = 1, > .minimum_version_id = 1, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_USB_DEVICE(dev, USBHIDState), > VMSTATE_HID_KEYBOARD_DEVICE(hid, USBHIDState), > VMSTATE_END_OF_LIST() > diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c > index bc03531..7492174 100644 > --- a/hw/usb/dev-hub.c > +++ b/hw/usb/dev-hub.c > @@ -540,7 +540,7 @@ static const VMStateDescription vmstate_usb_hub_port = { > .name = "usb-hub-port", > .version_id = 1, > .minimum_version_id = 1, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_UINT16(wPortStatus, USBHubPort), > VMSTATE_UINT16(wPortChange, USBHubPort), > VMSTATE_END_OF_LIST() > @@ -551,7 +551,7 @@ static const VMStateDescription vmstate_usb_hub = { > .name = "usb-hub", > .version_id = 1, > .minimum_version_id = 1, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_USB_DEVICE(dev, USBHubState), > VMSTATE_STRUCT_ARRAY(ports, USBHubState, NUM_PORTS, 0, > vmstate_usb_hub_port, USBHubPort), > diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c > index 2852669..e919100 100644 > --- a/hw/usb/dev-storage.c > +++ b/hw/usb/dev-storage.c > @@ -716,7 +716,7 @@ static const VMStateDescription vmstate_usb_msd = { > .name = "usb-storage", > .version_id = 1, > .minimum_version_id = 1, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_USB_DEVICE(dev, MSDState), > VMSTATE_UINT32(mode, MSDState), > VMSTATE_UINT32(scsi_len, MSDState), > diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c > index 484a9bd..505741a 100644 > --- a/hw/usb/hcd-ehci-pci.c > +++ b/hw/usb/hcd-ehci-pci.c > @@ -108,7 +108,7 @@ static const VMStateDescription vmstate_ehci_pci = { > .name = "ehci", > .version_id = 2, > .minimum_version_id = 1, > - .fields = (VMStateField[]) { > + .fields = (VMStateField[]) { > VMSTATE_PCI_DEVICE(pcidev, EHCIPCIState), > VMSTATE_STRUCT(ehci, EHCIPCIState, 2, vmstate_ehci, EHCIState), > VMSTATE_END_OF_LIST() > diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c > index fe6eea5..19ed2c2 100644 > --- a/hw/usb/hcd-ehci-sysbus.c > +++ b/hw/usb/hcd-ehci-sysbus.c > @@ -21,7 +21,7 @@ static const VMStateDescription vmstate_ehci_sysbus = { > .name = "ehci-sysbus", > .version_id = 2, > .minimum_version_id = 1, > - .fields = (VMStateField[]) { > + .fields = (VMStateField[]) { > VMSTATE_STRUCT(ehci, EHCISysBusState, 2, vmstate_ehci, EHCIState), > VMSTATE_END_OF_LIST() > } > diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c > index 355bbd6..a3ae9f2 100644 > --- a/hw/usb/hcd-ehci.c > +++ b/hw/usb/hcd-ehci.c > @@ -2492,7 +2492,7 @@ const VMStateDescription vmstate_ehci = { > .minimum_version_id = 1, > .pre_save = usb_ehci_pre_save, > .post_load = usb_ehci_post_load, > - .fields = (VMStateField[]) { > + .fields = (VMStateField[]) { > /* mmio registers */ > VMSTATE_UINT32(usbcmd, EHCIState), > VMSTATE_UINT32(usbsts, EHCIState), > diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c > index 0820244..9b1166b 100644 > --- a/hw/usb/hcd-uhci.c > +++ b/hw/usb/hcd-uhci.c > @@ -422,8 +422,7 @@ static const VMStateDescription vmstate_uhci_port = { > .name = "uhci port", > .version_id = 1, > .minimum_version_id = 1, > - .minimum_version_id_old = 1, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_UINT16(ctrl, UHCIPort), > VMSTATE_END_OF_LIST() > } > @@ -444,9 +443,8 @@ static const VMStateDescription vmstate_uhci = { > .name = "uhci", > .version_id = 3, > .minimum_version_id = 1, > - .minimum_version_id_old = 1, > .post_load = uhci_post_load, > - .fields = (VMStateField []) { > + .fields = (VMStateField[]) { > VMSTATE_PCI_DEVICE(dev, UHCIState), > VMSTATE_UINT8_EQUAL(num_ports_vmstate, UHCIState), > VMSTATE_STRUCT_ARRAY(ports, UHCIState, NB_PORTS, 1,
On Mo, 2014-05-12 at 13:00 +0200, Juan Quintela wrote: > Juan Quintela <quintela@redhat.com> wrote: > > kraxel, could you ack this? Sure, ObviouslyCorrect cleanup ;) Acked-by: Gerd Hoffmann <kraxel@redhat.com> > And should this got it through my tree or yours? Taking this through your vmstate tree is fine with me (and I think it's easier that way as the patch is there already ;) cheers, Gerd
diff --git a/hw/usb/bus.c b/hw/usb/bus.c index fe70429..5f201cb 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -61,7 +61,7 @@ const VMStateDescription vmstate_usb_device = { .version_id = 1, .minimum_version_id = 1, .post_load = usb_device_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT8(addr, USBDevice), VMSTATE_INT32(state, USBDevice), VMSTATE_INT32(remote_wakeup, USBDevice), diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c index f36e617..d097d93 100644 --- a/hw/usb/dev-hid.c +++ b/hw/usb/dev-hid.c @@ -622,7 +622,7 @@ static const VMStateDescription vmstate_usb_ptr = { .version_id = 1, .minimum_version_id = 1, .post_load = usb_ptr_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, USBHIDState), VMSTATE_HID_POINTER_DEVICE(hid, USBHIDState), VMSTATE_END_OF_LIST() @@ -633,7 +633,7 @@ static const VMStateDescription vmstate_usb_kbd = { .name = "usb-kbd", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, USBHIDState), VMSTATE_HID_KEYBOARD_DEVICE(hid, USBHIDState), VMSTATE_END_OF_LIST() diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index bc03531..7492174 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -540,7 +540,7 @@ static const VMStateDescription vmstate_usb_hub_port = { .name = "usb-hub-port", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT16(wPortStatus, USBHubPort), VMSTATE_UINT16(wPortChange, USBHubPort), VMSTATE_END_OF_LIST() @@ -551,7 +551,7 @@ static const VMStateDescription vmstate_usb_hub = { .name = "usb-hub", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, USBHubState), VMSTATE_STRUCT_ARRAY(ports, USBHubState, NUM_PORTS, 0, vmstate_usb_hub_port, USBHubPort), diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 2852669..e919100 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -716,7 +716,7 @@ static const VMStateDescription vmstate_usb_msd = { .name = "usb-storage", .version_id = 1, .minimum_version_id = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, MSDState), VMSTATE_UINT32(mode, MSDState), VMSTATE_UINT32(scsi_len, MSDState), diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 484a9bd..505741a 100644 --- a/hw/usb/hcd-ehci-pci.c +++ b/hw/usb/hcd-ehci-pci.c @@ -108,7 +108,7 @@ static const VMStateDescription vmstate_ehci_pci = { .name = "ehci", .version_id = 2, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_PCI_DEVICE(pcidev, EHCIPCIState), VMSTATE_STRUCT(ehci, EHCIPCIState, 2, vmstate_ehci, EHCIState), VMSTATE_END_OF_LIST() diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c index fe6eea5..19ed2c2 100644 --- a/hw/usb/hcd-ehci-sysbus.c +++ b/hw/usb/hcd-ehci-sysbus.c @@ -21,7 +21,7 @@ static const VMStateDescription vmstate_ehci_sysbus = { .name = "ehci-sysbus", .version_id = 2, .minimum_version_id = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { VMSTATE_STRUCT(ehci, EHCISysBusState, 2, vmstate_ehci, EHCIState), VMSTATE_END_OF_LIST() } diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 355bbd6..a3ae9f2 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -2492,7 +2492,7 @@ const VMStateDescription vmstate_ehci = { .minimum_version_id = 1, .pre_save = usb_ehci_pre_save, .post_load = usb_ehci_post_load, - .fields = (VMStateField[]) { + .fields = (VMStateField[]) { /* mmio registers */ VMSTATE_UINT32(usbcmd, EHCIState), VMSTATE_UINT32(usbsts, EHCIState), diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 0820244..9b1166b 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -422,8 +422,7 @@ static const VMStateDescription vmstate_uhci_port = { .name = "uhci port", .version_id = 1, .minimum_version_id = 1, - .minimum_version_id_old = 1, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_UINT16(ctrl, UHCIPort), VMSTATE_END_OF_LIST() } @@ -444,9 +443,8 @@ static const VMStateDescription vmstate_uhci = { .name = "uhci", .version_id = 3, .minimum_version_id = 1, - .minimum_version_id_old = 1, .post_load = uhci_post_load, - .fields = (VMStateField []) { + .fields = (VMStateField[]) { VMSTATE_PCI_DEVICE(dev, UHCIState), VMSTATE_UINT8_EQUAL(num_ports_vmstate, UHCIState), VMSTATE_STRUCT_ARRAY(ports, UHCIState, NB_PORTS, 1,
After previous Peter patch, they are redundant. This way we don't asign them except when needed. Once there, there were lots of case where the ".fields" indentation was wrong: .fields = (VMStateField []) { and .fields = (VMStateField []) { Change all the combinations to: .fields = (VMStateField[]){ The biggest problem (appart of aesthetics) was that checkpatch complained when we copy&pasted the code from one place to another. Signed-off-by: Juan Quintela <quintela@redhat.com> --- hw/usb/bus.c | 2 +- hw/usb/dev-hid.c | 4 ++-- hw/usb/dev-hub.c | 4 ++-- hw/usb/dev-storage.c | 2 +- hw/usb/hcd-ehci-pci.c | 2 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ehci.c | 2 +- hw/usb/hcd-uhci.c | 6 ++---- 8 files changed, 11 insertions(+), 13 deletions(-)