mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
Replace uses of FROM_SSI_SLAVE() macro with QOM casts
The FROM_SSI_SLAVE() macro predates QOM and is used as a typesafe way to cast from an SSISlave* to the instance struct of a subtype of TYPE_SSI_SLAVE. Switch to using the QOM cast macros instead, which have the same effect (by writing the QOM macros if the types were previously missing them.) (The FROM_SSI_SLAVE() macro allows the SSISlave member of the subtype's struct to be anywhere as long as it is named "ssidev", whereas a QOM cast macro insists that it is the first thing in the subtype's struct. This is true for all the types we convert here.) This removes all the uses of FROM_SSI_SLAVE() so we can delete the definition. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-id: 20200628142429.17111-18-peter.maydell@linaro.org
This commit is contained in:
parent
62a4d34020
commit
213f63df77
5 changed files with 22 additions and 14 deletions
|
@ -74,7 +74,7 @@ typedef struct {
|
|||
|
||||
static uint32_t ssi_sd_transfer(SSISlave *dev, uint32_t val)
|
||||
{
|
||||
ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, dev);
|
||||
ssi_sd_state *s = SSI_SD(dev);
|
||||
|
||||
/* Special case: allow CMD12 (STOP TRANSMISSION) while reading data. */
|
||||
if (s->mode == SSI_SD_DATA_READ && val == 0x4d) {
|
||||
|
@ -241,7 +241,7 @@ static const VMStateDescription vmstate_ssi_sd = {
|
|||
|
||||
static void ssi_sd_realize(SSISlave *d, Error **errp)
|
||||
{
|
||||
ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d);
|
||||
ssi_sd_state *s = SSI_SD(d);
|
||||
DeviceState *carddev;
|
||||
DriveInfo *dinfo;
|
||||
Error *err = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue