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 75DB14291B; Tue, 11 Apr 2023 10:58:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61FE040DFD; Tue, 11 Apr 2023 10:58:44 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 2A1FE40A8B for ; Tue, 11 Apr 2023 10:58:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681203523; x=1712739523; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=zbArXJEvEEQvVZ9XIsl+u8sWsAhg5CGo77BDUgadbKM=; b=c8amNhbM5WpemzSBUkoWjp32MZda1Ez/0fkxhZBsvM2K2G19oUJC7BsQ 6Ax+1M/ObAGABSewwhWpTxyu04Cw4A+1VDMMDZ3IWJWaYnBIX+9qxSnD1 FUJgO+AaKxVrX/ganGcgBxYJoRi20UcI63I40F/nCdHy3mh05s7vj6phW oGRYGc9Vi3q0HJ4O4T2EC4Mu9a7/61LYqYsi6ewdulcaDqrmvUJ2gypGD YF7ZeAC+DDNEjGP5iqGzxjI+aFAF4rflrBFTAi2j9GtZ68MqbCu2+tWyl dKP//7v4zyMg7GdcgPqDHphCQrhWVzIHBR1Lcwhgh7CZTIFk73lXcaWnk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="406387525" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="406387525" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 01:58:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="721121158" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="721121158" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP; 11 Apr 2023 01:58:42 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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; Tue, 11 Apr 2023 01:58:41 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2507.23; Tue, 11 Apr 2023 01:58:41 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2507.23 via Frontend Transport; Tue, 11 Apr 2023 01:58:41 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) 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.21; Tue, 11 Apr 2023 01:58:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mUU5Js59GuqhgMH+P+1d13J37b/jz1vNwfDZf1RTU12vjOFibZJRRe3aWim6umZvOF6muZSvbUMzB4TBoVQYawmVXJY1RFvA3m0pn/ELbejQkUr+nXtRezWov/oVHl477uf2fm/UWBAFpnS37NFoITWpgCtxVa9dGEM0hFT+WddmagN+Z/qwKl3rzvO2CqeQj4iF1rIZpFai7JvK8V+qlc90QZ4+U9beDzPJJhaMTkLNRvTKwR4i8PIKe9X8YrBQ3tD7gqpHaL2l3X89hEyjhjoQTV5Vbjy1cIFYTNtaSyYOJIXCfPIL6ZEpx4w4Le9+GZA8FOZqJc0OZS48ndHvAw== 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=j9HM5D8kSqkpKYIkW04QNeiV6Tnp779jZh716JCmQWU=; b=eY5fuC0sHyK6cUOXD80iOs4Slrj9YHOB6I2IJ5o2MXLO+WAsGCyQwlIpEaxJI4gOpVZ0WV29GtqDyeVYuPnhaeTIOewRuC/L2JAefjnmlQhS38/ZSWJc1theoexN5u7oBEtWXN/Tj7D7GfmTP2Rk+YHbZynm4hjOuNpCFP/8vxuILc88UZsBQKgitgCspBRgcbtezE9p2Q2s/3zSh1VzcyER5ve7CEYTUsc/WqVRdvoRe67/+uSkL90Oobsd7oXSpFICfXiMtd1fsiVD9UtLCPuVJnhY0v2zFaVyCjV6Vh8t4BJlqN6+Xh0bht5jEeXlEOYyqtZRJFIUDC6BKPL8Xw== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DS7PR11MB6223.namprd11.prod.outlook.com (2603:10b6:8:98::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Tue, 11 Apr 2023 08:58:39 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::695b:260c:f397:2b69]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::695b:260c:f397:2b69%4]) with mapi id 15.20.6277.038; Tue, 11 Apr 2023 08:58:39 +0000 Date: Tue, 11 Apr 2023 09:58:34 +0100 From: Bruce Richardson To: Tyler Retzlaff CC: , Subject: Re: [PATCH v3 4/5] telemetry: rename local variables Message-ID: References: <20230310181836.162336-1-bruce.richardson@intel.com> <20230405160326.186921-1-bruce.richardson@intel.com> <20230405160326.186921-5-bruce.richardson@intel.com> <20230407195006.GE3014@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230407195006.GE3014@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-ClientProxiedBy: LO4P123CA0639.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::6) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DS7PR11MB6223:EE_ X-MS-Office365-Filtering-Correlation-Id: 25a62389-02fb-4c3c-d189-08db3a6af15b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b95fByy24XD07NnC3+orhylRRid3SfkY6W+yz03JAIptUh3ALjSgOLNcz+Ew31bWTfDdAt83ueDf0+YG5rXSY4uI4G1J4lD1rByzb0mYTNk2ESfgVev4Zf7s71oNDaOwauc3iJxJAvDgzryOGE90P+X9CGf2n44FF8zSSGI7fQytLiN1mGyf8N/JS6xP2b8pCtCCxbZbScdtnHVat2KePUTVPxFs6ro8Ba+ksp313wP25URw4QRjm02gx16+dxsIauKLD9b+zzOy0YqS7p1WyNZR3aF8qesbUsHT36UTGg/OGzGGWrIdq0vTmELkIy1FbBZintQAEVj4Y2Gi1oRUUCNsiF2JusRkCJE37dBAHZDxDHNJZNmp+XJyNuH5Ho+dPwtkjdAernfswtFBhO7ZbR7pXJqNxoa2iYIl0wnkmQ/C4fExf7gssUjc/Bp+whw4gT+iVu9YvmmevGta5XYODFaz1NjfaMrQTD4OX3Cg1cljBxN1ekDxsWQ4I1IB3w9cDRUs6sfTFiXQmlDFa/6mVz/G1Fx5O3mj4PZiIZ/DmnPTcp8X3vL5YtILwy4Qn03a X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(366004)(396003)(39860400002)(136003)(346002)(451199021)(107886003)(8936002)(6666004)(44832011)(6486002)(5660300002)(6916009)(86362001)(4326008)(8676002)(66556008)(66476007)(66946007)(478600001)(38100700002)(316002)(82960400001)(83380400001)(2906002)(6506007)(6512007)(186003)(41300700001)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?sOM1QXR54dgPKfuVXV4OObTBvuvob3CO62MkWUDXjZ8vIDGkybaA0UhjV592?= =?us-ascii?Q?SqD9baPnQ0OyRNCE9Ig7XMdWOfRry+WDBurOKOcPyQ0jdvQlo5pf3BsiL8R5?= =?us-ascii?Q?NrgdBI37rG2Cv5mtbS+3CaXvrm2mQC577rr7Wxu6TFfSyQgdE9RQbUZSrQxV?= =?us-ascii?Q?ed9UkWEQKFIA2A8kcHSOiAw1HYdJtw/gm/ETE1mWMe3ef7Y5wReb8EVnYKLb?= =?us-ascii?Q?I6D/A7c4IaUjdawhkMkpmJnUrftNQbffmPZV8WoI1EdvapEMZlCX0Su77Ms8?= =?us-ascii?Q?3SSm03B80oWK2jkVjXvNUf0Qfrjwi5rRGIiK0e6LpcnIRlmQ0WApdnZSJT6T?= =?us-ascii?Q?fnFEWVpxuevNZtuN4jKrO3HDysTV+XAr2V0Ad+0mtk3FjIdSrcvirsVRaUb+?= =?us-ascii?Q?w4b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93myAO72sCqYRPiHUoSoOg?= =?us-ascii?Q?NEAC/800GUjLLXhuyb1nNqlPN5RVKINKs0egR9dOAXM+U85AwKMdP4ZU+07z?= =?us-ascii?Q?11yt+BnuJ4VOBQv06s9MzsE7UdNl55KuPSVasjNz905pehYqZgtHEDzVmRi1?= =?us-ascii?Q?maEi+Sk+vHyEkeqfL7LE5AAxTETO7kgRz2W7u3ff0QEUBBwGzYWaB2AlzXSo?= =?us-ascii?Q?lrdJA7UMzRzhb18yPhkAj1GvCr+rjL/noZnngMZKK7DFi8xQjS+2aW8dnGGa?= =?us-ascii?Q?smi7Zk4Y2HBL8WP+N/LFyxYI5Li9JgQ961epyXdppv1umApLyVnMv8UMOWzb?= =?us-ascii?Q?iQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 25a62389-02fb-4c3c-d189-08db3a6af15b X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 08:58:39.6007 (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: Zd/vO7anTbLk+gfdo3R/bR+LA5PeK4dwd09jTu9FPXqRCqRBwlH2hIZlISfbFh8rhUdty77cv8nCfEzalFXA2DAKcZsjQ6h6PDGT+59R3jI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB6223 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 On Fri, Apr 07, 2023 at 12:50:06PM -0700, Tyler Retzlaff wrote: > On Wed, Apr 05, 2023 at 05:03:25PM +0100, Bruce Richardson wrote: > > In the newly separated out function, rename "tmp" to "buf" to have more > > meaningful variable names. > > > > Signed-off-by: Bruce Richardson > > > > --- > Acked-by: Tyler Retzlaff > > (with suggestions) > > > > > When committing, this patch can be merged with the previous. I've kept > > them separate for now, as it makes reviewing a lot easier. > > --- > > lib/telemetry/telemetry_json.h | 32 ++++++++++++++++---------------- > > 1 file changed, 16 insertions(+), 16 deletions(-) > > > > diff --git a/lib/telemetry/telemetry_json.h b/lib/telemetry/telemetry_json.h > > index aada523a27..c087b833eb 100644 > > --- a/lib/telemetry/telemetry_json.h > > +++ b/lib/telemetry/telemetry_json.h > > @@ -84,44 +84,44 @@ static const char control_chars[0x20] = { > > * directly, but returns 0 on overflow. Otherwise returns number of chars written to buffer. > > */ > > static inline int > > -__json_format_str_to_buf(char *tmp, const int len, > > +__json_format_str_to_buf(char *buf, const int len, > > const char *prefix, const char *str, const char *suffix) > > does it cascade rubbish into the caller if `len` is made to be type > `size_t` instead of `int`? > > > { > > - int tmpidx = 0; > > + int bufidx = 0; > > > > - while (*prefix != '\0' && tmpidx < len) > > - tmp[tmpidx++] = *prefix++; > > - if (tmpidx >= len) > > + while (*prefix != '\0' && bufidx < len) > > + buf[bufidx++] = *prefix++; > > + if (bufidx >= len) > > return 0; > > > > while (*str != '\0') { > > if (*str < (int)RTE_DIM(control_chars)) { > > int idx = *str; /* compilers don't like char type as index */ > > should be `size_t` instead of `int` type for idx. > Agreed. However, trying to keep this as a pure rename only patch, so I don't plan on fixing that here. If I do a new version of the series, I'll see if I can work it into the follow-on patch easily. /Bruce