[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [qemu-xen staging-4.14] hw/sd/sdcard: Simplify realize() a bit
commit 6a34f7752f05efbd0f26ea87f9e022469b4ac0d2 Author: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx> AuthorDate: Tue Jun 5 22:28:51 2018 -0300 Commit: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> CommitDate: Wed Sep 2 19:06:19 2020 -0500 hw/sd/sdcard: Simplify realize() a bit We don't need to check if sd->blk is set twice. Reviewed-by: Peter Maydell <peter.maydell@xxxxxxxxxx> Signed-off-by: Philippe Mathieu-Daudé <f4bug@xxxxxxxxx> Reviewed-by: Alistair Francis <alistair.francis@xxxxxxx> Message-Id: <20200630133912.9428-18-f4bug@xxxxxxxxx> (cherry picked from commit 6dd3a164f5b31c703c7d8372841ad3bd6a57de6d) Signed-off-by: Michael Roth <mdroth@xxxxxxxxxxxxxxxxxx> --- hw/sd/sd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index da39590f58..04258f1816 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2090,12 +2090,12 @@ static void sd_realize(DeviceState *dev, Error **errp) return; } - if (sd->blk && blk_is_read_only(sd->blk)) { - error_setg(errp, "Cannot use read-only drive as SD card"); - return; - } - if (sd->blk) { + if (blk_is_read_only(sd->blk)) { + error_setg(errp, "Cannot use read-only drive as SD card"); + return; + } + ret = blk_set_perm(sd->blk, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE, BLK_PERM_ALL, errp); if (ret < 0) { -- generated by git-patchbot for /home/xen/git/qemu-xen.git#staging-4.14
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |