build: add explicit vars init to silence LTO related warning

When Link Time Optimization is enabled, compiler can sometimes produce
additional warnings saying that some variables may be uninitialized.

To supress the warning it is enough to add explicit initialization
of the variable causing the issue, in this case '*module_name = NULL'
and "*writer = NULL".

Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: I30492115b28a18554b08a6f575cbcc9538f3b848
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14849
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Szulik, Maciej 2022-10-04 15:11:02 +02:00 committed by Tomasz Zawadzki
parent a731574438
commit dcf30711ef
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ rpc_accel_get_opc_assignments(struct spdk_jsonrpc_request *request,
{ {
struct spdk_json_write_ctx *w; struct spdk_json_write_ctx *w;
enum accel_opcode opcode; enum accel_opcode opcode;
const char *name, *module_name; const char *name, *module_name = NULL;
int rc; int rc;
if (params != NULL) { if (params != NULL) {

View File

@ -314,7 +314,7 @@ void
ftl_mngt_finalize_init_bands(struct spdk_ftl_dev *dev, struct ftl_mngt_process *mngt) ftl_mngt_finalize_init_bands(struct spdk_ftl_dev *dev, struct ftl_mngt_process *mngt)
{ {
struct ftl_band *band, *temp_band, *open_bands[FTL_MAX_OPEN_BANDS]; struct ftl_band *band, *temp_band, *open_bands[FTL_MAX_OPEN_BANDS];
struct ftl_writer *writer; struct ftl_writer *writer = NULL;
uint64_t i, num_open = 0, num_shut = 0; uint64_t i, num_open = 0, num_shut = 0;
uint64_t offset; uint64_t offset;
bool fast_startup = ftl_fast_startup(dev); bool fast_startup = ftl_fast_startup(dev);