virtio-mmio: Fix irq parsing in command line parameter
authorPawel Moll <pawel.moll@arm.com>
Thu, 22 Nov 2012 02:00:24 +0000 (12:30 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 18 Dec 2012 04:50:41 +0000 (15:20 +1030)
commit40f9938c4c69183c5ceaca74b77aff636cc79623
tree94393c100ead39d57c4567cb9eca81fe859d72ee
parenteb34f12b509823571e88b791ae2088280943894f
virtio-mmio: Fix irq parsing in command line parameter

When the resource_size_t is 64-bit long, the sscanf() on
the virtio device command line paramter string may return
wrong value because its format was defined as "%u". Fixed
by using an intermediate local value of a known length.

Also added cleaned up the resource creation and added extra
comments to make the parameters parsing easier to follow.

Reported-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/virtio/virtio_mmio.c