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 6A55CA00C2; Thu, 10 Feb 2022 04:02:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB01E40140; Thu, 10 Feb 2022 04:02:41 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 1731A40041 for ; Thu, 10 Feb 2022 04:02:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644462160; x=1675998160; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+Ng1waHKl1uaaYuRiSu3YBHtB/tTTDKsEhofm7d6Aes=; b=mjewbQqpdBxPOmTJx1+qOIAHcQFw6uivwagq/RZwx3UUgmOzHqIbJMcH 5jRtcdP0cwz4X3aephdBTULTDSxI5P96lIUn73Oo3PqUDskg6Mj/rLRtW LTz4v0e6ME9+JzUEjRNJ5rutw4bwQKUbE7gwXqeMcK6O8j8KzqIPewL6G bzHfkj3j2yvFyfPmmEqeGQijNRW3wvQVKxefX1vgbPeda8drn31GOQusX O6cX076DtbyjMmB1zjhc4EuarcK5K7PdWJpbfwGw7XFaFpW1SEYrqAo4l euMxHOkUHhjO5tNtGEqkE9wVP8aOPHySmhPDHCRVzPcyUYQE5HiW8Vmf6 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="248232643" X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="248232643" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 19:02:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,357,1635231600"; d="scan'208";a="537167031" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga007.fm.intel.com with ESMTP; 09 Feb 2022 19:02:39 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 9 Feb 2022 19:02:38 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 9 Feb 2022 19:02:38 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 9 Feb 2022 19:02:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aZOZzRVuQleOIbDdRno4Oy4qm4XLl3trflVMBieRLKBRmcTbPnMh7z3FLkpE8x6SYeYwerp6owTjxQApLGWimbIN2I/Na6h75Humo2R7WK/LuSzN529GWKGOqcPPmU/F9oKabgpmqPIPMWff1gnuEeEqnhrC5GPWMRjzC7Pw6MigAthsfMhA8ZCj2re5PXtLKh9mrsQfw+ont4VDTOmp8UNvm4TVxqnHaqp6lH9UaLwgtf3WdqPVF230Ncpq3IoQT9bzvvTI4EZ7BGnsFYRNNFzR5tj3OKZ9J/FYaitDOhql/KniwewgKtn43mv1VTNE7C/NCwgt2Pe/MnGGsUrxSg== 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=/u78VOxPHR588ZtJn96c44HdKLfpDcI4qPmAznhjZW8=; b=It4LCcsf7Gzoby3hCgOjosC53xHqdoCccj2PC0h46SC2pvZ5e5qMn2ZySp68gAr05QMyJGaAEJzvAqNqXWZFpAok1B+ujVeJUcQW8+RPsBXeV0BoWBq7hI+iS0gIbghTbpu1Gb/TuaQHTLYyVbN82lUbpqol35J+EBC6YTU01zkYI1TYYAl1uidr8nOoF9a2BCyBSwiTVLNMrYcbUlVs/TSzScz9dNKtPkbeLA7+s/lNoWGAFHsvhHF9gTF7m5wo3icAc612I8uwYTJga9yIsdaUackQ7qKQobbvXGcMqI6vrIoQFoovhL7k1T3ju+xFGRNCK01hhI2qWqjR9+35Nw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by BN9PR11MB5513.namprd11.prod.outlook.com (2603:10b6:408:102::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.14; Thu, 10 Feb 2022 03:02:31 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::d0ba:999b:3297:c220]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::d0ba:999b:3297:c220%4]) with mapi id 15.20.4951.019; Thu, 10 Feb 2022 03:02:31 +0000 From: "Xu, Rosen" To: Stephen Hemminger , "dev@dpdk.org" CC: Hemant Agrawal , Sachin Saxena Subject: RE: [PATCH v3 09/36] bus/*: remove unnecessary NULL checks Thread-Topic: [PATCH v3 09/36] bus/*: remove unnecessary NULL checks Thread-Index: AQHYHencc3liaiNuT0eWLIC7Ecb8o6yMGMjA Date: Thu, 10 Feb 2022 03:02:31 +0000 Message-ID: References: <20220124000518.319850-1-stephen@networkplumber.org> <20220209191748.377729-1-stephen@networkplumber.org> <20220209191748.377729-10-stephen@networkplumber.org> In-Reply-To: <20220209191748.377729-10-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjI1ZDIwMzgtOGU1Zi00MDhmLThhMDQtYzU0NzU1MGJjYmZkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTnNNMkp2Sk1vUXR3WUxIbXhWVjR0NitrQmNraVUzQzhJYjlRWDhiZjdJbllqanhYYUNmbkdJbHA4Nm93RUZFTSJ9 x-ctpclassification: CTP_NT authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d6d473df-629f-47a7-5cf6-08d9ec41c76e x-ms-traffictypediagnostic: BN9PR11MB5513:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zN385oyFDdANZVYSmYIVlJr/itkPeif28RrtK85eU1SLsNPxYEwkBTzfb+lvultSYbLlnnCBB1jAI4vgu7lAR20ELLwOUYUj3P+5jYvMAEcgvdhhPATPMnHFHnmOu1D0YhLefwUHDbzRH5rBl16Ar0ewMo51q8aDOY8RcQULc9jEXvmkRy8tzApJa9GBKc/yzQpr0Rz4y89hI9By8haPRsKpJLuDQQjTUUB+ZEnlEEXqNr1fo/P0W7Vcsmx8mPgaNSMiPCuXSFRL3axt/1gqfZVvVkrxQu2AoacUyAR51kIiKwp8zGDrSXELSxtQmDvaauti4btIMY6fdUcBDBrQLdHt3E8hunCSGMaoIMWa1s+9LAQPKHp+7cX3bXkbUepTiQwVTEN7AnQHY/JTIGfRGhS1f8mYyX+c1BhvKneEPeyo/FGtKGQ3RvNjxeJhc3vW++Hz3iICQ84Ut66cPoRP87QQZ+acfh8gUjErlNqIklYbOzWzVjF3AbeaWItFMHkqi+nkFE8ZV/Ig/RtV116gXT5BaF5n1vbmK0etsaO38VhKu3dR3uKfByfbv+BZeX2qZPXhViXBmrmOSV9MEJaMSllnLGcentotJGmqODqmcbfjNDYxeJz10iaORMX0mXgOCOEuPN1meeS35oDPu+HofDUVYjwSLuUbJfHIGHFIompkpMWgaIweL+eGGTa3RWvck6F72I9VF6rQ4yzZUebr4w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(55016003)(5660300002)(186003)(38100700002)(8936002)(52536014)(66946007)(122000001)(83380400001)(54906003)(2906002)(8676002)(76116006)(82960400001)(26005)(4326008)(38070700005)(316002)(110136005)(86362001)(53546011)(66556008)(508600001)(71200400001)(66446008)(64756008)(9686003)(66476007)(6506007)(33656002)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/ul2VbBwNRLSSg7YgC23x/+UgDQRAHijGgs8O9+4/nRxSlyq2QWEo1t7pYpu?= =?us-ascii?Q?SZw5bUMErEHhZHs4QUhbTRFLJRGWncX7Y1Hve+NijhCPpCd3vgHzLggjmEOM?= =?us-ascii?Q?kmdlAX+zZLW4qi7RfEHF5uZ/TJdD+1rWF7ePskRwXWlsZ+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3j8tv3QiAWL7lRi2ZPYk/C1KnBdJteEJXZmeO6hEFowN0XPV3m817?= =?us-ascii?Q?jAo3wDBeSkH26XvE4ZSkvID2Ts1NiG3gi2xDxcxIT8QzUbZ0wp/DZC9nlLSS?= =?us-ascii?Q?PV++gyS33Os1S8sQJZojM/DHnSlnO2Kohheted5lYb2rCTYfOHlI6IDWbeYT?= =?us-ascii?Q?dAQApVU9lVlPdhJXaawlte/gxOiKYmgAmdQJr9LkiZq0wem4H8EkbEnRTwuF?= =?us-ascii?Q?lGX/yPBIW3CGukQDmztWyMIO0pwEmmBI6WcoVAyCUsSQLQi0eld2avsLAqg4?= =?us-ascii?Q?pkl/FqgvKk59BCnTBa6tFEh4TQgPvTiXo3eOksP6lI3ZP9YImvKvLrFUTmzJ?= =?us-ascii?Q?TMHa7ell8zgdWRLftBC7kuwqii+xv6cFaYHYqlzIqtTBo1I3624iqbDr/VfX?= =?us-ascii?Q?AQHvJlCnQJgKQA8zTjYQ75BMlhuyJmY295gL55OBH6CY/Uf6ncyENacTJUaU?= =?us-ascii?Q?mXNBnZ0PdeuQ1XYXGr2EiqcPZR3I+jY4aGQA/sQkP+ec3aGsDIniBcukukYJ?= =?us-ascii?Q?TgLDgC8utD9C2V4tGBNWjaF6EVMmPRbAeM1ECEfQEVjMBc2YE43W7YAyOuLh?= =?us-ascii?Q?k27cG13C9G6MbzGluYSss2k=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: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6d473df-629f-47a7-5cf6-08d9ec41c76e X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2022 03:02:31.1782 (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: dGje21H3H1vIOOsyYbipgHVINg0dM7Pw8wzQfDM5kjJOIvjDfXRA/84jVLqZGiQj3Rj/d/IxjqGHTY3nUBIb/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5513 X-OriginatorOrg: intel.com 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 Hi, > -----Original Message----- > From: Stephen Hemminger > Sent: Thursday, February 10, 2022 3:17 > To: dev@dpdk.org > Cc: Stephen Hemminger ; Hemant Agrawal > ; Sachin Saxena ; > Xu, Rosen > Subject: [PATCH v3 09/36] bus/*: remove unnecessary NULL checks >=20 > Remove redundant NULL pointer checks before free functions found by > nullfree.cocci >=20 > Signed-off-by: Stephen Hemminger > Acked-by: Hemant Agrawal > --- > drivers/bus/fslmc/fslmc_bus.c | 6 ++---- > drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 6 ++---- > drivers/bus/ifpga/ifpga_bus.c | 12 ++++-------- > drivers/bus/pci/pci_params.c | 3 +-- > drivers/bus/pci/windows/pci.c | 3 +-- > drivers/bus/pci/windows/pci_netuio.c | 3 +-- > 6 files changed, 11 insertions(+), 22 deletions(-) >=20 > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.= c > index c5c8bbd57219..e005f2cb70b3 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -191,10 +191,8 @@ ifpga_scan_one(struct rte_rawdev *rawdev, > return afu_dev; >=20 > end: > - if (kvlist) > - rte_kvargs_free(kvlist); > - if (path) > - free(path); > + rte_kvargs_free(kvlist); > + free(path); > if (afu_dev) { > rte_intr_instance_free(afu_dev->intr_handle); > free(afu_dev); > @@ -254,10 +252,8 @@ ifpga_scan(void) > } >=20 > end: > - if (kvlist) > - rte_kvargs_free(kvlist); > - if (name) > - free(name); > + rte_kvargs_free(kvlist); > + free(name); >=20 > return 0; > } Reviewed-by Rosen Xu