From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20072.outbound.protection.outlook.com [40.107.2.72]) by dpdk.org (Postfix) with ESMTP id 8F3712B83; Tue, 13 Nov 2018 20:11:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mgfmmldLg8x6ihqsOPRGPPgYBaxF+Tpyfh6MO9JPSCg=; b=OjL/o/ZLHImb3Gx0+BuVmml/VqzRuKlw803fxsrXlQd2ZstydiTHU39W2TMEVm7hq57aE0SgObLIF70LIGxIMChKR3R+3I21CM9d3n8M89IKOdp0Y9GC4EkTeIfGfQYJjuK65vp2W6tGNV/Isej+ufPPJr4LMtBHsHNyYvf/724= Received: from VI1PR05MB4269.eurprd05.prod.outlook.com (52.133.12.22) by VI1PR05MB4190.eurprd05.prod.outlook.com (10.171.183.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Tue, 13 Nov 2018 19:11:07 +0000 Received: from VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::68d6:1233:5e0c:143a]) by VI1PR05MB4269.eurprd05.prod.outlook.com ([fe80::68d6:1233:5e0c:143a%5]) with mapi id 15.20.1294.045; Tue, 13 Nov 2018 19:11:07 +0000 From: Ali Alnubani To: "dev@dpdk.org" CC: Thomas Monjalon , Shahaf Shuler , "stable@dpdk.org" Thread-Topic: [PATCH 1/2] net/mlx4: fix initialization of struct members Thread-Index: AQHUe4ShJVSyO0Kh40mRBIhghppA8g== Date: Tue, 13 Nov 2018 19:11:06 +0000 Message-ID: <20181113191039.12720-1-alialnu@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.11.0 x-clientproxiedby: PR2P264CA0020.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::32) To VI1PR05MB4269.eurprd05.prod.outlook.com (2603:10a6:803:40::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=alialnu@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2001:4b98:dc0:51:216:3eff:feac:53b] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR05MB4190; 6:iSsIgiK0MBEzCTwsVlEjXOl3LoIar6UcpFqXKawN2sbUXibR/TmM/mZT5BCI1L3jMOHfkALAQQhlbLZ4K0kgIJoCQkIDcPpnwmrm8AYTx/XHsHLyXOZ75Su6SQwg7BRgxsQG5YqI8NAIq9h4ZVHaxnXJnf8P0I2352CmSk0nDP33EJaEM26kShu9slO84vFrdkaMBKiYvgsAdN4OJGoVImGbMbbPjfLOPeeeqrekpt7DlX5iTGaIRmwGsDpxHAkFdB6F67QvujDIiEUMXzDthRbdGIjFugoNROi//TR8zNwIt8yH1L9ds1pyi3W4+w/sp8isjEiZWzbgLw/jc8+J4ttGPL6Qq3tnNpSqXc88t+iGIhryYAYzj+kTmQE2K4vXjl88NgWle34aNV2eGoMN79E8RmEMUIwomnr23nhOtR69Ya5+EmFCi3A5675d41vvPP4y2qJIqxq15Kd/SVJcLQ==; 5:cgM6GmWo2hZOaGJ3fQCZFOjV/Xchh27pcFgNBopz0epM7drtGKK8k94YGQOD7RbX+h4K1Q4gbKJWpj7X8dgUZPI+Ipk5P3naAUKH6vFiktdevy73v+PGqXLEfKpr1UZy4Jh+afzDrq2e999HGB/p5xzwexb9rxvNmPJ8OsbEZy8=; 7:pkgMWpXNLibMsxU+gWr00zbdPhTrwdvhgnX31tr3wIlzvc40qC6weoAYXKo+vCWpjldvHmEB/xt3R2o78jy1OOVvf3wPPThnW2a1yvvUQQY6Zwo5kqlhHE90p9FHC+wILShNZ826s/ha9V+aqxs9bg== x-ms-office365-filtering-correlation-id: 42ea36c1-6eba-4b33-2b29-08d6499bc31c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390060)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4190; x-ms-traffictypediagnostic: VI1PR05MB4190: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231382)(944501410)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:VI1PR05MB4190; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4190; x-forefront-prvs: 085551F5A8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(366004)(376002)(396003)(136003)(189003)(199004)(86362001)(52116002)(6486002)(53936002)(81156014)(5640700003)(71190400001)(4326008)(2906002)(14454004)(71200400001)(36756003)(25786009)(1730700003)(6436002)(50226002)(386003)(8676002)(46003)(6506007)(81166006)(6916009)(305945005)(2900100001)(105586002)(6512007)(99286004)(2501003)(8936002)(316002)(186003)(486006)(7736002)(2616005)(2351001)(5660300001)(97736004)(476003)(68736007)(102836004)(478600001)(256004)(6116002)(106356001)(1076002)(45080400002)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4190; H:VI1PR05MB4269.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: EMExTt36Pu6VQL/Cw1Tyl+DONkPB30lCRmKWc8ECNVYfsgdWix6vwbmZqtd/yy6zFjAqvGYeNZqkhbLT8OTpc0Rsnv6WC3J+UUbIBjbu83Sqb9Jye6SVB8zAcM0LDI51ETNZBU7YXkEfMg4jmO0IBDFpoWDcPkek26q1hLMO1HS2XGF2NWXeZKIsYgcM1Qq43Ubf1chk3rDcB1N8YPXkQak5fHSCbhuSIulAfOfowGO3158dF49IGcIhPNd6lnEgFIL1/j3151Gs1iFCDxG2mxTPGd1w6dsd9ry02yLYtgcjMhlWi2YLkB7uj//kYa/gIEM4J+HlYWrEU1YzqDvN/1g0h7yTQ2VciN0q9NTq3fA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 42ea36c1-6eba-4b33-2b29-08d6499bc31c X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2018 19:11:07.2543 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4190 Subject: [dpdk-stable] [PATCH 1/2] net/mlx4: fix initialization of struct members X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 19:11:09 -0000 This patch fixes compilation errors with meson and the clang compiler caused by some of the struct members not being initialized. ``` ../drivers/net/mlx4/mlx4_mr.c:357:37: error: missing field 'end' initializer [-Werror,-Wmissing-field-initializers] struct mlx4_mr_cache entry =3D { 0, }; ^ ../drivers/net/mlx4/mlx4_mr.c:401:36: error: missing field 'end' initializer [-Werror,-Wmissing-field-initializers] struct mlx4_mr_cache ret =3D { 0, }; ^ ../drivers/net/mlx4/mlx4_mr.c:691:35: error: missing field 'end' initializer [-Werror,-Wmissing-field-initializers] struct mlx4_mr_cache ret =3D { 0, }; ^ ``` The compilation errors reproduce with clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL. Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support") Cc: stable@dpdk.org Signed-off-by: Ali Alnubani --- drivers/net/mlx4/mlx4_mr.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c index c2066ea4b..726788a60 100644 --- a/drivers/net/mlx4/mlx4_mr.c +++ b/drivers/net/mlx4/mlx4_mr.c @@ -354,8 +354,9 @@ mr_insert_dev_cache(struct rte_eth_dev *dev, struct mlx= 4_mr *mr) DEBUG("port %u inserting MR(%p) to global cache", dev->data->port_id, (void *)mr); for (n =3D 0; n < mr->ms_bmp_n; ) { - struct mlx4_mr_cache entry =3D { 0, }; + struct mlx4_mr_cache entry; =20 + memset(&entry, 0, sizeof(entry)); /* Find a contiguous chunk and advance the index. */ n =3D mr_find_next_chunk(mr, &entry, n); if (!entry.end) @@ -398,8 +399,9 @@ mr_lookup_dev_list(struct rte_eth_dev *dev, struct mlx4= _mr_cache *entry, if (mr->ms_n =3D=3D 0) continue; for (n =3D 0; n < mr->ms_bmp_n; ) { - struct mlx4_mr_cache ret =3D { 0, }; + struct mlx4_mr_cache ret; =20 + memset(&ret, 0, sizeof(ret)); n =3D mr_find_next_chunk(mr, &ret, n); if (addr >=3D ret.start && addr < ret.end) { /* Found. */ @@ -688,8 +690,9 @@ mlx4_mr_create(struct rte_eth_dev *dev, struct mlx4_mr_= cache *entry, */ for (n =3D 0; n < ms_n; ++n) { uintptr_t start; - struct mlx4_mr_cache ret =3D { 0, }; + struct mlx4_mr_cache ret; =20 + memset(&ret, 0, sizeof(ret)); start =3D data_re.start + n * msl->page_sz; /* Exclude memsegs already registered by other MRs. */ if (mr_lookup_dev(dev, &ret, start) =3D=3D UINT32_MAX) { @@ -1277,8 +1280,9 @@ mlx4_mr_dump_dev(struct rte_eth_dev *dev) if (mr->ms_n =3D=3D 0) continue; for (n =3D 0; n < mr->ms_bmp_n; ) { - struct mlx4_mr_cache ret =3D { 0, }; + struct mlx4_mr_cache ret; =20 + memset(&ret, 0, sizeof(ret)); n =3D mr_find_next_chunk(mr, &ret, n); if (!ret.end) break; --=20 2.11.0