From 10a266cae3b21cf36f2df81069c089019486a58b Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Sat, 26 Jan 2013 11:36:08 +0200 Subject: [PATCH] kvm tools: Clean up NULL check in pci_shmem__init() Use idiomatic way of checking for NULL pointer in pci_shmem__init(). Suggested-by: "H. Peter Anvin" Signed-off-by: Pekka Enberg --- hw/pci-shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-shmem.c b/hw/pci-shmem.c index ec3f771..701231a 100644 --- a/hw/pci-shmem.c +++ b/hw/pci-shmem.c @@ -54,7 +54,7 @@ static struct msix_table msix_table[2]; int pci_shmem__register_mem(struct shmem_info *si) { - if (shmem_region == NULL) { + if (!shmem_region) { shmem_region = si; } else { pr_warning("only single shmem currently avail. ignoring.\n");