qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups
@ 2020-06-28 14:24 Peter Maydell
  2020-06-28 14:24 ` [PATCH 01/17] hw/arm/spitz: Detabify Peter Maydell
                   ` (17 more replies)
  0 siblings, 18 replies; 50+ messages in thread
From: Peter Maydell @ 2020-06-28 14:24 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: Philippe Mathieu-Daudé, Alistair Francis

This series of patches makes various cleanups to the spitz board
family code; the main driver here was fixing the minor Coverity
nit CID 1421913, which is a complaint that the call to
qemu_allocate_irqs() creates memory that is leaked.

We fix this by replacing the free-standing irq array and
callback function with a proper QOM device TYPE_SPITZ_MISC_GPIO,
which can have its own GPIO inputs and outputs which we can wire
up as appropriate. This also allows us to remove the ugly
file-scope variables that pointed to some of the devices on the
board so that the old callback function could prod them.

For this to work we need to add QOM properties and input GPIOs
to the max111x ADC devices so that we can control them that
way rather than by direct calls to max111x_set_input().
While we're in that bit of old code we take the opportunity to
get rid of its call to vmstate_register() and to give it a reset
method and a header file so we can document it a bit better.

The last few patches are unrelated cleanup that I noticed in
passing: we reduce the use of the zaurus_printf() macro in favour
of LOG_GUEST_ERROR logging for bad register accesess, and we
get rid of the old FROM_SSI_SLAVE which can be replaced with
QOM cast macros.

Patch 1 removes the hardcoded tabs in spitz.c, because they've
escaped our usual "fix as we touch a file" policy long enough,
and it's easier to do a wholesale detabify of the file before
starting.

As you review this series you might notice some other things in the
code that could also be cleaned up; so did I, but I felt that
17 patches was quite enough to be going on with :-)

thanks
-- PMM

Peter Maydell (17):
  hw/arm/spitz: Detabify
  hw/arm/spitz: Create SpitzMachineClass abstract base class
  hw/arm/spitz: Keep pointers to MPU and SSI devices in
    SpitzMachineState
  hw/arm/spitz: Keep pointers to scp0, scp1 in SpitzMachineState
  hw/arm/spitz: Implement inbound GPIO lines for bit5 and power signals
  hw/misc/max111x: provide QOM properties for setting initial values
  hw/misc/max111x: Don't use vmstate_register()
  ssi: Add ssi_realize_and_unref()
  hw/arm/spitz: Use max111x properties to set initial values
  hw/misc/max111x: Use GPIO lines rather than max111x_set_input()
  hw/misc/max111x: Create header file for documentation, TYPE_ macros
  hw/arm/spitz: Encapsulate misc GPIO handling in a device
  hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses
  hw/arm/spitz: Use LOG_GUEST_ERROR for bad guest register accesses
  hw/arm/pxa2xx_pic: Use LOG_GUEST_ERROR for bad guest register accesses
  hw/arm/spitz: Provide usual QOM macros for corgi-ssp and spitz-lcdtg
  Replace uses of FROM_SSI_SLAVE() macro with QOM casts

 include/hw/arm/pxa.h      |   1 -
 include/hw/arm/sharpsl.h  |   3 -
 include/hw/misc/max111x.h |  57 +++++
 include/hw/ssi/ssi.h      |  31 ++-
 hw/arm/pxa2xx_pic.c       |   9 +-
 hw/arm/spitz.c            | 507 ++++++++++++++++++++++----------------
 hw/arm/z2.c               |  11 +-
 hw/display/ads7846.c      |   9 +-
 hw/display/ssd0323.c      |  10 +-
 hw/gpio/zaurus.c          |  12 +-
 hw/misc/max111x.c         |  87 ++++---
 hw/sd/ssi-sd.c            |   4 +-
 hw/ssi/ssi.c              |   7 +-
 MAINTAINERS               |   1 +
 14 files changed, 474 insertions(+), 275 deletions(-)
 create mode 100644 include/hw/misc/max111x.h

-- 
2.20.1



^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2020-07-02 18:34 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-28 14:24 [PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups Peter Maydell
2020-06-28 14:24 ` [PATCH 01/17] hw/arm/spitz: Detabify Peter Maydell
2020-06-29  8:49   ` Philippe Mathieu-Daudé
2020-06-29 19:30   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 02/17] hw/arm/spitz: Create SpitzMachineClass abstract base class Peter Maydell
2020-06-29  8:55   ` Philippe Mathieu-Daudé
2020-06-29 14:03     ` Peter Maydell
2020-06-28 14:24 ` [PATCH 03/17] hw/arm/spitz: Keep pointers to MPU and SSI devices in SpitzMachineState Peter Maydell
2020-06-29 19:36   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 04/17] hw/arm/spitz: Keep pointers to scp0, scp1 " Peter Maydell
2020-06-29 19:38   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 05/17] hw/arm/spitz: Implement inbound GPIO lines for bit5 and power signals Peter Maydell
2020-06-30 20:45   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 06/17] hw/misc/max111x: provide QOM properties for setting initial values Peter Maydell
2020-06-29  9:01   ` Philippe Mathieu-Daudé
2020-06-30 20:51   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 07/17] hw/misc/max111x: Don't use vmstate_register() Peter Maydell
2020-06-29  9:01   ` Philippe Mathieu-Daudé
2020-06-30 20:52   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 08/17] ssi: Add ssi_realize_and_unref() Peter Maydell
2020-06-29  9:02   ` Philippe Mathieu-Daudé
2020-06-30 20:55   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 09/17] hw/arm/spitz: Use max111x properties to set initial values Peter Maydell
2020-06-29  9:09   ` Philippe Mathieu-Daudé
2020-06-29 14:05     ` Peter Maydell
2020-06-28 14:24 ` [PATCH 10/17] hw/misc/max111x: Use GPIO lines rather than max111x_set_input() Peter Maydell
2020-07-01  0:37   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 11/17] hw/misc/max111x: Create header file for documentation, TYPE_ macros Peter Maydell
2020-06-29  8:29   ` Philippe Mathieu-Daudé
2020-06-29 12:07     ` Peter Maydell
2020-06-29 14:57       ` Philippe Mathieu-Daudé
2020-06-28 14:24 ` [PATCH 12/17] hw/arm/spitz: Encapsulate misc GPIO handling in a device Peter Maydell
2020-06-29  9:12   ` Philippe Mathieu-Daudé
2020-07-02 17:39   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 13/17] hw/gpio/zaurus.c: Use LOG_GUEST_ERROR for bad guest register accesses Peter Maydell
2020-06-29  9:13   ` Philippe Mathieu-Daudé
2020-07-01  0:38   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 14/17] hw/arm/spitz: " Peter Maydell
2020-06-29  9:14   ` Philippe Mathieu-Daudé
2020-07-01  0:52   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 15/17] hw/arm/pxa2xx_pic: " Peter Maydell
2020-06-29  9:14   ` Philippe Mathieu-Daudé
2020-07-01  0:52   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 16/17] hw/arm/spitz: Provide usual QOM macros for corgi-ssp and spitz-lcdtg Peter Maydell
2020-06-29  9:17   ` Philippe Mathieu-Daudé
2020-07-02 17:51   ` Alistair Francis
2020-06-28 14:24 ` [PATCH 17/17] Replace uses of FROM_SSI_SLAVE() macro with QOM casts Peter Maydell
2020-06-29  9:18   ` Philippe Mathieu-Daudé
2020-07-02 18:23   ` Alistair Francis
2020-06-28 14:43 ` [PATCH 00/17] spitz: fix hacks, fix CID 1421913, various cleanups no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).