From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.5881.1608004210753409360 for ; Mon, 14 Dec 2020 19:50:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=w0agH3tz; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: bob.c.feng@intel.com) IronPort-SDR: AOOOKiczoQbjjOtUjY+ieTqcXawn8EYj2BeQ9IA3PU7zovEDKg802RoqrTELPj5bY43n2iFRQ1 xZ4q0B1DkNNw== X-IronPort-AV: E=McAfee;i="6000,8403,9835"; a="171311418" X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="171311418" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 19:50:09 -0800 IronPort-SDR: GxHuiYZ9t+utaaQqhfFYVGd7LvXkm9eTVwoKPk1lsngdbQagqrGGq58URhL5WNmN91UTrU+TbM N5MZxmfuNc3g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="556455035" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga005.jf.intel.com with ESMTP; 14 Dec 2020 19:50:08 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Dec 2020 19:50:08 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Dec 2020 19:50:08 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 14 Dec 2020 19:50:08 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.104) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Mon, 14 Dec 2020 19:50:07 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZCrV2I0VvDzLHGx1LXtQL2Il6NFWIfED81X+kswJzqyVYAHuRl9r9rEOxJ3/CCFyy5hfj1Fk9WFs5BvaSDRsd5ZVxmcTKUwkzHHmoaL9JVTSLZXwNbl5C5EtETUX+fkeyFszAnPDQ9z927GE/s0yLo9VxU8OVFXQjgX1xxh4YF90rIB+OQJrpcsdy6FvlnrACIJ9pSePAuSoTlsubmwa1MRv5zo/odPd8VqGvvb6iN5hHPyvs5PBDCgOHWXPDOsl0rvMyVF4zOQBOMnits6yQkSN64RdFaagd/9nSzePBOH8ek+tfG8HQtsxVqcFwTZb0z8Uj53ako9NZskchb9tuw== 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=/MaKQKmHa9QAt/xfML4iBe/JKDLqTTvgCvJ00AdkVVU=; b=J2UB8Ftj2surErKGAF7X6unh6hmFDuaGimzc8ZwJbrnva7Peeyex49tp4yuzu8cjQgDYIL8qzRCP7FUSyWn4rQUal/qQu8BTlNTyaBfrX+TfoJnPyp2ol1y5WfU8FGfG7sEf/1CPx8XO9UUzSp6Y8SAy2NnAgOF4rIGWDcMLiHKKbWrr3hcuaLGSOJHJsjwCOA5BBqv2k6n7OLAvZ33zSUln9CQLxgPSbJNs6IOT+8/5aHMyFbwmSCAg1UvnznKXHXQItvYBqcoaFG6Su44AhqDwgngJlmH1eRRMOjSHegDh8e0ZYRnmY6IqCteDlSDDC7EMhKZau9lAtbl0lPND7g== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/MaKQKmHa9QAt/xfML4iBe/JKDLqTTvgCvJ00AdkVVU=; b=w0agH3tz2v6qdfcdMXTJ5Os7dm85F+sU7C7yhp3NrqkNy3rmhrgToGeKlUJUjrwJkQCmzmebKx1yaNdjoiKtCZg+2jVvoxuuDYKw/5Rra1cCw0ePsOVsCFIxSkriN8yRMPIp2GE3NcuwD4L0/+NGq3l43SqpPVnOvEb2jGN5+iI= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB3420.namprd11.prod.outlook.com (2603:10b6:5:69::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.20; Tue, 15 Dec 2020 03:50:05 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::c9f:47ea:6321:5ccb%3]) with mapi id 15.20.3654.025; Tue, 15 Dec 2020 03:50:05 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "xiewenyi2@huawei.com" , "gaoliming@byosoft.com.cn" , "Chen, Christine" CC: "songdongkuang@huawei.com" Subject: Re: [edk2-devel] [PATCH EDK2 v1 1/1] BaseTools/EfiRom: remove redundant checking of argc Thread-Topic: [edk2-devel] [PATCH EDK2 v1 1/1] BaseTools/EfiRom: remove redundant checking of argc Thread-Index: AQHWz2YPlQW920/Z60K9KptIVCxwCan3h2eg Date: Tue, 15 Dec 2020 03:50:05 +0000 Message-ID: References: <1607653903-125927-1-git-send-email-xiewenyi2@huawei.com> <1607653903-125927-2-git-send-email-xiewenyi2@huawei.com> In-Reply-To: <1607653903-125927-2-git-send-email-xiewenyi2@huawei.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a1f79c42-b7e7-4b56-16f0-08d8a0ac827c x-ms-traffictypediagnostic: DM6PR11MB3420: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Gl8J7bOVQAPuFzzg2rNlV9CAPNWcwkvsSFHYpRyZtLz2eaUPROhs8c93htAzU8VD6bBXJsT/WnvpFkVirMyhuZ35VCwFTIMhV925sza8Y/H8sPzHSxarV6zxG9q1zz/g1Z8xmPrpUw1SPHKUS+VExwIM1GaJor6LLnE9AoUT5SGjt2TDdgxeXgVuAs55SCs7BEGxlTBm8NWduen9BhWnLN9FzhvZ52nr3Ed+YfWEj97fHZxQvToAG3hCrKuycQOJB5UOJ/fgmvExgnS/SEXUgDzZeKthmOXmPPs0p1i/+9vGKdAyOy2UwuiIaP95XatrmdJVQvR7FeNnSLzC7ThZHdHkpRlTXA1UckhOmF2JXLQB9p3uoUaU2jVoQ49DG7/0oC8Dd0B1MQyvQxoVf3IFNQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(136003)(346002)(6506007)(83380400001)(5660300002)(9686003)(26005)(8936002)(71200400001)(110136005)(33656002)(6636002)(508600001)(2906002)(4326008)(66946007)(7696005)(86362001)(66476007)(186003)(66556008)(64756008)(66446008)(55016002)(966005)(8676002)(53546011)(76116006)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?wafMZKeNgbYWIUFK68oGarre3hV/nAv0NeV8lX0TfvsQA1T/Rsdd0SplQkHZ?= =?us-ascii?Q?uurLxY0AuXBV8FSr7YjvV90rvBnHfoUAloKH5/GaELN+M3wHORVW+aDx4FV0?= =?us-ascii?Q?ZcEmPMrvQP4G/KAR3JSSwhMmCrt6Mul7ZRlQqusMogjdRfXtpX04bEEr07Fx?= =?us-ascii?Q?II+RgGk0N89ufR1h/weLj06FFA3lwP/WrgR1IoyUrm03v97ZBCabpuAfL6ZK?= =?us-ascii?Q?Ve2QysBB8Cc+OFdao/zamHFnXBWb6CxH61Nik7MO6C/uBZV8YY6ak5wYyyJA?= =?us-ascii?Q?QWSkSgHp5o5Y4sJQFPiXIvIcnnWnfkBmVp8iy/zeH00oU08eAiSsdx6NrULt?= =?us-ascii?Q?/gfso3/tTisOb56ZSsBbLRdk0m1tdiO9NoEAxT2p3fp+OxXLLNVFfA54lBr4?= =?us-ascii?Q?8mE3RBcgGU8Afk9PEY9Jp2N+qQbsOBC8dYh7/oaKsxJR+1tu9Gqqqr/frxsO?= =?us-ascii?Q?jfYaSkcgxeolNFPMsIwkevCU/M7vZt0hrDTCALuMk9gv+I19tl9fc5z/yswk?= =?us-ascii?Q?Qib0TzuAMmXzQXofN74GL7ObGVXApqYR7zf+jYAZhQ5yK0U21jZ7Txr89Vv+?= =?us-ascii?Q?oUSRTdACK9+BIT9EWuxhdDXVwzg8UlFT4ZXA7kEL0swKtYFnUWNQmX4W0F6D?= =?us-ascii?Q?/24Te/TGa1TRpyggsp5OuYIDckBNFw0aszTbZ9SBxZWNc3s2Yy5HiNWjC3bB?= =?us-ascii?Q?EG8F2d9a0VLtAowE9YpctapJ83gLGIrOqntP0p/e+VVMK3G812ORxuLeXOr6?= =?us-ascii?Q?XgJXob9sZI9mFee0jEOjGLJwn8efQwsOohjDICXSZ6+YtkqmwzzyYI81Iiyz?= =?us-ascii?Q?dCvgRHHhaaB/BrHSIROcmIQ4RfwkZTUlS4PgKWt+B6K5blVt4RIgWidmGnfc?= =?us-ascii?Q?GqJZ3gmvAhU8iC0Lf3bU+vPKyVaVebFSmStjKbKrc+HnikuH2BQdGqOqChSc?= =?us-ascii?Q?EclGCOvwY07iMaV0g4iS5obNkNisu2cMa9LpZaJi4x8=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1f79c42-b7e7-4b56-16f0-08d8a0ac827c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2020 03:50:05.6544 (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: xyZBsq1uPvRit6qMlnTV+PkYRAFBcHBtX/uNuqd16mtC1feOely/iC/MwI5Rlut8+QdPVSvwzFMhmn+MwyJDcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3420 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes, argc < 1 will always be false, but I think this block should not be re= moved because it's used to check if the parameter is invalid. I think the c= orrect checking should be "if (Argc =3D=3D 1)" or "if (Argc < 2)" Thanks, Bob -----Original Message----- From: devel@edk2.groups.io On Behalf Of wenyi,xie v= ia groups.io Sent: Friday, December 11, 2020 10:32 AM To: devel@edk2.groups.io; Feng, Bob C ; gaoliming@by= osoft.com.cn; Chen, Christine Cc: songdongkuang@huawei.com; xiewenyi2@huawei.com Subject: [edk2-devel] [PATCH EDK2 v1 1/1] BaseTools/EfiRom: remove redunda= nt checking of argc As the condition of while statement is argc > 0, so argc < 1 will always b= e false, it's redundant. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Wenyi Xie --- BaseTools/Source/C/EfiRom/EfiRom.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRo= m/EfiRom.c index a7e2839b0a84..147eb464b01e 100644 --- a/BaseTools/Source/C/EfiRom/EfiRom.c +++ b/BaseTools/Source/C/EfiRom/EfiRom.c @@ -1010,16 +1010,6 @@ Returns: =20 OptionName =3D Argv[0]; =20 - // - // Device IDs specified with -i - // Make sure there's at least one more parameter - // - if (Argc < 1) { - Error (NULL, 0, 2000, "Invalid parameter", "Missing Device Id w= ith %s option!", OptionName); - ReturnStatus =3D 1; - goto Done; - } - // // Process until another dash-argument parameter or the end of th= e list // -- 2.20.1.windows.1