From 52ae747fe2c7e53ce40bd8e1d87bb4009011aa6d Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 31 Aug 2017 13:01:14 -0700 Subject: [PATCH] vhost: remove redundant NULL check in parse_core_mask This is a private function that is only called in one place, and cpumask is always provided. Additionally, the code inside the mask == NULL || cpumask == NULL check always writes to *cpumask, so it was not possible to pass NULL as cpumask anyway. Change-Id: I2cde53dfeb07edc8a8f87f4ff485ec0c5c9ba7a8 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/376685 Tested-by: SPDK Automated Test System Reviewed-by: Dariusz Stojaczyk Reviewed-by: Jim Harris --- lib/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index d11c761e54..540a2fd23f 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -314,7 +314,7 @@ spdk_vhost_parse_core_mask(const char *mask, uint64_t *cpumask) { char *end; - if (mask == NULL || cpumask == NULL) { + if (mask == NULL) { *cpumask = spdk_app_get_core_mask(); return 0; }