virtio/blk: Avoid taking pointer to packed struct

clang and GCC9 refuse to compile virtio/blk.c with the following message:
virtio/blk.c:161:37: error: taking address of packed member 'geometry' of class
      or structure 'virtio_blk_config' may result in an unaligned pointer value
      [-Werror,-Waddress-of-packed-member]
        struct virtio_blk_geometry *geo = &conf->geometry;

Since struct virtio_blk_geometry is in a kernel header, we can't do much
about the packed attribute, but as Peter pointed out, the solution is
rather simple: just get rid of the convenience variable and use the
original struct member directly.

Reviewed-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
1 file changed