qemu-patch-raspberry4/include/hw
Markus Armbruster f26740c61a smbus: Fix spd_data_generate() error API violation
The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

spd_data_generate() can pass @errp to error_setg() more than once when
it adjusts both memory size and type.  Harmless, because no caller
passes anything that needs adjusting.  Until the previous commit,
sam460ex passed types that needed adjusting, but not sizes.

spd_data_generate()'s contract is rather awkward:

    If everything's fine, return non-null and don't set an error.

    Else, if memory size or type need adjusting, return non-null and
    set an error describing the adjustment.

    Else, return null and set an error reporting why no data can be
    generated.

Its callers treat the error as a warning even when null is returned.
They don't create the "smbus-eeprom" device then.  Suspicious.

Since the previous commit, only "everything's fine" can actually
happen.  Drop the unused code and simplify the callers.  This gets rid
of the error API violation.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200422134815.1584-3-armbru@redhat.com>
2020-04-29 08:01:52 +02:00
..
acpi acpi: Use macro for table-loader file name 2020-04-13 06:55:54 -04:00
adc include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
arm acpi: add acpi=OnOffAuto machine property to x86 and arm virt 2020-03-29 09:52:13 -04:00
audio Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
block block: Support providing LCHS from user 2019-10-31 11:47:11 -04:00
char hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
core x86 and machine queue for 5.0 soft freeze 2020-03-19 14:22:46 +00:00
cpu Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
cris etraxfs: remove PROP_PTR usage 2020-01-07 17:24:29 +04:00
display hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
dma hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
firmware machine: Refactor smp-related call chains to pass MachineState 2019-07-05 17:07:36 -03:00
gpio hw/gpio: Add basic Aspeed GPIO model for AST2400 and AST2500 2019-09-13 16:05:00 +01:00
hyperv hyperv: process POST_MESSAGE hypercall 2018-10-19 13:44:14 +02:00
i2c smbus: Fix spd_data_generate() error API violation 2020-04-29 08:01:52 +02:00
i386 hw/i386: Introduce apicid functions inside X86MachineState 2020-03-31 19:13:32 -03:00
ide hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h 2020-03-17 12:22:36 -04:00
input hppa: add emulation of LASI PS2 controllers 2020-01-27 10:49:51 -08:00
intc hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
ipack Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ipmi ipmi: Add support to customize OEM functions 2019-12-17 10:39:47 +11:00
isa hw/isa/superio: Correct the license text 2020-04-01 19:00:16 +02:00
kvm Supply missing header guards 2019-06-12 13:20:21 +02:00
lm32 Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
m68k m68k: Add NeXTcube machine 2019-09-07 08:31:51 +02:00
mem nvdimm: add uuid property to nvdimm 2020-02-21 09:15:04 +11:00
mips Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
misc hw/arm/bcm283x: Correct the license text 2020-03-23 17:22:30 +00:00
net hw/arm/allwinner-h3: add EMAC ethernet device 2020-03-12 16:27:33 +00:00
nubus hw/m68k: add Nubus support 2019-10-28 19:06:47 +01:00
nvram fw_cfg: Migrate ACPI table mr sizes separately 2020-04-13 06:55:54 -04:00
pci pcie_root_port: Add hotplug disabling option 2020-03-08 09:18:29 -04:00
pci-bridge Supply missing header guards 2019-06-12 13:20:21 +02:00
pci-host hw/pci-host/q35: Remove unused includes 2020-03-09 15:59:31 +01:00
ppc ppc/pnv: Create BMC devices only when defaults are enabled 2020-04-07 08:55:11 +10:00
rdma {hmp, hw/pvrdma}: Expose device internals via monitor interface 2019-03-16 15:52:44 +02:00
riscv hw/riscv: Provide rdtime callback for TCG in CLINT emulation 2020-02-27 13:46:37 -08:00
rtc hw/arm/allwinner: add RTC device support 2020-03-12 16:27:33 +00:00
s390x misc: Replace zero-length arrays with flexible array member (manual) 2020-03-16 22:07:42 +01:00
scsi scsi: Propagate unrealize() callback to scsi-hd 2019-10-31 11:47:25 -04:00
sd hw/arm/allwinner: add SD/MMC host controller 2020-03-12 16:27:33 +00:00
semihosting semihosting: add qemu_semihosting_console_inc for SYS_READC 2020-01-09 11:41:29 +00:00
sh4 Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
southbridge hw/ide: Do ide_drive_get() within pci_ide_create_devs() 2020-03-17 12:22:36 -04:00
sparc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ssi aspeed/smc: Add AST2600 timings registers 2019-12-16 10:46:34 +00:00
timer Fix typos and docs, trivial changes and RTC devices split 2019-10-25 14:17:08 +01:00
tricore Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
unicore32 hw/unicore32: restrict hw addr defines to source file 2017-12-18 17:07:02 +03:00
usb hw/usb: Add basic i.MX USB Phy support 2020-03-17 11:23:14 +00:00
vfio vfio: Turn the container error into an Error handle 2019-10-04 18:49:18 +02:00
virtio fix vhost_user_blk_watch crash 2020-03-29 09:52:13 -04:00
watchdog watchdog/aspeed: Fix AST2600 frequency behaviour 2019-12-16 10:46:34 +00:00
xen xen-bus/block: explicitly assign event channels to an AioContext 2020-02-27 11:50:30 +00:00
xtensa Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
boards.h vl/s390x: fixup ram sizes for compat machines 2020-04-02 17:10:09 +02:00
elf_ops.h elf-ops: bail out if we have no function symbols 2020-04-07 16:19:49 +01:00
empty_slot.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
fw-path-provider.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
hotplug.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
hw.h Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ide.h hw/ide: Move MAX_IDE_DEVS define to hw/ide/internal.h 2020-03-17 12:22:36 -04:00
irq.h Revert "irq: introduce qemu_irq_proxy()" 2019-11-05 23:33:12 +01:00
loader-fit.h Use #include "..." for our own headers, <...> for others 2018-02-09 05:05:11 +01:00
loader.h hw/core/loader: Let load_elf() populate a field with CPU-specific flags 2020-01-29 19:28:52 +01:00
nmi.h hw/nmi: Fix the NMI() macro, based on INTERFACE_CHECK() 2020-02-28 14:57:19 -05:00
or-irq.h hw/core/or-irq: Increase limit of or-lines to 48 2020-01-23 16:34:15 +00:00
pcmcia.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
platform-bus.h platform-bus-device: use device plug callback instead of machine_done notifier 2018-05-10 18:10:56 +01:00
ptimer.h ptimer: Remove old ptimer_init_with_bh() API 2019-11-11 13:44:16 +00:00
qdev-core.h hw/core: deprecate old reset functions and introduce new ones 2020-01-30 16:02:04 +00:00
qdev-dma.h Supply missing header guards 2019-06-12 13:20:21 +02:00
qdev-properties.h multifd: Add multifd-compression parameter 2020-02-28 09:24:43 +01:00
register.h hw: register: Run post_write hook on reset 2018-03-01 11:05:43 +00:00
registerfields.h hw/registerfields.h: Add 8bit and 16bit register macros 2020-03-19 17:15:19 +01:00
resettable.h hw/core: deprecate old reset functions and introduce new ones 2020-01-30 16:02:04 +00:00
stream.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
sysbus.h sysbus: remove outdated comment 2020-01-07 16:06:59 +04:00
usb.h Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
vmstate-if.h vmstate: add qom interface to get id 2020-01-06 18:41:32 +04:00