From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3EB4EA0562; Tue, 31 Mar 2020 12:53:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 27943322C; Tue, 31 Mar 2020 12:53:56 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80079.outbound.protection.outlook.com [40.107.8.79]) by dpdk.org (Postfix) with ESMTP id 6BDEF2C15 for ; Tue, 31 Mar 2020 12:53:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pvr/tmPzCuAHw+epaIM0ZZ8jCBN96ZbqYU0ojNv1CAjb+AvI1wrlFLS3xZsmo9D5tLkGSB9npkWOVhrg5c94m2JKiFaPcHn4eeZ+AOy0Gt4UBRHBgoNzKKu3m1JuNpiTI454COgyaE+VTjLOELCIyXObTUHEI0GLddRCC7OZdxFsqU2n7fT8c9s6PrW+bqCOOZ0xIzvqvXwOvXYXCkwdkeXa4a1iw4fb3GCFn1hFEmRYQRbMt/lTFdSpFM52/JpO8ajyEn7BhZEFmLee5l3O24i8s19PEOoPRqDArDvhwOXovJQR8hZ28l78A+vybpxk1kFNmX+34VhFx4B0FACg/A== 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-SenderADCheck; bh=nUmgMveITyZFaPrV9dVC+7UqrdFQBJsg4Yq5QRI67eY=; b=V5S3l0FCsjNh6c/vbGYMg0IRX5Ulv4cTkuSm0SsROgz/oDlV5osGjCdc/q4v5cxhaq1TIUiohx/UJ2jvWaDSwIwCZ2VpIJd2tn7lecDWcNw8POxfvTgmk75IaDseIFa7aTceT7d4rA476hYyjJpRIIiL5M48nNDOku8TwZU5PXQCGL+DwpI1OR9094/Z9T+EnPF0oxQvqCYR2JKMONbtR/7dqB9qdoqnEkYrw1vbM0xGROxFgqkMbf71CzCcJ8iQVACq6kz4UazcgLcsKVFJol1YEycYbvlmFy7oUUngbOxoVPvuPU59eJ1XQltTK8+tuZBKDixIY120E55B9T7OSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=nUmgMveITyZFaPrV9dVC+7UqrdFQBJsg4Yq5QRI67eY=; b=PcGcHhQpjN3GP0ldu9BT6oyGQzXz+WhSA4imsr3PN1NRtW2BOZSM10Kit5HWBRBoUl31HhQ/CNUwgCXSO+oTEgdxNIkB224KyNxKofNL0W5IOnxniQ9Pc9HzVyzKbf1YELVQjGyvfrsBhhz6/yhg226LJinkRIYVySdZ/uzc2+I= Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com (52.133.39.139) by AM0PR0502MB4052.eurprd05.prod.outlook.com (52.133.36.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Tue, 31 Mar 2020 10:53:52 +0000 Received: from AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::a564:a117:9022:1fee]) by AM0PR0502MB4019.eurprd05.prod.outlook.com ([fe80::a564:a117:9022:1fee%7]) with mapi id 15.20.2856.018; Tue, 31 Mar 2020 10:53:52 +0000 From: Matan Azrad To: wangyunjian , "dev@dpdk.org" CC: Shahaf Shuler , Slava Ovsiienko , "jerry.lilijun@huawei.com" , "xudingke@huawei.com" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check Thread-Index: AQHWB0aXeNiS+XJD7E6sUtJ1EsduT6hihlpg Date: Tue, 31 Mar 2020 10:53:52 +0000 Message-ID: References: <1585650269-11556-1-git-send-email-wangyunjian@huawei.com> In-Reply-To: <1585650269-11556-1-git-send-email-wangyunjian@huawei.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [77.125.94.232] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 7063af69-4cad-4825-5eaf-08d7d561cd06 x-ms-traffictypediagnostic: AM0PR0502MB4052:|AM0PR0502MB4052: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1247; x-forefront-prvs: 0359162B6D x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR0502MB4019.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(4636009)(136003)(396003)(366004)(39860400002)(346002)(376002)(186003)(6506007)(81156014)(81166006)(54906003)(110136005)(86362001)(478600001)(8676002)(33656002)(52536014)(2906002)(5660300002)(9686003)(66556008)(7696005)(316002)(71200400001)(64756008)(66946007)(66446008)(66476007)(8936002)(26005)(76116006)(4326008)(55016002); DIR:OUT; SFP:1101; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zNA+pkEWHP3eE59y2N4S0Pjz6otrckw0XzSDysOXcIaWK9AOsziz20CA4LxKPdiU01BUH8Dbo0W19BunxX2aiTV5N9GOPquuYNKcF639bIPMVtNH/jlJQsBOmf5gMj68sArbBtg6fFqazGTkfnxHtDEMBa+lMSh7BEa/3/vtmCNot8r2O/CbyE79JoPWQ5cgpNT7r8MyzV13Se/0DXbIWSEbXcJPhWESM0GbZblts3IBpUBtWnxX69oMh/xo2xa47THDE4Rqw9skZWCybVZDvl+dPjN2yodT33dao5KPyaKkSeQrzVcYpHiIUkEgto3fj4z4DR7TZbev3hQi6qwD/QRtwbScELhkiGm81rEwn6TqIbyI07tykaSN7iV9YYGaM32U9pSkYPKM1SgPg6h377hDihUL8YVGwi8dnMw6FBd853aSGZw6nnp+V56TEWnp x-ms-exchange-antispam-messagedata: vVv15HKvYXhpZR/P4c01cbnDmROkuUtuJ8nIlPH7IzOc2aenFRnxrLLUrfp88aULAMqnkcns5Cb/Wfv3RNlBTQ/amdO+godpfLn+YWJfpPXoT+hwC3Zx5ic1ph73shHjhDRpTVHIBBwJLnD9GPxRDw== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7063af69-4cad-4825-5eaf-08d7d561cd06 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Mar 2020 10:53:52.4025 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vrpIZXHTrBo8duX+5nUnxRphcspV3EgOzv2nR1Ys2+eBe0ti0cre8SmIgJ58T7W2EnORHIJpgq1J1wQJeJPWPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB4052 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: remove unnecessary NULL check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" From: wangyunjian > From: Yunjian Wang >=20 > This NULL check is unnecessary, container_of is never NULL. >=20 > Signed-off-by: Yunjian Wang > --- > drivers/net/mlx5/mlx5.c | 3 --- > 1 file changed, 3 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > 94aaa6057..2e4edb123 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -747,7 +747,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv) > if (pos) { > tbl_data =3D container_of(pos, struct > mlx5_flow_tbl_data_entry, > entry); > - MLX5_ASSERT(tbl_data); So, maybe the assert should be on entry? > mlx5_hlist_remove(sh->flow_tbls, pos); > rte_free(tbl_data); > } > @@ -756,7 +755,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv) > if (pos) { > tbl_data =3D container_of(pos, struct > mlx5_flow_tbl_data_entry, > entry); > - MLX5_ASSERT(tbl_data); > mlx5_hlist_remove(sh->flow_tbls, pos); > rte_free(tbl_data); > } > @@ -766,7 +764,6 @@ mlx5_free_table_hash_list(struct mlx5_priv *priv) > if (pos) { > tbl_data =3D container_of(pos, struct > mlx5_flow_tbl_data_entry, > entry); > - MLX5_ASSERT(tbl_data); > mlx5_hlist_remove(sh->flow_tbls, pos); > rte_free(tbl_data); > } > -- > 2.19.1 >=20