[PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()

Richard Henderson richard.henderson at linaro.org
Tue Mar 9 18:25:18 UTC 2021


On 3/9/21 8:12 AM, Markus Armbruster wrote:
> @@ -2565,6 +2551,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>                                     Error **errp)
>   {
>       int i, j;
> +    FDrive *drive;
>       static int command_tables_inited = 0;
>   
>       if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) {
> @@ -2604,7 +2591,13 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>       }
>   
>       floppy_bus_create(fdctrl, &fdctrl->bus, dev);
> -    fdctrl_connect_drives(fdctrl, dev, errp);
> +
> +    for (i = 0; i < MAX_FD; i++) {
> +        drive = &fdctrl->drives[i];

FWIW, the declaration could be local to this loop.

r~




More information about the libvir-list mailing list