From: Ferruh Yigit Date: Mon, 11 May 2020 16:07:25 +0000 (+0100) Subject: event/octeontx2: fix build for O1 optimization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ea153cc853049c6f935693e48d2866782370a3fe;hp=ea153cc853049c6f935693e48d2866782370a3fe;p=dpdk.git event/octeontx2: fix build for O1 optimization Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using gcc 7.3.0 Build error In file included from .../drivers/event/octeontx2/ot x2_evdev.c:15:0: .../drivers/event/octeontx2/otx2_evdev_stats.h: In function ‘otx2_sso_xstats_get’: .../drivers/event/octeontx2/otx2_evdev_stats.h:124:9: error: ‘xstats’ may be used uninitialized in this function [-Werror=maybe-uninitialized] xstat = &xstats[ids[i] - start_offset]; ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is false positive, 'xstats_mode_count' should be preventing taking the loop and accessing 'xstats'. Returning in that case to silence the compiler warning. Reported-by: Konstantin Ananyev Signed-off-by: Ferruh Yigit Tested-by: Konstantin Ananyev Acked-by: Konstantin Ananyev Acked-by: Jerin Jacob ---