virtio-mem: determine nid only once using memory_add_physaddr_to_nid()
authorDavid Hildenbrand <david@redhat.com>
Thu, 12 Nov 2020 13:37:47 +0000 (14:37 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 18 Dec 2020 21:14:25 +0000 (16:14 -0500)
commit6725f21157b4b6a9fe689cdf07b040d21ea536dd
tree2735c3870ef71e84a92ae2c996d432ec2560b049
parent2c85ebc57b3e1817b6ce1a6b703928e113a90442
virtio-mem: determine nid only once using memory_add_physaddr_to_nid()

Let's determine the target nid only once in case we have none specified -
usually, we'll end up with node 0 either way.

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-2-david@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mem.c