From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 433F4AC092D for ; Mon, 31 Jul 2023 01:49:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=loqym4JY5Smp2LvxKdQUzqQNN9UivKUvFY6wpeqcCHc=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-IronPort-AV:X-IronPort-AV:X-Received:X-ExtLoop1:X-IronPort-AV:X-IronPort-AV:X-Received:X-Received:X-Received:X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:x-ms-publictraffictype:x-ms-traffictypediagnostic:x-ms-office365-filtering-correlation-id:x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay:x-microsoft-antispam-message-info:x-ms-exchange-antispam-messagedata-chunkcount:x-ms-exchange-antispam-messagedata-0:MIME-Version:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-originalarrivaltime:X-MS-Exchange-CrossTenant-fromentityheader:X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:X-MS-Exchange-CrossTenant-userprincipalname:X-MS-Exchange-Transport-CrossTe nantHeadersStamped:X-OriginatorOrg:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1690768138; v=1; b=ews3cWNVxKbULuwBNQoj2oct/f94Xd+eBMNRWhC5xKEjJPDjizIazpx6l1r5nNAinXQXP1Kg 3/QahY1TgWX33/+K2X6CMUHJIt/ZQpllPaTAVP1FzG8cjRuDjQ0RZmoCB7NOKeE7Jvh2nJkbe7+ Qzke2nkfnznCQGMF5v/hWWv8= X-Received: by 127.0.0.2 with SMTP id b5L3YY7687511xJwTZ7p1dzt; Sun, 30 Jul 2023 18:48:58 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.86434.1690768137955524683 for ; Sun, 30 Jul 2023 18:48:58 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="455270361" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="455270361" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2023 18:48:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10787"; a="705205926" X-IronPort-AV: E=Sophos;i="6.01,243,1684825200"; d="scan'208";a="705205926" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga006.jf.intel.com with ESMTP; 30 Jul 2023 18:48:51 -0700 X-Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sun, 30 Jul 2023 18:48:51 -0700 X-Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sun, 30 Jul 2023 18:48:51 -0700 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2507.27 via Frontend Transport; Sun, 30 Jul 2023 18:48:51 -0700 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Sun, 30 Jul 2023 18:48:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MJtoF3behgUAXTnO5YwsXiRyKcZ270bwarnCLpICzMJt3kCl/dwJSvb/W5FdDkgaDCmN7QsuP67XdFypO8d0OzhZ3lKn9xestsRyHwhdYMWfMFlpICj0NYdamdtaNQLBgP3+TYrVHnWkHT2Vex5t0YZNVflJbUs/AT/hL58MaChecBl/7x+o6mc3udcMU6rg41OtZ+I6kt+LyK4naPi5FPmMycMpL+WVPydrU22+Oa9zNNTgqizN0J1JFNMkxfIPoWoVugy7VZ3nbiYm1S7JIio1+NRZkxn7niWposdVQsxKosi/RgF4umgb2Fr6+M5PccSDJvk4P4YLppSGX/KlXw== 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=+Q6OUzv2qrtL9kq6Dmnsm3OGSOfYeIntP8GRaW3STNA=; b=MYncX/jPSwm9cg/dJmcTqqzugKq2PsKwE4fO86BWR5cbGKew82GVcc9VBNwiggO/eR9yCTZOmTCMxAy3DMgk3oXy8BY/TN7AKknR5D0m5nHjsnZwv7P3Kr+38r5+3Xk4WezSlMMdsOgssJhvrxb1z9RtAV1ANHR4MoQjhIzHa96v13pWS5TZacjmWpYMVmBhIIKxSKIE4NEqf+VhefIlarlaaSlN4GwCo9QJG7gkoHMx6ZSe+m6zpVTJ2Mhi0cyWa+sT3PNPnR6Qi7EOxlFvvl7F/9FCB4GTkaizWeF9uqtervqTmDsLnS2RZ2KuKQGq6HUjRSCttheI2MJM1CP1Qg== 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 X-Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by DM4PR11MB5230.namprd11.prod.outlook.com (2603:10b6:5:39a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.42; Mon, 31 Jul 2023 01:48:43 +0000 X-Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::ebe2:341b:4ed7:d19b]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::ebe2:341b:4ed7:d19b%6]) with mapi id 15.20.6631.042; Mon, 31 Jul 2023 01:48:43 +0000 From: "Wu, Hao A" To: Ranbir Singh , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [edk2-devel] [PATCH v4 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE Coverity issue Thread-Topic: [PATCH v4 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix UNUSED_VALUE Coverity issue Thread-Index: AQHZuGanC/K46OEPvEizy5xQTsrz56/TMTlQ Date: Mon, 31 Jul 2023 01:48:43 +0000 Message-ID: References: <20230717042444.2242552-1-rsingh@ventanamicro.com> <20230717042444.2242552-3-rsingh@ventanamicro.com> In-Reply-To: <20230717042444.2242552-3-rsingh@ventanamicro.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|DM4PR11MB5230:EE_ x-ms-office365-filtering-correlation-id: b50af265-a0d7-46be-95cf-08db916845c0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: nMsgzFLZatEuW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ErUURUM7poyNlHI5vlhvj+d+tVQHLb6?= =?us-ascii?Q?TCIAKXFXwWxkK7OwTKho+QrxbINBLBoOiHucnpUD2WTkadNBl9dJCfI4NZxD?= =?us-ascii?Q?VJYrig0KtegLollvFV+3AhA3Lt0jki9Z6q1CUJeLbmuS+FxCFUYOlDxNzqGJ?= =?us-ascii?Q?uuANuuGN3lFSXLtXNy+mOmX/ZFIjtCUWWCqUt4rpsxcjfrfRSTW6Y1fW+nvW?= =?us-ascii?Q?yPl8jb716jOFfpa6mkZpcYcqMyJJ9RgwUWrIrzERcC3ernZ7cDGXYqWLX2BS?= =?us-ascii?Q?Nt6EiQmfjmDhmh4rd00EoY30QEdCiMB/bm/MkFdpm7JtYuhoq9YojE076LR+?= =?us-ascii?Q?68vh4Po/TGPX86CiSm8O8KHlUx4+4DMlYypemB7US2w+OhOWcQHsuAhRFnEg?= =?us-ascii?Q?Av7j9hQRlg0DfII6YCWw9Epc/qDkuiIJYrbwewbo?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b50af265-a0d7-46be-95cf-08db916845c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2023 01:48:43.5461 (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: jq9joO9/veUU0moiBniA36hLqgXABUN7tjUM08CRvFgjGAOY90BNPbgMXqaA1D0JFeakhSRBvieEuviWd6ayow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5230 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,hao.a.wu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: haya1qtLpPCOPCP0PaCecHl6x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ews3cWNV; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io > -----Original Message----- > From: Ranbir Singh > Sent: Monday, July 17, 2023 12:25 PM > To: devel@edk2.groups.io; rsingh@ventanamicro.com > Cc: Wu, Hao A ; Ni, Ray > Subject: [PATCH v4 2/2] MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix > UNUSED_VALUE Coverity issue >=20 > From: Ranbir Singh >=20 > The return value stored in Status after call to SetDriveParameters > is not made of any use thereafter and hence it remains as UNUSED. >=20 > Based on Hao's findings (https://edk2.groups.io/g/devel/message/106844), > the successful execution of SetDriveParameters() is not mandatory for > initializing IDE mode of a hard disk device. Hence remove the 'Status' > assignment of the return value from SetDriveParameters() and instead add > error checks & DEBUG_WARN level messages within SetDriveParameters() > function after sending INIT_DRIVE_PARAM & SET_MULTIPLE_MODE ATA > commands. Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4204 >=20 > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Ranbir Singh > Signed-off-by: Ranbir Singh > --- > MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c > b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c > index 75403886e44a..19d7b4930cb7 100644 > --- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c > +++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/IdeMode.c > @@ -1992,6 +1992,10 @@ SetDriveParameters ( > NULL >=20 > ); >=20 >=20 >=20 > + if (EFI_ERROR (Status)) { >=20 > + DEBUG ((DEBUG_WARN, "Init Drive Parameters Fail, Status =3D %r\n", > Status)); >=20 > + } >=20 > + >=20 > // >=20 > // Send Set Multiple parameters >=20 > // >=20 > @@ -2008,6 +2012,10 @@ SetDriveParameters ( > NULL >=20 > ); >=20 >=20 >=20 > + if (EFI_ERROR (Status)) { >=20 > + DEBUG ((DEBUG_WARN, "Set Multiple Mode Parameters Fail, Status > =3D %r\n", Status)); >=20 > + } >=20 > + >=20 > return Status; >=20 > } >=20 >=20 >=20 > @@ -2549,13 +2557,13 @@ DetectAndConfigIdeDevice ( > // >=20 > if (DeviceType =3D=3D EfiIdeHarddisk) { >=20 > // >=20 > - // Init driver parameters >=20 > + // Init drive parameters >=20 > // >=20 > DriveParameters.Sector =3D (UINT8)((ATA5_IDENTIFY_DATA > *)(&Buffer.AtaData))->sectors_per_track; >=20 > DriveParameters.Heads =3D (UINT8)(((ATA5_IDENTIFY_DATA > *)(&Buffer.AtaData))->heads - 1); >=20 > DriveParameters.MultipleSector =3D (UINT8)((ATA5_IDENTIFY_DATA > *)(&Buffer.AtaData))->multi_sector_cmd_max_sct_cnt; >=20 >=20 >=20 > - Status =3D SetDriveParameters (Instance, IdeChannel, IdeDevice, > &DriveParameters, NULL); >=20 > + SetDriveParameters (Instance, IdeChannel, IdeDevice, &DriveParamet= ers, > NULL); >=20 > } >=20 >=20 >=20 > // >=20 > -- > 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107388): https://edk2.groups.io/g/devel/message/107388 Mute This Topic: https://groups.io/mt/100212105/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-