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 1A800A04AD; Mon, 24 Jan 2022 19:09:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01A5341180; Mon, 24 Jan 2022 19:09:48 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2076.outbound.protection.outlook.com [40.107.22.76]) by mails.dpdk.org (Postfix) with ESMTP id 567964117A for ; Mon, 24 Jan 2022 19:09:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aOJdmtbKBqu3YDRxswcSK4hgd36Glqs16Vzf6HLHA46yYXbqnAZ5h9HrF+qxL92i8m6mLw9m7lkHn48yvhk2j1G/LrkH8QQpYvMapweumnHUUU5DzK4rQiYNlNvvkolIRB6XKwYoUrGwg1x9ORRLnHATi71ErKFmCICft8pbm3EpcTy6YLZqbdrKc+7hq0Q1A0QfC/BBzu6/gLnNIJRXJu8CnZsh+scrOjlltD/IN73qVIyKvlW6kZjd3QF5ra+tlWEF99pEAjBD+pY0QRNVfCgxHIh6px/tMXtqxfr4GAsrMVDa+3oHhPbykrw2Bs8b6BD/qdQWmWuDYR7uSOWgmQ== 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=0f9dYFShJYO+6kke6C2S2W9PR1FdeAFxJ52KJa+z9V0=; b=IpxGs4meSJBFDA6dRPFzvk46JwhhsqdNRy6O4xqpxiAiIWtez/ojDMaM4uFALusa4F6GWu6pxdspWVvPtXBlOfcM8vA+ilmNAJZnhBJdlgN8J9RfV59V0Tc6jcFlVjqSKbRkZM4BskPo9vEPiwsCBVI1oTO4z4DV151IIPxINTJS2LEoSL9UFscbjAlkrHiB0d1pIvlK7qpM2dkqKc87pi/v2vbOPdxONqUtEmV1MZnsz6pf/ayvjVyPhI1J5s5GUCWdT/7Sg7++omxyrpzlSpOgjAFhqIM5gLo0QSA3yFL6nd2tpM2D4HCgeX1lwOY2Nc7yCfMSgwZiOuvL6rc+HA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0f9dYFShJYO+6kke6C2S2W9PR1FdeAFxJ52KJa+z9V0=; b=CZcBYrqPF7KY3q24qmz6pXyeA55zbh7aaDtz5vVqgknHB8QfILD6qEZHL0PHRnq/yanOZ8m/RhfkKpaz5hCgbTj2qucxt1i3B3DJht9yC3MjChka7lvUUSlgbc8F6UW6gWIBPI0R9KFHOk6K5Tcm7rw3Gh+YOthKr4zay39+Avg= Received: from DB9PR04MB8429.eurprd04.prod.outlook.com (2603:10a6:10:24e::23) by DBBPR04MB6075.eurprd04.prod.outlook.com (2603:10a6:10:c4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.17; Mon, 24 Jan 2022 18:09:46 +0000 Received: from DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::ddab:6e8:fc04:389d]) by DB9PR04MB8429.eurprd04.prod.outlook.com ([fe80::ddab:6e8:fc04:389d%3]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 18:09:46 +0000 From: Nipun Gupta To: Stephen Hemminger , "dev@dpdk.org" Subject: RE: [PATCH v2 70/83] raw/dpaa2_qdma: remove unnecessary NULL checks Thread-Topic: [PATCH v2 70/83] raw/dpaa2_qdma: remove unnecessary NULL checks Thread-Index: AQHYEUqfL8wevwyu/EOg5JNJVbV596xyeCYg Date: Mon, 24 Jan 2022 18:09:46 +0000 Message-ID: References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124174719.14417-1-stephen@networkplumber.org> <20220124174719.14417-71-stephen@networkplumber.org> In-Reply-To: <20220124174719.14417-71-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 58b60183-34bc-42a1-0241-08d9df64b447 x-ms-traffictypediagnostic: DBBPR04MB6075:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1013; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: a5RNz6LpT9Uzk+q03A2p3eFSDr2c/eim8/T82mhvc27IQlmrG+4FnTi0GhzDkOtWECdRlGKKqwxPyiN2n0wZYrGB8FcI11gtoBRZcXD73835DniKh/scPqT/Z+Ms4qJTrV4terhg2mHoOovEcf0ud5qWiDE+QDHM54hEG04fGR0VbjpLiZSa44Bh+fIr4D8Ra0cw20a1tuQfQM1oQ3pUyRCkce6dn6tzWKIAMIcjAl2a46P2R5Xv3KKqOAG1zdnDQlhFrsCmbGNnudLcer7zIMDhu6a4ezYIvZUzdgPBRidrhkhzoYsCxUhKqTAlWeifmRo+n8HlGuRfCdOgwk1ecaZlCfJmkKwAdM/WAMwD1fxXNnHE8W6EIvFy9e6tf40PqLGRTmdd+Prpzdpz8gehBnlnVcm6RhSv4DijmW6sC17lP10K+MQi70caTeW19ceq8Wmn49e7KXO/JVhiWY4QfE8NyxBUTP38y/bzUAjkYBEdl3xZDIt8ABt7lFlxia53mqDTz3q+omKQAYww8yggfaRvJTGVzJIBrqDXMOh7GArmk1kGajnALKS0kUqmYT7WyUYTaEkPxOVxU1TRtl+iQaCmGWdh2XkVzG4FFJNfQGNZljMYpzi9a09CQXrzLGLNctoepTA+A81/jSjr4YMNvERdq0hDo7ZOjpMH9UKNY7iGp8VASMABmtqfprmdcetVRD1Xbt95XhckFLAriVqxtA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8429.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(33656002)(76116006)(44832011)(55236004)(8676002)(38100700002)(122000001)(53546011)(6506007)(83380400001)(71200400001)(52536014)(66446008)(86362001)(66946007)(38070700005)(316002)(64756008)(508600001)(55016003)(66476007)(5660300002)(110136005)(9686003)(66556008)(7696005)(186003)(2906002)(26005)(8936002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?wyfIyNIdj6TO6W9uhl4kpLg78P+xpThsMw7wuEZ9puNcEW/U+WEbbfWUj1qe?= =?us-ascii?Q?RUKP5KUxEzjsVxrvcetlMURf10xb76TETtOi2N5RWJR33l+xaBjRsn4LNjcJ?= =?us-ascii?Q?yOeSOtwWYlU7Wd9zuSdI1iQBzhOZo0OoKJqEED9TxhN3g4tl/B5WhPCy9sww?= =?us-ascii?Q?RcVf+Kr1fYVnyo4LS3pKu9AsUg1Uacj5aLFoXO1gr+8YfZRBwbwzie08tkyb?= =?us-ascii?Q?vqgbVjie+XBc840V4fgU557cUr7T9gES0VJhhg+pi6HWVPzyGgB66a5sOgDR?= =?us-ascii?Q?DIO7PdmXAbzrrtcG/aYfZ+bjoxz8Ktkozan6m1jXLsZDogfIdxeXxrJMCqk9?= =?us-ascii?Q?OwL/fTOSdbkGzZPxRW+UCpMi/AXLP0piWSA69BDLLJIV2cYFdFaVVyEEk6xU?= =?us-ascii?Q?guxX33Uh9Mm7je7/q3i+Ag8FDcmV4vhW6HlxJ0qTxfVGyPKgoBiJ/c6Y/n9K?= =?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l1szAjl/8EWb5gsZGy1WOP35gvNK?= =?us-ascii?Q?I/nm8VQCpdF2ZXaChfkVCu458eG+WqK7Fo5FqLlBv1JYKwEM8JSP1gAD1omd?= =?us-ascii?Q?wHaqcIghGJIS4EMw7EP6oyVwr4FNiOg2LBZop0rzIY0kxzIsv0hCJoEnSneX?= =?us-ascii?Q?BMSnUvg52PTxJAxOYMGaVaZ/JE9hIzUIxhAH2p6PfcEIDDowPKTUFcF4o8Sq?= =?us-ascii?Q?l1zuanFXrAU1V6AKEtbeBQodaJ4xn9w5QkAI9U1LhJw5T3EhqDF1rZnNyLPT?= =?us-ascii?Q?SQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8429.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58b60183-34bc-42a1-0241-08d9df64b447 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2022 18:09:46.3130 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JIEh5nBwBUorKt6xLG5h3QxCuD1tG8sskuRTriNKWMoveCrVF8vX5zIh/WNspfNuMPSZHxCLSXZsLRmbeJ0vcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6075 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 Acked-by: Nipun Gupta > -----Original Message----- > From: Stephen Hemminger > Sent: 24 January 2022 23:17 > To: dev@dpdk.org > Cc: Stephen Hemminger ; Nipun Gupta > > Subject: [PATCH v2 70/83] raw/dpaa2_qdma: remove unnecessary NULL checks >=20 > Remove redundant NULL pointer checks before free functions > found by nullfree.cocci >=20 > Signed-off-by: Stephen Hemminger > --- > drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) >=20 > diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > index ebc2cd5d0ddc..b2260439a4ef 100644 > --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c > @@ -1115,11 +1115,9 @@ dpaa2_qdma_reset(struct rte_rawdev *rawdev) >=20 > /* Reset and free virtual queues */ > for (i =3D 0; i < qdma_dev->max_vqs; i++) { > - if (qdma_dev->vqs[i].status_ring) > - rte_ring_free(qdma_dev->vqs[i].status_ring); > + rte_ring_free(qdma_dev->vqs[i].status_ring); > } > - if (qdma_dev->vqs) > - rte_free(qdma_dev->vqs); > + rte_free(qdma_dev->vqs); > qdma_dev->vqs =3D NULL; >=20 > /* Reset per core info */ > @@ -1314,8 +1312,7 @@ dpaa2_qdma_queue_setup(struct rte_rawdev > *rawdev, >=20 > if (qdma_dev->vqs[i].hw_queue =3D=3D NULL) { > DPAA2_QDMA_ERR("No H/W queue available for VQ"); > - if (qdma_dev->vqs[i].status_ring) > - rte_ring_free(qdma_dev->vqs[i].status_ring); > + rte_ring_free(qdma_dev->vqs[i].status_ring); > qdma_dev->vqs[i].status_ring =3D NULL; > rte_spinlock_unlock(&qdma_dev->lock); > return -ENODEV; > @@ -1516,14 +1513,12 @@ dpaa2_qdma_queue_release(struct rte_rawdev > *rawdev, > if (qdma_vq->exclusive_hw_queue) > free_hw_queue(qdma_vq->hw_queue); > else { > - if (qdma_vq->status_ring) > - rte_ring_free(qdma_vq->status_ring); > + rte_ring_free(qdma_vq->status_ring); >=20 > put_hw_queue(qdma_vq->hw_queue); > } >=20 > - if (qdma_vq->fle_pool) > - rte_mempool_free(qdma_vq->fle_pool); > + rte_mempool_free(qdma_vq->fle_pool); >=20 > memset(qdma_vq, 0, sizeof(struct qdma_virt_queue)); >=20 > -- > 2.30.2