DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] ethdev: initialize id in eth_representor_cmp()
@ 2023-02-20 16:44 Krzysztof Karas
  2023-02-28 23:23 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Karas @ 2023-02-20 16:44 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko; +Cc: dev, Krzysztof Karas

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ethdev: initialize id in eth_representor_cmp()
  2023-02-20 16:44 [PATCH] ethdev: initialize id in eth_representor_cmp() Krzysztof Karas
@ 2023-02-28 23:23 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2023-02-28 23:23 UTC (permalink / raw)
  To: Krzysztof Karas, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, Xueming(Steven) Li

On 2/20/2023 4:44 PM, Krzysztof Karas wrote:
> 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>

Fixes: df7547a6a2cc ("ethdev: add helper function to get representor ID")
Cc: stable@dpdk.org


Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>

Applied to dpdk-next-net/main, thanks.


> ---
>  .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>

Alphabetically sorted while merging.

Also patch title updated since it gives warning:
$ ./devtools/check-git-log.sh -n1
Wrong headline format:
        ethdev: initialize id in eth_representor_cmp()


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-28 23:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 16:44 [PATCH] ethdev: initialize id in eth_representor_cmp() Krzysztof Karas
2023-02-28 23:23 ` Ferruh Yigit

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).