virtio-mem: factor out calculation of the bit number within the subblock bitmap
authorDavid Hildenbrand <david@redhat.com>
Thu, 12 Nov 2020 13:37:52 +0000 (14:37 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 18 Dec 2020 21:14:25 +0000 (16:14 -0500)
commit41e6215c6d29a7bbcee599411cdf0911fde1f09b
tree2ff30a3e0fb7a731933614acc08ecdc8f12e9ad6
parent2a6285114bc543b70612e2bc0fcf13d2dd6ce5b9
virtio-mem: factor out calculation of the bit number within the subblock bitmap

The calculation is already complicated enough, let's limit it to one
location.

Reviewed-by: Wei Yang <richard.weiyang@linux.alibaba.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20201112133815.13332-7-david@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mem.c