From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Yigit, Ferruh" <ferruh.yigit@intel.com>,
Pavan Nikhilesh <pbhagavatula@marvell.com>,
Jerin Jacob <jerinj@marvell.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Thomas Monjalon <thomas@monjalon.net>,
David Marchand <david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2 4/4] event/octeontx2: fix build for O1 optimization
Date: Fri, 8 May 2020 17:22:30 +0000 [thread overview]
Message-ID: <BYAPR11MB33017CA7DC619F02C32A18FB9AA20@BYAPR11MB3301.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200508164546.2489396-4-ferruh.yigit@intel.com>
> Subject: [PATCH v2 4/4] 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 <konstantin.ananyev@intel.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> drivers/event/octeontx2/otx2_evdev_stats.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/event/octeontx2/otx2_evdev_stats.h b/drivers/event/octeontx2/otx2_evdev_stats.h
> index 9d7c694ee6..74fcec8a07 100644
> --- a/drivers/event/octeontx2/otx2_evdev_stats.h
> +++ b/drivers/event/octeontx2/otx2_evdev_stats.h
> @@ -67,7 +67,7 @@ otx2_sso_xstats_get(const struct rte_eventdev *event_dev,
>
> switch (mode) {
> case RTE_EVENT_DEV_XSTATS_DEVICE:
> - break;
> + return 0;
> case RTE_EVENT_DEV_XSTATS_PORT:
> if (queue_port_id >= (signed int)dev->nb_event_ports)
> goto invalid_value;
> --
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 2.25.4
next prev parent reply other threads:[~2020-05-08 17:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-07 12:02 [dpdk-dev] [PATCH 1/3] ring: fix build for gcc " Ferruh Yigit
2020-05-07 12:02 ` [dpdk-dev] [PATCH 2/3] mempool/octeontx2: " Ferruh Yigit
2020-05-07 14:05 ` Ananyev, Konstantin
2020-05-08 16:20 ` Ferruh Yigit
2020-05-08 16:39 ` Ferruh Yigit
2020-05-07 12:02 ` [dpdk-dev] [PATCH 3/3] net/ena: fix build for " Ferruh Yigit
2020-05-08 13:59 ` Michał Krawczyk
2020-05-07 13:47 ` [dpdk-dev] [PATCH 1/3] ring: fix build for gcc " Ananyev, Konstantin
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 1/4] " Ferruh Yigit
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 2/4] mempool/octeontx2: " Ferruh Yigit
2020-05-10 11:51 ` Jerin Jacob
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 3/4] net/ena: fix build for " Ferruh Yigit
2020-05-08 16:45 ` [dpdk-dev] [PATCH v2 4/4] event/octeontx2: " Ferruh Yigit
2020-05-08 17:22 ` Ananyev, Konstantin [this message]
2020-05-10 11:53 ` Jerin Jacob
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 1/4] ring: fix build for gcc " Ferruh Yigit
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 2/4] mempool/octeontx2: " Ferruh Yigit
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 3/4] net/ena: fix build for " Ferruh Yigit
2020-05-11 16:07 ` [dpdk-dev] [PATCH v3 4/4] event/octeontx2: " Ferruh Yigit
2020-05-11 19:13 ` [dpdk-dev] [PATCH v3 1/4] ring: fix build for gcc " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BYAPR11MB33017CA7DC619F02C32A18FB9AA20@BYAPR11MB3301.namprd11.prod.outlook.com \
--to=konstantin.ananyev@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jerinj@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).