From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <tdu@semihalf.com>
Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com
 [209.85.215.68]) by dpdk.org (Postfix) with ESMTP id B3A081B010
 for <dev@dpdk.org>; Fri, 23 Mar 2018 08:52:31 +0100 (CET)
Received: by mail-lf0-f68.google.com with SMTP id g203-v6so16910170lfg.11
 for <dev@dpdk.org>; Fri, 23 Mar 2018 00:52:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=semihalf-com.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:content-transfer-encoding:in-reply-to
 :user-agent; bh=tGQjHQ5QtSQSU3jYF9l4CE8xGy9SHiyegXJlkbv6eHU=;
 b=HkS6NA/t44F5Hpl8671/EYj0WOAxauY2nEsHNrEYrWRCTlABr0RHgRD/PQ549Vl72u
 KcaRnwbCQQDixSYWmO1QXRDjHmnNXmoErySExAMJoyg45D1UkELZ621wnEKrahSDXUA8
 Vi87yx+7r+Wo1eqQdeE3RQ93lDU2Jk2eW3mct85DEjZJvWsP/3tdkmfMvxtEn3MbcRcY
 AK+N3E+QEcGvdgWDmVIfMABILNLO1u/uMn+c0tP7nmNUgClj+KvLyvcjrBTw3uMOF0w9
 ScBp7LhoLJHNM8ZpKq2QfCTZkt7zheCVufnoip4nKJAizwNx39EwBzHtqdlA+vcVe8ib
 XvsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:content-transfer-encoding
 :in-reply-to:user-agent;
 bh=tGQjHQ5QtSQSU3jYF9l4CE8xGy9SHiyegXJlkbv6eHU=;
 b=LmQj8xm15d1wzZgVuCjTsu9aaTrpVl7jb7HeH8sPNTDxPALg0pykuf+6xA2jiTkLy8
 dy13h3qBYMqBKQHGBp/aD+3LOFfkShS9/HbQ4uUOBH1ZisJ0QTeBh5feJBFRG95QrEaz
 uDfj7XvyPprZAZfc9DyJ1Zd9ZgrQqYbzk1A/DRSs60cT2Ngut5a6olovZP+xTl/Yddmo
 kmzbbi1Rl4JgUvdiyIPP0m20OHs0OpWQu3D7r++YxeBivgNb1Xc0z5LzDIUEJdzSCI98
 M9UkBgxxMQZMelfvHA5fGFQcPApDstaj1ifgwCXeetOMIKUjNv56DqHOQwxrSEAZWUjF
 VwBg==
X-Gm-Message-State: AElRT7G0Qtp1w3U8c1z6WNSzzKfrtK9llBTm3WmEqf+C4PFuba0RDUTB
 jOtBoliuq/ZoQ9regDLOh/kiVQ==
X-Google-Smtp-Source: AG47ELux7Vzamq/PuTlpAMwgq0o9SUdHo/lqvpTKttwI1q7NebpPJCzbkKY1rU9RUyZ8O0flyiiWqg==
X-Received: by 2002:a19:be4b:: with SMTP id
 o72-v6mr19520186lff.20.1521791551151; 
 Fri, 23 Mar 2018 00:52:31 -0700 (PDT)
Received: from localhost (31-172-191-173.noc.fibertech.net.pl.
 [31.172.191.173])
 by smtp.gmail.com with ESMTPSA id f46-v6sm2076640lfh.56.2018.03.23.00.52.29
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 23 Mar 2018 00:52:30 -0700 (PDT)
Date: Fri, 23 Mar 2018 08:52:29 +0100
From: Tomasz Duszynski <tdu@semihalf.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Jacek Siuda <jck@semihalf.com>, Tomasz Duszynski <tdu@semihalf.com>,
 Dmitri Epshtein <dima@marvell.com>,
 Natalie Samsonov <nsamsono@marvell.com>,
 Jianbo Liu <jianbo.liu@arm.com>, dev@dpdk.org
Message-ID: <20180323075229.GA22697@sh>
References: <20180322181847.74246-1-ferruh.yigit@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
In-Reply-To: <20180322181847.74246-1-ferruh.yigit@intel.com>
User-Agent: Mutt/1.5.23.1 (2014-03-12)
Subject: Re: [dpdk-dev] [PATCH] net/mrvl: fix build error with gcc
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Mar 2018 07:52:32 -0000

On Thu, Mar 22, 2018 at 06:18:47PM +0000, Ferruh Yigit wrote:
> gcc version:
> aarch64-linux-gnu-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011
>
> build error:
>   CC mrvl_qos.o
> .../drivers/net/mrvl/mrvl_qos.c: In function =E2=80=98mrvl_configure_rxqs=
=E2=80=99:
> .../drivers/net/mrvl/mrvl_qos.c:679:17:
>   error: =E2=80=98sprintf=E2=80=99 may write a terminating nul past the e=
nd of the
>          destination [-Werror=3Dformat-overflow=3D]
>   sprintf(match, "policer-%d:%d\n", priv->pp_id, priv->ppio_id);
>                  ^~~~~~~~~~~~~~~~~
> .../drivers/net/mrvl/mrvl_qos.c:679:2:
>   note: =E2=80=98sprintf=E2=80=99 output between 13 and 17 bytes into a d=
estination
>         of size 16
>   sprintf(match, "policer-%d:%d\n", priv->pp_id, priv->ppio_id);
>   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixed by replacing sprintf to snprintf.
>
> Fixes: 8860fd7b70f0 ("net/mrvl: add ingress policer support")
> Cc: tdu@semihalf.com
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> ---
>  drivers/net/mrvl/mrvl_qos.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/mrvl/mrvl_qos.c b/drivers/net/mrvl/mrvl_qos.c
> index e9c4531fd..741d3da7a 100644
> --- a/drivers/net/mrvl/mrvl_qos.c
> +++ b/drivers/net/mrvl/mrvl_qos.c
> @@ -676,7 +676,8 @@ setup_policer(struct mrvl_priv *priv, struct pp2_cls_=
plcr_params *params)
>  	char match[16];
>  	int ret;
>
> -	sprintf(match, "policer-%d:%d\n", priv->pp_id, priv->ppio_id);
> +	snprintf(match, sizeof(match), "policer-%d:%d\n",
> +			priv->pp_id, priv->ppio_id);
>  	params->match =3D match;
>
>  	ret =3D pp2_cls_plcr_init(params, &priv->policer);
> --
> 2.13.6
>

Acked-by: Tomasz Duszynski <tdu@semihalf.com>

--
- Tomasz Duszy=C5=84ski