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 68E04A0A0E; Tue, 11 May 2021 15:34:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55AA140140; Tue, 11 May 2021 15:34:42 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 855D74003E for ; Tue, 11 May 2021 15:34:41 +0200 (CEST) IronPort-SDR: Wa+8tTcoz0aaJ34VlgrxQqsoxcgnC6HQ/4rnfL0Mo6bKFsVaG95CqQqwNfibWXsn6Qv8DCdPMh un0QbAff5Ybw== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="186575699" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="186575699" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 06:34:40 -0700 IronPort-SDR: tJEA0etXylq87oQNZDhv6Wmzc/CTOR6FzfZiwcajr3rRT2vQkhxj9Wh/a3c0wfcrjQWWXBTozm Oq97LN/4ztwQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="541650074" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga004.jf.intel.com with ESMTP; 11 May 2021 06:34:40 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 11 May 2021 06:34:39 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2106.2 via Frontend Transport; Tue, 11 May 2021 06:34:39 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.171) 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.2106.2; Tue, 11 May 2021 06:34:39 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ApjcXNDn4Tm5UGggmz/pHjWMn/aqXsTHmGmXFnUqHXfSmHRu9dLcnMaI3KGW21n5Cvhy3uS5Cnk5EofcGYlwvGALc9wfhoNSu4hL13ksDUDsdkKF0v/8F/zAsyx/xA5rzT020f5EDMD/vBJAvEUgyRRZElPwBMoj/yl86LzYny8dqUmOyNCIe994NIuFraceLcgtcL6mcLdGY2bZ46x1P2iEfsq8N40omjBS+zmUcqZL+T6L6QAY4IGdF36noiUIwCDd3sliF9jJQmpPR5uMrHFb2QsJHOwmBqY8ZogoDlbOvUDLLFUD7S5wWBmpkjZ1noE9IFiDGwiGpBDYRbID6Q== 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=nxqJ2Z0htCuKj8KHGKu702m5y+13GrstZ4/I1cMIcQg=; b=hbA2msQagwyFzy32P0lFJ0KEvehLoGyJwinh8G67O1NYx3dAgOwMG+w42XiSbiO7dC/xelByRjLR9a2bkDvDAz3a0psDX7gRnLE6it4FqsV6UghhKfRSXLzfBCW2p3VJjzldEFvGsxGb8hMWMAWIIDzmuFjVwUvdw+4ur+moHhV0BvN7xO/0jYs1EJiKJXE0E5v0hZCA/OzHJdQXZq9KJcYEKRktuOpwNmE+mkfunv7qFui7fTmFaap2Qf03sVS1RGGMeukarFOUftw2i5e806HBa6XWOhRvCapSZav3I0EucbI5gDHaD14gKLv+krTIFv7mlZ/QZKOKJTIXrLMWtg== 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=nxqJ2Z0htCuKj8KHGKu702m5y+13GrstZ4/I1cMIcQg=; b=bdMEqkvZLw4EwEO78PSz3RLyyF8JRJj0x8vveXsNebnPomfjA4gynTgnL7BGQP1WIWjaVhL8dl+oCFExM13bDFAYlFSF/QddluDAMjYPBqVXWKEiTITiGM5cPyQE+62txxTva+/T2F9DeqEWHxFGJXT5IkEQrMtQhCODyEvFnBU= Received: from BYAPR11MB3366.namprd11.prod.outlook.com (2603:10b6:a03:7f::20) by BYAPR11MB3510.namprd11.prod.outlook.com (2603:10b6:a03:8b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24; Tue, 11 May 2021 13:34:33 +0000 Received: from BYAPR11MB3366.namprd11.prod.outlook.com ([fe80::1065:c305:763b:f8a4]) by BYAPR11MB3366.namprd11.prod.outlook.com ([fe80::1065:c305:763b:f8a4%6]) with mapi id 15.20.4108.031; Tue, 11 May 2021 13:34:33 +0000 From: "Pattan, Reshma" To: "Min Hu (Connor)" , "dev@dpdk.org" CC: "Yigit, Ferruh" , "Hunt, David" Thread-Topic: [dpdk-dev] [PATCH] lib/librte_power: fix using variables before validity check Thread-Index: AQHXOdMPljYoJ1Rd1kOw9mvwWLCsmqrKCycQgACihACAE7LJUA== Date: Tue, 11 May 2021 13:34:33 +0000 Message-ID: References: <1619355594-15223-1-git-send-email-humin29@huawei.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [51.37.232.46] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1f542329-5e3f-463d-46a4-08d914818306 x-ms-traffictypediagnostic: BYAPR11MB3510: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KzwRpT8Tx3LiTl/RcQkBRi/hHDlI42X0YnwI28EHdFuc9Ay6oBLTODJq5UGNZbetPNG1i4mvNsksYmrYuf2T8uGsYamnlOOfRoXk+/0yuhdQU1d0/ky7RJrLwEAZFluhI+yGKNfZp0ZkJdFDoaZHrxwurB5uljNAkTKbD9qgUxLRpPqb9FTLa8wVS6MWlnnTyEO25pWp3eKyE24pxIxKJ16n13ZHIiwoHrTP8oJKPIrVSaaGdUwZPgwE9WYj0nPC9q8l55r5IDbVYll1e3/xsofZpDH6PGfuyzWCeh5NA5kPfoRmDKpJxmCOKlrnCw6/CfOnz+nnvRXUZTmIbxkWZiX8CWQF28ezHXZ7Mawlu3KY4eFh/fAMitTeFlVHrMHIMYb9eYCiwRI6p5Svib4Gl9jiEwDDTWdNH7W0mWEhbAXWFMJnmHAeBSflo1PLM4l+vn18k+anoIl7D9keNYeOrDGO1Dgiak9xfmxYFe0JNBuMemJ0ZzRUm99aTTsXovxddlVNhsiIX4Y7chEd5wmXbcCxaW4r8p6KCUmA2nxjLJbWVI0Bpb0TVnGuzWbzr3bGKwJQ2uR/zLvOOLmrxp6u2SXdkfe1nQoH8HwbDY4uZd8= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3366.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(366004)(396003)(136003)(346002)(376002)(316002)(6506007)(4326008)(7696005)(107886003)(2906002)(5660300002)(83380400001)(38100700002)(54906003)(110136005)(52536014)(26005)(86362001)(71200400001)(55016002)(66946007)(9686003)(76116006)(66446008)(66476007)(478600001)(66556008)(64756008)(8676002)(8936002)(122000001)(33656002)(4744005)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?fsxK0RDtH6YTscafoqdYqoPKO2sCig7hVUYGMJimWNeb0vX+v6wG09g7S9Wl?= =?us-ascii?Q?BS9U0LXh5RgrbQYC12Zf9RaCIAS5kTDR5Z0TjQdgbAuF1yzcj9RFVezTYG1V?= =?us-ascii?Q?v4SosxgBC1M3WqkdHC3xtAcSgV6Myfs2X+ZdyyA4x9olLhQ+1u8IsPwUfDNv?= =?us-ascii?Q?UOetTj7JPDP54yUu6CYS/xhHa3rtq3zE1WYFFX+MiAj6JBk32L8CQw14tlQK?= =?us-ascii?Q?3hjMaM5GCL3E7uaU9jVEooB860aJWaA58kF1CjJPYuFHrQhDKPUJlrZPRGI+?= =?us-ascii?Q?pj03LyWNWnCE7Iy/sUI4LOCFEMbbCbjS2rc6eV9MOAJUzGA+pjyMmxnBQxvZ?= =?us-ascii?Q?aMn+syy5wiseD5Mheo67eHMreVO61ehgDbMD7MEnp8XdEFAEjJOqKEI4wz+C?= =?us-ascii?Q?slokxIqfqMDZ2FM8CxZImuSaPSaq3KhF3XoitPwpr3O2omRkprNsfdM0/CA+?= =?us-ascii?Q?DvXgElrUZFEQ/XPkJNnQluqlsrlej6McWdl1tjRENYNw6zWns33nlIQ+xGII?= =?us-ascii?Q?iaMgfnO7mFk/HX0nmOtdA82fKFHMJU0nGEhv2VbyvzJ9x3rQTyKgvfIgiu+O?= =?us-ascii?Q?OhSnya+fL8QlhfVd/psxxYX5vJeR6rnCfm+1gHckbeq22IBBxAHTmxkfX6v2?= =?us-ascii?Q?GIk9kcX8xhCA6lhK6ISRCoCaEii95lJnOIvgcYqDzoeOfpgigS9cxRWqBH8N?= =?us-ascii?Q?S1bRyDgcDV2qKsfrsc1okRUfQdkD0CiuCYH7+OI3lh4s8lUEV9FYTsihtQ52?= =?us-ascii?Q?MV1C4Poljyas2HB1U3Cg4Di+qdsG2NhkxEv8iMDXxb2s0JTzf3U+lYB6vQ56?= =?us-ascii?Q?HYXVU/lPyqANVIRlFQJUYYYifNtQn8WbOGLrlDPoFBnR6VuaDvuV7C73+k3i?= =?us-ascii?Q?ZUIcq8oTb0/RqHVOUDJvhdc74IHxZURmjxEXoWkrDP5vkBxD3+wQfLfclKHk?= =?us-ascii?Q?xwLHSg9YzZw00Pe4Eds3kyXvUbRkfetdwP7I3fpU15n8YyzBsMmIZn61k95M?= =?us-ascii?Q?yAqvz0OdKLJdPAisPLSBYG+rF8eUXA2ReLJdqu6rHSnvziGELSqP361pc50R?= =?us-ascii?Q?EbWfuUBwdvF0haqHxMEm1GoUk06fYStcUVcFKiQA0svoQBKfJRPQqOaBhFaE?= =?us-ascii?Q?C4lj35aoeMk9fMgXdFIwFkOc46AzADHehHVAkjT2tslCj6msSxGS7kUEqMSv?= =?us-ascii?Q?BO4YFjV5O46fnE1i58n08ySa2gBKPtkLrQmPb9hWE2lBvFryeVEvOdZ3tSm9?= =?us-ascii?Q?aJ3bRii8tABqQeLJDG3bhKvA9Se0vNNpc788nXZalJWJlbAAib/O7vDjPapL?= =?us-ascii?Q?ZEM=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: BYAPR11MB3366.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f542329-5e3f-463d-46a4-08d914818306 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2021 13:34:33.0379 (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: tqVkvmn9JClFbXriIrLusz4FtNv6hwlCzW53YOKe3TVi8njOLwSYbR5OZ2fN4faIN2/77OoWElB471LkU6ZXtA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3510 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] lib/librte_power: fix using variables before validity check 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 Sender: "dev" > -----Original Message----- > From: Min Hu (Connor) > > Another suggestion if you would like to improve the code, is below, > > You can move "global_fds[lcore_id]" check to immediate after the line > "fds.fd =3D global_fds[lcore_id]; " > Hi, thanks Pattan. > But I think "global_fds[lcore_id]" check may move before the line > "fds.fd =3D global_fds[lcore_id]; > If it failed, "fds.fd =3D global_fds[lcore_id];" should not be performed. > What's your opinion? >=20 That is correct. You can do that change.