1. 15 12月, 2015 1 次提交
    • G
      fw_cfg: amend callback behavior spec to once per select · 3bef7e8a
      Gabriel L. Somlo 提交于
      Currently, the fw_cfg internal API specifies that if an item was set up
      with a read callback, the callback must be run each time a byte is read
      from the item. This behavior is both wasteful (most items do not have a
      read callback set), and impractical for bulk transfers (e.g., DMA read).
      
      At the time of this writing, the only items configured with a callback
      are "/etc/table-loader", "/etc/acpi/tables", and "/etc/acpi/rsdp". They
      all share the same callback functions: virt_acpi_build_update() on ARM
      (in hw/arm/virt-acpi-build.c), and acpi_build_update() on i386 (in
      hw/i386/acpi.c). Both of these callbacks are one-shot (i.e. they return
      without doing anything at all after the first time they are invoked with
      a given build_state; since build_state is also shared across all three
      items mentioned above, the callback only ever runs *once*, the first
      time either of the listed items is read).
      
      This patch amends the specification for fw_cfg_add_file_callback() to
      state that any available read callback will only be invoked once each
      time the item is selected. This change has no practical effect on the
      current behavior of QEMU, and it enables us to significantly optimize
      the behavior of fw_cfg reads during guest firmware setup, eliminating
      a large amount of redundant callback checks and invocations.
      
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Marc Marí <markmb@redhat.com>
      Signed-off-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1446733972-1602-3-git-send-email-somlo@cmu.edu
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      3bef7e8a
  2. 23 10月, 2015 1 次提交
  3. 19 10月, 2015 2 次提交
  4. 11 9月, 2015 1 次提交
  5. 07 7月, 2015 1 次提交
    • D
      spapr: Merge sPAPREnvironment into sPAPRMachineState · 28e02042
      David Gibson 提交于
      The code for -machine pseries maintains a global sPAPREnvironment structure
      which keeps track of general state information about the guest platform.
      This predates the existence of the MachineState structure, but performs
      basically the same function.
      
      Now that we have the generic MachineState, fold sPAPREnvironment into
      sPAPRMachineState, the pseries specific subclass of MachineState.
      
      This is mostly a matter of search and replace, although a few places which
      relied on the global spapr variable are changed to find the structure via
      qdev_get_machine().
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      28e02042
  6. 10 6月, 2015 4 次提交
  7. 25 3月, 2015 1 次提交
    • G
      fw_cfg: factor out initialization of FW_CFG_ID (rev. number) · 3a5c76ba
      Gabriel L. Somlo 提交于
      The fw_cfg documentation says this of the revision key (0x0001, FW_CFG_ID):
      
      > A 32-bit little-endian unsigned int, this item is used as an interface
      > revision number, and is currently set to 1 by all QEMU architectures
      > which expose a fw_cfg device.
      
      arm/virt doesn't.  It could be argued that that's an error in
      "hw/arm/virt.c"; on the other hand, all of the other fw_cfg providing
      boards set the interface version to 1 manually, despite the device
      coming from the same, shared implementation. Therefore, instead of
      adding
      
          fw_cfg_add_i32(fw_cfg, FW_CFG_ID, 1);
      
      to arm/virt, consolidate all such existing calls in the fw_cfg
      initialization code.
      Signed-off-by: NGabriel Somlo <somlo@cmu.edu>
      Message-Id: <1426789244-26318-1-git-send-email-somlo@cmu.edu>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3a5c76ba
  8. 19 3月, 2015 1 次提交
    • S
      Fix remaining warnings from Sparse (void return) · e7ae771f
      Stefan Weil 提交于
      Sparse report:
      
      hw/display/vga.c:2000:5: warning: returning void-valued expression
      hw/intc/arm_gic.c:707:9: warning: returning void-valued expression
      hw/intc/etraxfs_pic.c:138:9: warning: returning void-valued expression
      hw/nvram/fw_cfg.c:475:5: warning: returning void-valued expression
      hw/timer/a9gtimer.c:124:5: warning: returning void-valued expression
      hw/tpm/tpm_tis.c:794:5: warning: returning void-valued expression
      hw/usb/hcd-musb.c:558:9: warning: returning void-valued expression
      hw/usb/hcd-musb.c:776:13: warning: returning void-valued expression
      hw/usb/hcd-musb.c:867:5: warning: returning void-valued expression
      hw/usb/hcd-musb.c:932:5: warning: returning void-valued expression
      include/qom/cpu.h:584:5: warning: returning void-valued expression
      monitor.c:4686:13: warning: returning void-valued expression
      monitor.c:4690:13: warning: returning void-valued expression
      
      Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Andreas Färber <afaerber@suse.de>
      Cc: Luiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      e7ae771f
  9. 09 3月, 2015 1 次提交
  10. 16 1月, 2015 1 次提交
    • L
      fw_cfg: fix endianness in fw_cfg_data_mem_read() / _write() · 36b62ae6
      Laszlo Ersek 提交于
      (1) Let's contemplate what device endianness means, for a memory mapped
      device register (independently of QEMU -- that is, on physical hardware).
      
      It determines the byte order that the device will put on the data bus when
      the device is producing a *numerical value* for the CPU. This byte order
      may differ from the CPU's own byte order, therefore when software wants to
      consume the *numerical value*, it may have to swap the byte order first.
      
      For example, suppose we have a device that exposes in a 2-byte register
      the number of sheep we have to count before falling asleep. If the value
      is decimal 37 (0x0025), then a big endian register will produce [0x00,
      0x25], while a little endian register will produce [0x25, 0x00].
      
      If the device register is big endian, but the CPU is little endian, the
      numerical value will read as 0x2500 (decimal 9472), which software has to
      byte swap before use.
      
      However... if we ask the device about who stole our herd of sheep, and it
      answers "XY", then the byte representation coming out of the register must
      be [0x58, 0x59], regardless of the device register's endianness for
      numeric values. And, software needs to copy these bytes into a string
      field regardless of the CPU's own endianness.
      
      (2) QEMU's device register accessor functions work with *numerical values*
      exclusively, not strings:
      
      The emulated register's read accessor function returns the numerical value
      (eg. 37 decimal, 0x0025) as a *host-encoded* uint64_t. QEMU translates
      this value for the guest to the endianness of the emulated device register
      (which is recorded in MemoryRegionOps.endianness). Then guest code must
      translate the numerical value from device register to guest CPU
      endianness, before including it in any computation (see (1)).
      
      (3) However, the data register of the fw_cfg device shall transfer strings
      *only* -- that is, opaque blobs. Interpretation of any given blob is
      subject to further agreement -- it can be an integer in an independently
      determined byte order, or a genuine string, or an array of structs of
      integers (in some byte order) and fixed size strings, and so on.
      
      Because register emulation in QEMU is integer-preserving, not
      string-preserving (see (2)), we have to jump through a few hoops.
      
      (3a) We defined the memory mapped fw_cfg data register as
      DEVICE_BIG_ENDIAN.
      
      The particular choice is not really relevant -- we picked BE only for
      consistency with the control register, which *does* transfer integers --
      but our choice affects how we must host-encode values from fw_cfg strings.
      
      (3b) Since we want the fw_cfg string "XY" to appear as the [0x58, 0x59]
      array on the data register, *and* we picked DEVICE_BIG_ENDIAN, we must
      compose the host (== C language) value 0x5859 in the read accessor
      function.
      
      (3c) When the guest performs the read access, the immediate uint16_t value
      will be 0x5958 (in LE guests) and 0x5859 (in BE guests). However, the
      uint16_t value does not matter. The only thing that matters is the byte
      pattern [0x58, 0x59], which the guest code must copy into the target
      string *without* any byte-swapping.
      
      (4) Now I get to explain where I screwed up. :(
      
      When we decided for big endian *integer* representation in the MMIO data
      register -- see (3a) --, I mindlessly added an indiscriminate
      byte-swizzling step to the (little endian) guest firmware.
      
      This was a grave error -- it violates (3c) --, but I didn't realize it. I
      only saw that the code I otherwise intended for fw_cfg_data_mem_read():
      
          value = 0;
          for (i = 0; i < size; ++i) {
              value = (value << 8) | fw_cfg_read(s);
          }
      
      didn't produce the expected result in the guest.
      
      In true facepalm style, instead of blaming my guest code (which violated
      (3c)), I blamed my host code (which was correct). Ultimately, I coded
      ldX_he_p() into fw_cfg_data_mem_read(), because that happened to work.
      
      Obviously (...in retrospect) that was wrong. Only because my host happened
      to be LE, ldX_he_p() composed the (otherwise incorrect) host value 0x5958
      from the fw_cfg string "XY". And that happened to compensate for the bogus
      indiscriminate byte-swizzling in my guest code.
      
      Clearly the current code leaks the host endianness through to the guest,
      which is wrong. Any device should work the same regardless of host
      endianness.
      
      The solution is to compose the host-endian representation (2) of the big
      endian interpretation (3a, 3b) of the fw_cfg string, and to drop the wrong
      byte-swizzling in the guest (3c).
      
      Brown paper bag time for me.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Message-id: 1420024880-15416-1-git-send-email-lersek@redhat.com
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      36b62ae6
  11. 23 12月, 2014 6 次提交
    • L
      fw_cfg_mem: expose the "data_width" property with fw_cfg_init_mem_wide() · 6c87e3d5
      Laszlo Ersek 提交于
      We rebase fw_cfg_init_mem() to the new function for compatibility with
      current callers.
      
      The behavior of the (big endian) multi-byte data reads is best shown
      with a qtest session.  Here, we are reading the first six bytes of
      the UUID
      
          $ arm-softmmu/qemu-system-arm -M virt -machine accel=qtest \
               -qtest stdio -uuid 4600cb32-38ec-4b2f-8acb-81c6ea54f2d8
      >>> writew 0x9020008 0x0200
      <<< OK
      >>> readl 0x9020000
      <<< OK 0x000000004600cb32
      
      Remember this is big endian.  On big endian machines, it is stored
      directly as 0x46 0x00 0xcb 0x32.
      
      On a little endian machine, we have to first swap it, so that it becomes
      0x32cb0046.  When written to memory, it becomes 0x46 0x00 0xcb 0x32
      again.
      
      Reading byte-by-byte works too, of course:
      
      >>> readb 0x9020000
      <<< OK 0x0000000000000038
      >>> readb 0x9020000
      <<< OK 0x00000000000000ec
      
      Here only a single byte is read at a time, so they are read in order
      similar to the 1-byte data port that is already in PPC and SPARC
      machines.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1419250305-31062-8-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6c87e3d5
    • L
      fw_cfg_mem: introduce the "data_width" property · cfaadf0e
      Laszlo Ersek 提交于
      The "data_width" property is capable of changing the maximum valid access
      size to the MMIO data register, and resizes the memory region similarly,
      at device realization time.
      
      The default value of "data_memwidth" is set so that we don't yet diverge
      from "fw_cfg_data_mem_ops".
      
      Most of the fw_cfg_mem users will stick with the default, and for them we
      should continue using the statically allocated "fw_cfg_data_mem_ops". This
      is beneficial for debugging because gdb can resolve pointers referencing
      static objects to the names of those objects.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1419250305-31062-7-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      cfaadf0e
    • L
      fw_cfg_mem: flip ctl_mem_ops and data_mem_ops to DEVICE_BIG_ENDIAN · d789c845
      Laszlo Ersek 提交于
      The standalone selector port (fw_cfg_ctl_mem_ops) is only used by big
      endian guests to date (*), hence this change doesn't regress them. Paolo
      and Alex have suggested / requested an explicit DEVICE_BIG_ENDIAN setting
      here, for clarity.
      
      (*) git grep -l fw_cfg_init_mem
      
          hw/nvram/fw_cfg.c
          hw/ppc/mac_newworld.c
          hw/ppc/mac_oldworld.c
          hw/sparc/sun4m.c
          include/hw/nvram/fw_cfg.h
      
      The standalone data port (fw_cfg_data_mem_ops) has max_access_size 1 (for
      now), hence changing its endianness doesn't change behavior for existing
      guest code.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1419250305-31062-5-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d789c845
    • L
      fw_cfg_mem: max access size and region size are the same for data register · 86099db3
      Laszlo Ersek 提交于
      Make it clear that the maximum access size to the MMIO data register
      determines the full size of the memory region.
      
      Currently the max access size is 1.
      
      This patch doesn't change behavior.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1419250305-31062-4-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      86099db3
    • L
      fw_cfg: move boards to fw_cfg_init_io() / fw_cfg_init_mem() · 66708822
      Laszlo Ersek 提交于
      This allows us to drop the fw_cfg_init() shim and to enforce the possible
      mappings at compile time.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1419250305-31062-3-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      66708822
    • L
      fw_cfg: hard separation between the MMIO and I/O port mappings · 5712db6a
      Laszlo Ersek 提交于
      We are going to introduce a wide data register for fw_cfg, but only for
      the MMIO mapped device. The wide data register will also require the
      tightening of endiannesses.
      
      However we don't want to touch the I/O port mapped fw_cfg device at all.
      
      Currently QEMU provides a single fw_cfg device type that can handle both
      I/O port and MMIO mapping. This flexibility is not actually exploited by
      any board in the tree, but it renders restricting the above changes to
      MMIO very hard.
      
      Therefore, let's derive two classes from TYPE_FW_CFG: TYPE_FW_CFG_IO and
      TYPE_FW_CFG_MEM.
      
      TYPE_FW_CFG_IO incorporates the base I/O port and the related combined
      MemoryRegion. (NB: all boards in the tree that use the I/O port mapped
      flavor opt for the combined mapping; that is, when the data port overlays
      the high address byte of the selector port. Therefore we can drop the
      capability to map those I/O ports separately.)
      
      TYPE_FW_CFG_MEM incorporates the base addresses for the MMIO selector and
      data registers, and their respective MemoryRegions.
      
      The "realize" and "props" class members are specific to each new derived
      class, and become unused for the base class. The base class retains the
      "reset" member and the "vmsd" member, because the reset functionality and
      the set of migrated data are not specific to the mapping.
      
      The new functions fw_cfg_init_io() and fw_cfg_init_mem() expose the
      possible mappings in separation. For now fw_cfg_init() is retained as a
      compatibility shim that enforces the above assumptions.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1419250305-31062-2-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5712db6a
  12. 10 12月, 2014 1 次提交
  13. 26 11月, 2014 1 次提交
  14. 05 11月, 2014 1 次提交
    • A
      spapr_nvram: Enable migration · f58aa483
      Alexey Kardashevskiy 提交于
      The only case when sPAPR NVRAM migrates now is if is backed by a file and
      copy-storage migration is performed. In other cases NVRAM does not
      migrate regardless whether it is backed by a file or not.
      
      This enables shadow copy of NVRAM in RAM which is read from a file
      (if used) and used for reads. Writes to NVRAM are mirrored to the file.
      
      This defines a VMSTATE descriptor for NVRAM device so the memory copy
      of NVRAM can migrate and be flushed to a backing file on the destination
      if one is specified.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      f58aa483
  15. 20 10月, 2014 1 次提交
    • M
      hw: Convert from BlockDriverState to BlockBackend, mostly · 4be74634
      Markus Armbruster 提交于
      Device models should access their block backends only through the
      block-backend.h API.  Convert them, and drop direct includes of
      inappropriate headers.
      
      Just four uses of BlockDriverState are left:
      
      * The Xen paravirtual block device backend (xen_disk.c) opens images
        itself when set up via xenbus, bypassing blockdev.c.  I figure it
        should go through qmp_blockdev_add() instead.
      
      * Device model "usb-storage" prompts for keys.  No other device model
        does, and this one probably shouldn't do it, either.
      
      * ide_issue_trim_cb() uses bdrv_aio_discard() instead of
        blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
        which has only the BlockDriverState.
      
      * PC87312State has an unused BlockDriverState[] member.
      
      The next two commits take care of the latter two.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be74634
  16. 15 10月, 2014 1 次提交
  17. 08 9月, 2014 3 次提交
    • A
      PPC: mac_nvram: Split NVRAM into OF and OSX parts · 2d9907a3
      Alexander Graf 提交于
      Mac OS X (at least with -M mac99) searches for a valid NVRAM partition
      of a special Apple type. If it can't find that partition in the first
      half of NVRAM, it will look at the second half.
      
      There are a few implications from this. The first is that we need to
      split NVRAM into 2 halves - one for Open Firmware use, the other one for
      Mac OS X. Without this split Mac OS X will just loop endlessly over the
      second half trying to find a partition.
      
      The other implication is that we should provide a specially crafted Mac
      OS X compatible NVRAM partition on the second half that Mac OS X can
      happily use as it sees fit.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      2d9907a3
    • A
      PPC: mac_nvram: Allow 2 and 4 byte accesses · b19eae18
      Alexander Graf 提交于
      The NVRAM in our Core99 machine really supports 2byte and 4byte accesses
      just as well as 1byte accesses. In fact, Mac OS X uses those.
      
      Add support for higher register size granularities.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      b19eae18
    • A
      PPC: mac_nvram: Remove unused functions · a8b05037
      Alexander Graf 提交于
      The macio_nvram_read and macio_nvram_write functions are never called,
      just remove them.
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      a8b05037
  18. 27 6月, 2014 1 次提交
    • A
      spapr: Fix RTAS token numbers · 3a3b8502
      Alexey Kardashevskiy 提交于
      At the moment spapr_rtas_register() allocates a new token number for every
      new RTAS callback so numbers are not fixed and depend on the number of
      supported RTAS handlers and the exact order of spapr_rtas_register() calls.
      These tokens are copied into the device tree and remain the same during
      the guest lifetime.
      
      When we start another guest to receive a migration, it calls
      spapr_rtas_register() as well. If the number of RTAS handlers or their
      order is different in QEMU on source and destination sides, the "/rtas"
      node in the device tree will differ. Since migration overwrites the device
      tree (as it overwrites the entire RAM), the actual RTAS config on
      the destination side gets broken.
      
      This defines global contant values for every RTAS token which QEMU
      is using today.
      
      This changes spapr_rtas_register() to accept a token number instead of
      allocating one. This changes all users of spapr_rtas_register().
      
      This changes XICS-KVM not to cache tokens registered with KVM as they
      constant now.
      
      This makes TOKEN_BASE global as RTAS_XXX use TOKEN_BASE as
      a base. TOKEN_MAX is moved and renamed too and its value is changed
      to the last token + 1. Boundary checks for token values are adjusted.
      
      This reserves token numbers for "os-term" handlers and PCI hotplug
      which we are working on.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      3a3b8502
  19. 16 6月, 2014 2 次提交
  20. 14 5月, 2014 1 次提交
  21. 20 3月, 2014 1 次提交
  22. 15 2月, 2014 1 次提交
  23. 23 12月, 2013 2 次提交
    • M
      sysbus: Set cannot_instantiate_with_device_add_yet · 837d3716
      Markus Armbruster 提交于
      device_add plugs devices into suitable bus.  For "real" buses, that
      actually connects the device.  For sysbus, the connections need to be
      made separately, and device_add can't do that.  The device would be
      left unconnected, and could not possibly work.
      
      Quite a few, but not all sysbus devices already set
      cannot_instantiate_with_device_add_yet in their class init function.
      
      Set it in their abstract base's class init function
      sysbus_device_class_init(), and remove the now redundant assignments
      from device class init functions.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel.a@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      837d3716
    • M
      qdev: Replace no_user by cannot_instantiate_with_device_add_yet · efec3dd6
      Markus Armbruster 提交于
      In an ideal world, machines can be built by wiring devices together
      with configuration, not code.  Unfortunately, that's not the world we
      live in right now.  We still have quite a few devices that need to be
      wired up by code.  If you try to device_add such a device, it'll fail
      in sometimes mysterious ways.  If you're lucky, you get an
      unmysterious immediate crash.
      
      To protect users from such badness, DeviceClass member no_user used to
      make device models unavailable with -device / device_add, but that
      regressed in commit 18b6dade.  The device model is still omitted from
      help, but is available anyway.
      
      Attempts to fix the regression have been rejected with the argument
      that the purpose of no_user isn't clear, and it's prone to misuse.
      
      This commit clarifies no_user's purpose.  Anthony suggested to rename
      it cannot_instantiate_with_device_add_yet_due_to_internal_bugs, which
      I shorten somewhat to keep checkpatch happy.  While there, make it
      bool.
      
      Every use of cannot_instantiate_with_device_add_yet gets a FIXME
      comment asking for rationale.  The next few commits will clean them
      all up, either by providing a rationale, or by getting rid of the use.
      
      With that done, the regression fix is hopefully acceptable.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel.a@redhat.com>
      Signed-off-by: NAndreas Färber <afaerber@suse.de>
      efec3dd6
  24. 20 12月, 2013 1 次提交
  25. 07 12月, 2013 1 次提交
    • A
      eeprom93xx: fix coding style · 6fedcaa1
      Antony Pavlov 提交于
      scripts/checkpatch.pl reports about some style problems,
      this commit fixes some of them:
      
      ERROR: space prohibited before open square bracket '['
      +    .fields      = (VMStateField []) {
      
      ERROR: space prohibited after that '!' (ctx:BxW)
      +    if (! eeprom->eecs && eecs) {
               ^
      
      ERROR: space prohibited after that '!' (ctx:WxW)
      +    } else if (eeprom->eecs && ! eecs) {
                                      ^
      
      ERROR: space prohibited after that '!' (ctx:WxW)
      +    } else if (eecs && ! eeprom->eesk && eesk) {
                              ^
      
      ERROR: switch and case should be at the same indent
                           switch (address >> (eeprom->addrbits - 2)) {
      +                        case 0:
      [...]
      +                        case 1:
      [...]
      +                        case 2:
      [...]
      +                        case 3:
      
      ERROR: return is not a function, parentheses are not required
      +    return (eeprom->eedo);
      
      ERROR: switch and case should be at the same indent
           switch (nwords) {
      +        case 16:
      +        case 64:
      [...]
      +        case 128:
      +        case 256:
      [...]
      +        default:
      Signed-off-by: NAntony Pavlov <antonynpavlov@gmail.com>
      Cc: Stefan Weil <sw@weilnetz.de>
      Reviewed-by: NStefan Weil <sw@weilnetz.de>
      Cc: qemu-trivial@nongnu.org
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      6fedcaa1
  26. 08 11月, 2013 1 次提交
  27. 14 10月, 2013 1 次提交