From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.14187.1683855365500362065 for ; Thu, 11 May 2023 18:36:06 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=kYetmA6y; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683855365; x=1715391365; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NC5w54N0995F3+LTb12CH59FmWtwfnhClV265v4cSUs=; b=kYetmA6y5vVyFJtGCIu7MnHW8NqKbw3NwdgdTAH+7Bfl/irU1pbMUPbc QqcInKuQbp8NiYabD+P2Gru7Xy5E38zLra4D6VY7IrRSY4b2XuZoob9Zn iW65RJIEbmEL6mbfHAEcgQ9QvSxPAGKOQhYFQvxJ/55Li5ftThELo5Uf7 UepUKYnigqmxZ5MkgNaOlNgLOey+fYfoRgP75dHUfd5YVX4cfM0/ASyRg HmF48SRBd7dnhmuyrnYVafCCfBoayGFm7nTpJRgocw2X5vHUzHxeM5/xK VRefhOsUOjmfYTPGBQG1eQzLJ7Yq8UqOMwH90LDjUNeD1k7x0P+4yYdtY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="353800599" X-IronPort-AV: E=Sophos;i="5.99,269,1677571200"; d="scan'208";a="353800599" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 18:36:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="702980572" X-IronPort-AV: E=Sophos;i="5.99,268,1677571200"; d="scan'208";a="702980572" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP; 11 May 2023 18:35:59 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.23; Thu, 11 May 2023 18:35:58 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Thu, 11 May 2023 18:35:58 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Thu, 11 May 2023 18:35:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bnnrhVHMNRhn28gvp6zC71z5G7/B91coihP1fBab5q/ZZYyVdsg27rDCuR/S6pj590+HeAPgZEYqxkGq68elPp3vHJiCpo7IcesHk8+W6aAqq6CboNBlhI9SlJ2wNukMS4sKnRrBJnfkMV/q6JKTf+ZOY1lq3IAY+rBm3B3rUbLz8zHq2GhCYnELyHROC0Ca0CsjuD9JLjsSQM5LFO/SHrGxuxvEdKaGG+OORKpRBSg49F7COLPRMignRhyY7nqI1u65dFcvudtPkSu/tZti1BUhZPw/WMtcnv5VZ6az7g2yj5XWXTzNOkfnmsROx1Z7E1NOiMIUza7cxTVniB9RrQ== 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=XGCgqVCvUl510/DW5Z711zIdUwj8oZie0udmA3Dsslg=; b=S6z3RC7aoJSqHeDJEqkADAbyVhXQhQ/RD/tZD9m3gUpWbSXIV4FpBnlr5ef8ebaa/aOfDC2dszHKKoFr6UOXmsTMJvy8azLnXO+IhYJqlRRJ69cvMzzmsZmBJUJy2QpFoA+t2raj8dPv4bKTJPkkDnA5nHaxs6TuVgLaF4HsktfZuUzI3G205TQdp5rQ4RtLthCbB0RmordKMq/tmCEctH8orXak8SwANt8mU8yCW8OyQQhayCZsKjX4bBqZ1wqfNnUL/9xKjmPX0uY3fc4Jg4s1zRxgbDIaO01bkhawuUATK08YpHPL39+pcMAKb50WY/MsAYnbyu1yhr1zuowawg== 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 Received: from MN2PR11MB4031.namprd11.prod.outlook.com (2603:10b6:208:150::18) by CY5PR11MB6137.namprd11.prod.outlook.com (2603:10b6:930:2b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Fri, 12 May 2023 01:35:56 +0000 Received: from MN2PR11MB4031.namprd11.prod.outlook.com ([fe80::938:1dcf:6071:ef90]) by MN2PR11MB4031.namprd11.prod.outlook.com ([fe80::938:1dcf:6071:ef90%6]) with mapi id 15.20.6387.022; Fri, 12 May 2023 01:35:56 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "pedro.falcato@gmail.com" CC: Laszlo Ersek , "Wang, Jian J" , "Gao, Liming" , "Ni, Ray" , "Mike Maslenkin" Subject: Re: [edk2-devel] [PATCH v2 03/12] MdeModulePkg/SataControllerDxe: Remove useless null check Thread-Topic: [edk2-devel] [PATCH v2 03/12] MdeModulePkg/SataControllerDxe: Remove useless null check Thread-Index: AQHZgpPp3RvgEhQOhk2g8uCKi2p9ZK9V3wCA Date: Fri, 12 May 2023 01:35:56 +0000 Message-ID: References: <20230509163212.291333-1-pedro.falcato@gmail.com> <20230509163212.291333-4-pedro.falcato@gmail.com> In-Reply-To: <20230509163212.291333-4-pedro.falcato@gmail.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR11MB4031:EE_|CY5PR11MB6137:EE_ x-ms-office365-filtering-correlation-id: 72ea4a23-a202-4ba7-65df-08db52893b47 x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: b7XyJ7b7aPshdAKzlqnsxWwFdWFmFGRjMXU1r4dFNQ8TD6tookz2qLg1J5DY+B+6pPpUbvSe/hhZLveX82pm8nZnI1bLL47DGvZEODgILSVWPO/ffx8KhowomIl/MQsFezifR4Zot/6CgDP6KF23aKk62w0JDf6Y90D9xMU+zt3VDAc8ftlfh/lnlDqg1nHiOJIkLE/Oy7yE6u6p+jTmSMal1ZqWg3O1Brqm9TZrIjG1QuXQInnhcoSHJ9qUvAKvwW7DY6DOcsZwgSS5DnsJWFhHGMqe/gbcLjjAqiDq5lFSMDCWigwFWsCTOTC+VDfv1uwQAe141Y7ZHoW48sDtsyYGW/Sj39qcZphuH3tCJ32nbBczZpJ6A9tTM3fSNgKFB29+h/Z06AOUlDpnVSmVjJp0aAItYN7IW7kBxTcWnv+f0xFtij4mNALqrAZ5QFBzKDHLnIQuOdxl8o2od4taXFSOivzIzpzFfNBCechD0/gayKOXKRQZCiadAM7J4wiDDoId7CV9T9wPVX1w4IOvy16OYNaQnZE+LIwhQTZ2xGtglMEldUbb7XQRFaZJmJ0ux7ea6IpYoDTvZHHzSxSg9jhRVj45FgPjp8jFcrBl14OP+lcEOU/UvcaV3pX/RquVjAH97OAlWikOTtQB0mgdwA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR11MB4031.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199021)(4326008)(54906003)(86362001)(66946007)(64756008)(66476007)(66556008)(55016003)(76116006)(66446008)(7696005)(8676002)(9686003)(41300700001)(33656002)(38100700002)(53546011)(6506007)(186003)(2906002)(8936002)(52536014)(966005)(478600001)(38070700005)(71200400001)(5660300002)(316002)(82960400001)(83380400001)(122000001)(110136005)(66899021);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4heGBPwSbq3WJtPR3T7Rwb7m8/WuocRKpMX54Bw0UJQt1nCMUUqLU3+XvcAN?= =?us-ascii?Q?rpzktBviKLumLq8gh8xI17CYrtjdneVdJpX46t08laPLetFEFt9bkHhw7GqK?= =?us-ascii?Q?yCjs0IYvWx8hyOTP9KEWFS6BXXJoY15I6i8g9SygqR//LU+wLA3kPtwtXGx1?= =?us-ascii?Q?HjOPQ3z5yJWYnLs2AGWa5y/nl0vGmFaxOwRxUC3bexRI9crtPCHmDYKwo29b?= =?us-ascii?Q?hDx92Jn6Y9DKs52RKduCbjNg8pF2k3e10geS5k7BgfzQvDbvRjvWkqR2e1lD?= =?us-ascii?Q?8pZHjrV298RUk29f8b/yFqDwb3B2bCosRD8XIP2tOjUw3JHPznjr5Y2y13Ee?= =?us-ascii?Q?hppLZfm5yHvlp+kKrmmyOgrvvtnp8nzL3v05hU6nVeIctOfjgPvJ24FUFOye?= =?us-ascii?Q?SpPbJeD1AXDPc1Aehhbl1o01yc9IeTEgdxJNTSEw5aggtl2g3dVTG00cWOul?= =?us-ascii?Q?FZW1pa7P5SsxUp2oCv1BThrMsAb/+POk9SjZvET+DU3HO8iV8JyyNjKf+IJa?= =?us-ascii?Q?mqqY7SaMrFZkppU9v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-ascii?Q?Npzerqv4vEBiatQxHIWwP+eY9dUIRuBVHZBr0jHJxEcWGP+YG/InI0AClN7L?= =?us-ascii?Q?YdPhVs5ndcIhbRqC9NHA5UX5fBzLMT4xHPZPgX+RvmBXEJh9EO4JPelgow?= =?us-ascii?Q?=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR11MB4031.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72ea4a23-a202-4ba7-65df-08db52893b47 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 May 2023 01:35:56.1439 (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: 0PKzg/5Ujd+M/3cGsTh+lgjXpagoIqd3CqVL4X5KM2bv+3kyE+8dCmPnIl9CP3iyM+AlM//3mBGC/ViAz8ijpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6137 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao A Wu Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Pedro > Falcato > Sent: Wednesday, May 10, 2023 12:32 AM > To: devel@edk2.groups.io > Cc: Laszlo Ersek ; Pedro Falcato > ; Wang, Jian J ; Gao, > Liming ; Wu, Hao A ; Ni, > Ray ; Mike Maslenkin > Subject: [edk2-devel] [PATCH v2 03/12] MdeModulePkg/SataControllerDxe: > Remove useless null check >=20 > ASSERT (Private !=3D NULL) already covers this check. > See commit 81310a6. >=20 > Cc: Jian J Wang > Cc: Liming Gao > Cc: Hao A Wu > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Mike Maslenkin > Signed-off-by: Pedro Falcato > --- > .../Pci/SataControllerDxe/SataController.c | 44 +++++++++---------- > 1 file changed, 21 insertions(+), 23 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c > b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c > index 277bc6182db6..f0ffd311d7b9 100644 > --- a/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c > +++ b/MdeModulePkg/Bus/Pci/SataControllerDxe/SataController.c > @@ -626,34 +626,32 @@ SataControllerStop ( > return Status; > } >=20 > - if (Private !=3D NULL) { > - if (Private->DisqualifiedModes !=3D NULL) { > - FreePool (Private->DisqualifiedModes); > - } > - > - if (Private->IdentifyData !=3D NULL) { > - FreePool (Private->IdentifyData); > - } > + if (Private->DisqualifiedModes !=3D NULL) { > + FreePool (Private->DisqualifiedModes); > + } >=20 > - if (Private->IdentifyValid !=3D NULL) { > - FreePool (Private->IdentifyValid); > - } > + if (Private->IdentifyData !=3D NULL) { > + FreePool (Private->IdentifyData); > + } >=20 > - if (Private->PciAttributesChanged) { > - // > - // Restore original PCI attributes > - // > - Private->PciIo->Attributes ( > - Private->PciIo, > - EfiPciIoAttributeOperationSet, > - Private->OriginalPciAttributes, > - NULL > - ); > - } > + if (Private->IdentifyValid !=3D NULL) { > + FreePool (Private->IdentifyValid); > + } >=20 > - FreePool (Private); > + if (Private->PciAttributesChanged) { > + // > + // Restore original PCI attributes > + // > + Private->PciIo->Attributes ( > + Private->PciIo, > + EfiPciIoAttributeOperationSet, > + Private->OriginalPciAttributes, > + NULL > + ); > } >=20 > + FreePool (Private); > + > // > // Close protocols opened by Sata Controller driver > // > -- > 2.40.1 >=20 >=20 >=20 >=20 >=20