From: Krzysztof Karas <krzysztof.karas@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>,
Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: dev@dpdk.org, Krzysztof Karas <krzysztof.karas@intel.com>
Subject: [PATCH] ethdev: initialize id in eth_representor_cmp()
Date: Mon, 20 Feb 2023 17:44:06 +0100 [thread overview]
Message-ID: <20230220164406.1490041-1-krzysztof.karas@intel.com> (raw)
When Link Time Optimization is enabled, compiler may
complain about "id" in eth_representor_cmp() being
uninitialized.
To suppress the warning it is enough to add explicit
initialization of the variable causing the issue.
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
---
.mailmap | 1 +
lib/ethdev/rte_class_eth.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.mailmap b/.mailmap
index 5015494210..ba34945bc5 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1573,3 +1573,4 @@ Ziye Yang <ziye.yang@intel.com>
Zoltan Kiss <zoltan.kiss@schaman.hu> <zoltan.kiss@linaro.org>
Zorik Machulsky <zorik@amazon.com>
Zyta Szpak <zyta@marvell.com> <zr@semihalf.com> <zyta.szpak@semihalf.com>
+Krzysztof Karas <krzysztof.karas@intel.com>
diff --git a/lib/ethdev/rte_class_eth.c b/lib/ethdev/rte_class_eth.c
index 838b3a8f9f..b61dae849d 100644
--- a/lib/ethdev/rte_class_eth.c
+++ b/lib/ethdev/rte_class_eth.c
@@ -67,7 +67,7 @@ eth_representor_cmp(const char *key __rte_unused,
const struct rte_eth_dev *edev = opaque;
const struct rte_eth_dev_data *data = edev->data;
struct rte_eth_devargs eth_da;
- uint16_t id, nc, np, nf, i, c, p, f;
+ uint16_t id = 0, nc, np, nf, i, c, p, f;
if ((data->dev_flags & RTE_ETH_DEV_REPRESENTOR) == 0)
return -1; /* not a representor port */
--
2.34.1
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
next reply other threads:[~2023-02-20 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-20 16:44 Krzysztof Karas [this message]
2023-02-28 23:23 ` Ferruh Yigit
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=20230220164406.1490041-1-krzysztof.karas@intel.com \
--to=krzysztof.karas@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.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).