patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Ali Alnubani <alialnu@mellanox.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [17.11] net/mlx5: fix initialization of struct members
Date: Wed, 23 Jan 2019 05:58:36 +0000	[thread overview]
Message-ID: <52607FC6-A8DF-499F-A6D8-987500434BA1@mellanox.com> (raw)
In-Reply-To: <20190122145059.31868-1-alialnu@mellanox.com>

> On Jan 22, 2019, at 11:51 PM, Ali Alnubani <alialnu@mellanox.com> wrote:
> 
> [ backported from upstream commit 0c15f3c010322853078c20a2a9926d3fb5986548 ]
> 
> This patch fixes compilation errors with meson and the clang
> compiler caused by some of the struct members not being
> initialized.
> 
> ```
> ../drivers/net/mlx5/mlx5_mr.c:345:37: error: missing field 'end'
> initializer [-Werror,-Wmissing-field-initializers]
>                struct mlx5_mr_cache entry = { 0, };
>                                                  ^
> ../drivers/net/mlx5/mlx5_mr.c:389:36: error: missing field 'end'
> initializer [-Werror,-Wmissing-field-initializers]
>                        struct mlx5_mr_cache ret = { 0, };
>                                                        ^
> ../drivers/net/mlx5/mlx5_mr.c:691:35: error: missing field 'end'
> initializer [-Werror,-Wmissing-field-initializers]
>                struct mlx5_mr_cache ret = { 0, };
>                                                ^
> ```
> 
> The compilation errors reproduce with
> clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.
> 
> Fixes: 87011737b715 ("mlx5: add software counters")
> 
> Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
Applied to stable/17.11

thanks,
Yongseok


> drivers/net/mlx5/mlx5_stats.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c
> index 345ed7075..e880d24c5 100644
> --- a/drivers/net/mlx5/mlx5_stats.c
> +++ b/drivers/net/mlx5/mlx5_stats.c
> @@ -356,10 +356,11 @@ int
> mlx5_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
> {
> 	struct priv *priv = dev->data->dev_private;
> -	struct rte_eth_stats tmp = {0};
> +	struct rte_eth_stats tmp;
> 	unsigned int i;
> 	unsigned int idx;
> 
> +	memset(&tmp, 0, sizeof(tmp));
> 	/* Add software counters. */
> 	for (i = 0; (i != priv->rxqs_n); ++i) {
> 		struct mlx5_rxq_data *rxq = (*priv->rxqs)[i];
> -- 
> 2.19.1
> 

      reply	other threads:[~2019-01-23  5:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 14:51 Ali Alnubani
2019-01-23  5:58 ` Yongseok Koh [this message]

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=52607FC6-A8DF-499F-A6D8-987500434BA1@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=alialnu@mellanox.com \
    --cc=stable@dpdk.org \
    /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).