From 5faa855989a8b42c7a1e0e26c8380eb9f1a835c4 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 29 Sep 2017 09:31:45 -0700 Subject: [PATCH] ut/lvol: avoid using empty struct Add a field to the unit test mocked version of struct spdk_blob_store to avoid having an empty struct. Fixes build warning with scan-build: lvol_ut.c:86:7: warning: Call to 'calloc' has an allocation size of 0 bytes bs = calloc(1, sizeof(*bs)); ^~~~~~~~~~~~~~~~~~~~~~ Change-Id: If7e48b4cce167ad12f475861bbd6ed4c751febfd Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/380816 Tested-by: SPDK Automated Test System Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- test/unit/lib/lvol/lvol.c/lvol_ut.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/lib/lvol/lvol.c/lvol_ut.c b/test/unit/lib/lvol/lvol.c/lvol_ut.c index 2404339812..1c7c702f3b 100644 --- a/test/unit/lib/lvol/lvol.c/lvol_ut.c +++ b/test/unit/lib/lvol/lvol.c/lvol_ut.c @@ -56,7 +56,10 @@ int g_resize_rc; struct spdk_lvol_store *g_lvol_store; struct spdk_lvol *g_lvol; struct spdk_bs_opts g_bs_opts; -struct spdk_blob_store {}; + +struct spdk_blob_store { + int stub; +}; struct spdk_io_channel *spdk_bs_alloc_io_channel(struct spdk_blob_store *bs) {