Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3012540pxv; Mon, 12 Jul 2021 07:17:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXu1On2VH9P1DN4ReZPOtHbWm6TFd5VbMbV2RcZ+lN5Y5P9EywE1JUqY9DJ1jDAAxUWO0B X-Received: by 2002:a02:cf31:: with SMTP id s17mr3699201jar.46.1626099464194; Mon, 12 Jul 2021 07:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626099464; cv=none; d=google.com; s=arc-20160816; b=Dx9OcRJmro8b16+s4lP53DoS4bpFShK0gAwI9wr50P05/TYxs3ZS9eKTWsdGstilGH lnNx+KG4qbWWBwO3t/Qm2r5FLeVecge8limYtP/sLD7LqY+8pS0rKWgS98YNLXz8Ih8v knkVVEKgZMo38a+YYL1AnYWAd+exi77QC4mB1Y0qHv5RVNd45jSNWY/TCIJ19Tc9dhGD EMGXnFuGEAyaU8Ll4qKq9NNf9vHAm5GnYoBMtPIJFUJGL9U5F8Ikp+mQ+69VBBm1O3H1 ZFdnoA1q413lhLrJpxVhQLdI9TCACZVdO/QXbiYop98pEbmbfQKSToWDd7dh8S6+9/XQ 1x0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YtMDgQksHeFssZEKP2sw1PLGB7Xw8j38YMJjAxn7W88=; b=mqjhUEmi7ENeEFGVtLTaQzNs0ps/Ka41NBp92XC0NJPD7Xx7US+l3u3+969JcCKwPU R6PG9XXTHrOaQzXDfLsAf/69brnERWyYrSa7MRyaAiByYB2roELtCmN+EHmOmVmr7gxq T9Tx+WSHeM6kNdqxsVPaO4gLjkMnX+7rK0Xe4R9IWAYJDEI1XsxyWZi27M5Q4Whkytne KuLybCGqSb+uN7rZIEHxxaIg0uTUHvCjcmarvGOmv0pcPwHq3XUBW75eXLAuQb00ROEA sy/7CPu3Gh9Vn/i7/h+caBHL921OoK7XAu7PG4krzFzDnrbWHM4kyN4Dods9njoyscEL HuEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o12si20444638ilu.12.2021.07.12.07.17.32; Mon, 12 Jul 2021 07:17:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234913AbhGLOTr (ORCPT + 99 others); Mon, 12 Jul 2021 10:19:47 -0400 Received: from mga18.intel.com ([134.134.136.126]:35363 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234096AbhGLOTo (ORCPT ); Mon, 12 Jul 2021 10:19:44 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10042"; a="197260743" X-IronPort-AV: E=Sophos;i="5.84,234,1620716400"; d="scan'208";a="197260743" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 07:16:55 -0700 X-IronPort-AV: E=Sophos;i="5.84,234,1620716400"; d="scan'208";a="412601806" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2021 07:16:53 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1m2wjo-00CFs2-2P; Mon, 12 Jul 2021 17:16:48 +0300 Date: Mon, 12 Jul 2021 17:16:48 +0300 From: Andy Shevchenko To: Jarkko Nikula Cc: Joe Perches , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Westerberg , wsa@kernel.org Subject: Re: [PATCH v2 1/3] units: Add SI metric prefix definitions Message-ID: References: <20210607152344.57458-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021 at 11:42:46AM +0300, Jarkko Nikula wrote: > On 6/7/21 10:09 PM, Joe Perches wrote: > > On Mon, 2021-06-07 at 18:23 +0300, Andy Shevchenko wrote: > > > +#define HECTO 100L > > > +#define DECA 10L > > > > Should it be DECA or DEKA or both? > > > > https://www.nist.gov/pml/weights-and-measures/metric-si-prefixes > > deka Example: dekameter da 10**1 Ten > > > > > +#define DECI 10L > > > +#define CENTI 100L > > > +#define MILLI 1000L > > > +#define MICRO 1000000L > > > +#define NANO 1000000000L > > > +#define PICO 1000000000000LL > > > +#define FEMTO 1000000000000000LL > > > > IMO: Might as well include all the prefixes up to 10**24 > > > > EXA ZETTA YOTTA, ATTA ZEPTO YOCTO > > > > And how do people avoid using MILLI for KILO, MEGA for MICRO, etc... > > The compiler won't care but usage could look odd. > > I find this patch creates more confusion than solves a real problem > (typo where one zero is missing or one extra) and adds potentially needless > churn. For instance I don't assume much use for the HECTO now or in the > future. > > How about if absolutely necessary just adding only KILO, MEGA and GIGA and > questionable defines only after when the real needs arises and can see does > "1/1000L" etc define cause any troubles to real calculations? You are probably looking to the I2C codebase, while I based my choice on other sightings. I agree about the usage count for DECI/CENTI et al., but having them defined targets at least the following: 1) occupies namespace so if we need them in the future there will be no ambiguity; 2) provides a name for multipliers for the code to read and understand the semantics better. -- With Best Regards, Andy Shevchenko