From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CD5EA0C53; Wed, 3 Nov 2021 13:55:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05A2B4115A; Wed, 3 Nov 2021 13:55:41 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 53C4041149 for ; Wed, 3 Nov 2021 13:55:38 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10156"; a="292322431" X-IronPort-AV: E=Sophos;i="5.87,205,1631602800"; d="scan'208";a="292322431" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2021 05:55:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,205,1631602800"; d="scan'208";a="489556244" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga007.jf.intel.com with ESMTP; 03 Nov 2021 05:55:37 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 3 Nov 2021 05:55:36 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 3 Nov 2021 05:55:36 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.48) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 3 Nov 2021 05:55:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IB7s5GpVpOe3KXL8ZomKBcYex7guBSEgxTl7qPaoY0ucsefqQ5MYE28xpu2GS3CHXeIW+DZUOZxWdOoqOzTv9cfin4Vm66w+NGayMOcQ+eEdSuvnc5xA67lh29DruNGO30Tzy08rl0zGYM/JqzGb9WkpHWC9O1cV0Vs77MGEwG5y0QDavmu91OrQNdgrjU+vKcyYq3ec7Ssq5Ti8V5VxmcdG4deWQWwt1ribr76AcuCVIeBqNnIMsl0JloDMTzMCYZozeHYWKYbXWhmH2Zfhowz2MMhxvD7r600IPPeaBZBx09qaB2NGp4kWl5Pr2PRe/mm6R8dJsH0ixUyvcrSBcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a2lvzQJpQ0C1YpDmssrshDRLIs9I40MekhtVhKxBaE4=; b=RKgjpqqw1tQBLklTy5dBYtPBO9WnTc0UL4lUX1Q4Da4naqAuNbalkhmGWywza+64eKl6W9Vt4gn7ECGXib4pfsJYne9WO6Y3tbQwaiSbMrcOD5zcwZccgDV+zJJZgLhCrsgRP5mLqDOcA00MQimvBWgYUACqjHtpabKYmbOzoMVqi6gSe+1f4jqpg8n8BZcIQveMBy19/4Cdn7BREa1T6ZzV8lJHXp/tktnygmQqjziNzzMUMvFHjfh+r/KEAQRtNPd7XfZuDFXgJ3dQKpsjdLfTHrPWROW72BnysceJ92EZqYmL34VZ/MZZtJ6ZEFkaieso7xgDMb25Gv6V2jO6eg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a2lvzQJpQ0C1YpDmssrshDRLIs9I40MekhtVhKxBaE4=; b=IGniESGU3uLW9hXR3tM/WWctHebne0NZsuOollXt5sBC8R/mjyVKK9z8baa+YKaI7DDXIsSVVb547bPRymVqhjqRypm6/zhN8EERJ/X8nAl3KqkurXuyWWhwTbVIYqoNde2IUWiB84nQp1bA2oSwuhpA65othX0lrWcEPXFSHuc= Received: from DM8PR11MB5670.namprd11.prod.outlook.com (2603:10b6:8:37::12) by DM8PR11MB5669.namprd11.prod.outlook.com (2603:10b6:8:36::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 3 Nov 2021 12:55:35 +0000 Received: from DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::c0f1:1135:ceb5:ac10]) by DM8PR11MB5670.namprd11.prod.outlook.com ([fe80::c0f1:1135:ceb5:ac10%9]) with mapi id 15.20.4649.019; Wed, 3 Nov 2021 12:55:35 +0000 From: "Dumitrescu, Cristian" To: David Marchand , "dev@dpdk.org" CC: "Lin, Xueqin" , "Peng, ZhihongX" Thread-Topic: [PATCH] pipeline: remove unreachable branch Thread-Index: AQHX0IAKE0hpFUWYBEqFEhVZ5tAI56vxwCwA Date: Wed, 3 Nov 2021 12:55:35 +0000 Message-ID: References: <20211103065658.8100-1-david.marchand@redhat.com> In-Reply-To: <20211103065658.8100-1-david.marchand@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e8bd2b28-caa0-433d-46cf-08d99ec93aa1 x-ms-traffictypediagnostic: DM8PR11MB5669: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2449; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ba61BLKsuwI/uOSAg7/U6D+1hIMhJlcB7y6rPV6AIu1RfUKZPjKsNFRk4rCiu2quvUTdBoTYw1KBEoKajSA+dj7xGZNK07CRY/Oon9NhGK20VE7rN0fwsxN/FRmTh39ahcqr8fRCss5I96LaFvTyA3HyM/2nWPZwvXAI6cILAx+G5vHvmAgSm5C3RUNnbH6JfH5uzm9CkX7SNBT43gL6kbgDcAYipifPPtH02QJz0I08CGh2vbzqUmhI3gvdSw4fO5+/r1OMqqcTl+0q4ZIcuxxNYTb0JNuIjED7iF2lPfmIUMFQvu1PWcuI4aFvMb1vC+gc9b0GE0EUMqyIEhooEZ7HLI7R901L0KDlsv1UpoS3VufuxZ/eAc1LUcVET3jXTimSqnX9uBmcRVfUpgAJb4ZbgFHdUoQ0XNkHtxxJbYBwCVZlLWZpWfryXC6RM7U4DBgq8c0jZGZ/dVK2it7+4N+reE0v/4cEC5UE24Xsy/oEfANq+q7oacSMFcm+xpq9WQjMNNIvUnfJlfLr7x87UNK+rNgWnT0MAyNOWpJ8WzqlnMAd6pkUudg7ZZQAUxCv9vwv/g16A2P700qkvEFPqkkCHQLimyco8G/v6a1lqdZJAANephSR963nvfpZOlwLrwKqhKAufGACIir05Z6lZUjxcP7hHK2bpMqcXIxCQT7d9Vp44Z97eMNpsf1D0g7F+iJUQMxzvAdq9Y9kowWQLQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5670.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(110136005)(316002)(5660300002)(54906003)(4326008)(82960400001)(2906002)(53546011)(83380400001)(6506007)(9686003)(55016002)(107886003)(86362001)(7696005)(508600001)(76116006)(52536014)(8936002)(71200400001)(38070700005)(26005)(66556008)(66446008)(33656002)(64756008)(66476007)(66946007)(186003)(38100700002)(8676002)(122000001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LG9JvdWEqG87BYuBq2sYydIvPbmfO6SIyyB7ucZO/+gMG5GrIc7qbdDCCyRb?= =?us-ascii?Q?HzJ2za6FZRJEO8/NOmmodaYCDZhpuBc8VlJxteGvt3OpsoHcG+Cav1rK0hmy?= =?us-ascii?Q?SKP2r+0yJ/S6KPDECLC5xTfLvw7Lv7uYJvR5sXrfICH5cSyl+jE1/PVKjWSv?= =?us-ascii?Q?pyhckRB0ghZpVYT5/I+0xMRb0VaOROZhfHBl2SJTHcf7WKlEHetedKYlM5xz?= =?us-ascii?Q?0ZMY3qznz0H+/VJ2mx0eII2gq30WZ6lIisOPoGVI1hLYPhekBPl33tORbRsk?= =?us-ascii?Q?bRLzY5vtPPFvJcF6nYpDA53OQfGec9wnQn88pMIjMRN84PA2/VLzwvS76tjD?= =?us-ascii?Q?jEnPpNcs7Fgh4rINFAYw1TdFDoUcCRAAKYyKbMgA2zVHLJloHBX3a1+tYmX2?= =?us-ascii?Q?YmaiUyp8vD0Y3DOTC1QLfIa0kv8wpLZvXhglilh8LKOa6vXICGlvL7N5qU5t?= =?us-ascii?Q?T8LGBc/SUtvAnMzrrbbXX4M4d08OMTD8DQ/TWmjaH0dHNFPdAIkiv64NgCJ0?= =?us-ascii?Q?mOcPs/y73/Twr6i2/as7L3hU9Hs1gorw182g9JW/2VeN0PgKGVFx/WmGPxxg?= =?us-ascii?Q?4mDVQSQR23le21nLBi+wSqt1Yewt9M2iZFg6tlTeJ+c2j49eQc4UGVgG4Dm/?= =?us-ascii?Q?8Gph0Adoaey2WDmItMc6I00/SQd9Z02pKxSESnR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5SKx1uiQAnXVgtyavAbOke38irND+0fEetJFoYhJPMM/SQ+1LQhF?= =?us-ascii?Q?S/LBgHjwgjhPIcjhvMH99mEKNedPdIJHehaRyUs5dpgC9Uj2PXgB//Pc21/7?= =?us-ascii?Q?I+NUJA=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5670.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8bd2b28-caa0-433d-46cf-08d99ec93aa1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2021 12:55:35.7564 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IJ/a/gfCWB6sP/YMfMel9TiUDmKdBrXkLODAkaNO+Om2K5cbX35+4xgm/8pH+iyyrAsrkctwT68iEWUdng3ZAZJc8PVnfurRyUHdQqUnPMQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5669 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] pipeline: remove unreachable branch X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: David Marchand > Sent: Wednesday, November 3, 2021 6:57 AM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian ; Lin, Xueqin > ; Peng, ZhihongX > Subject: [PATCH] pipeline: remove unreachable branch >=20 > A previous change blamed it on compiler/ASan, while this is a real > (yet minor) issue. >=20 > This return -EINVAL is never reached since we test all combinations of > fidx and fcin booleans. > All branches end up with a return 0, factorize them. >=20 > Fixes: 84f5ac9418ea ("pipeline: fix build with ASan") > Fixes: f38913b7fb8e ("pipeline: add meter array to SWX") >=20 > Signed-off-by: David Marchand > --- > --- > lib/pipeline/rte_swx_pipeline.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) >=20 > diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipel= ine.c > index 1afaffefd4..0bdda7e0b3 100644 > --- a/lib/pipeline/rte_swx_pipeline.c > +++ b/lib/pipeline/rte_swx_pipeline.c > @@ -4539,8 +4539,6 @@ instr_meter_translate(struct rte_swx_pipeline *p, > instr->meter.color_out.struct_id =3D > (uint8_t)color_out_struct_id; > instr->meter.color_out.n_bits =3D fcout->n_bits; > instr->meter.color_out.offset =3D fcout->offset / 8; > - > - return 0; > } >=20 > /* index =3D HMEFT, length =3D HMEFT, color_in =3D I, color_out =3D MEF= . */ > @@ -4575,8 +4573,6 @@ instr_meter_translate(struct rte_swx_pipeline *p, > instr->meter.color_out.struct_id =3D > (uint8_t)color_out_struct_id; > instr->meter.color_out.n_bits =3D fcout->n_bits; > instr->meter.color_out.offset =3D fcout->offset / 8; > - > - return 0; > } >=20 > /* index =3D I, length =3D HMEFT, color_in =3D MEFT, color_out =3D MEF.= */ > @@ -4607,8 +4603,6 @@ instr_meter_translate(struct rte_swx_pipeline *p, > instr->meter.color_out.struct_id =3D > (uint8_t)color_out_struct_id; > instr->meter.color_out.n_bits =3D fcout->n_bits; > instr->meter.color_out.offset =3D fcout->offset / 8; > - > - return 0; > } >=20 > /* index =3D I, length =3D HMEFT, color_in =3D I, color_out =3D MEF. */ > @@ -4638,11 +4632,9 @@ instr_meter_translate(struct rte_swx_pipeline *p, > instr->meter.color_out.struct_id =3D > (uint8_t)color_out_struct_id; > instr->meter.color_out.n_bits =3D fcout->n_bits; > instr->meter.color_out.offset =3D fcout->offset / 8; > - > - return 0; > } >=20 > - return -EINVAL; > + return 0; > } >=20 > static inline void > -- > 2.23.0 This is a great idea, thanks David! I think it is a good compromise between keeping Coverity happy and preservi= ng the code structure and readability, so Acked-by: Cristian Dumitrescu