Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3301088pxj; Mon, 7 Jun 2021 07:26:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzecm0ZL1HZDOxFYhsm54u1jMmV4FjkvhEdPFnBph/Kb9vpWudpeQymQbKy+2ojqMJi3sa2 X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr18457554ejh.8.1623075981551; Mon, 07 Jun 2021 07:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623075981; cv=none; d=google.com; s=arc-20160816; b=o692SFCj2U+1MND8oRBE6UjqFFR2K8UqiGXnSBrL6yCbS0floHZ+WK2mdV+vjNAPs0 KO7G3CGJw1LlO1IZr7MLHRL7DrSUN4ERFcyi1vSNbc6A8icALNFvfqPb8hDSZClJlcLK njxegV0IEvYKhmVCQpSvHoR/SJhrOfTTwNUWWLzvMJdH8iWzc0dKl6Hc//gl/HuTDFiJ To0U/35JCz78bfhrI1yv6ellt1b4aqcDJ1xYckNiJdU0lSFtTIEvKtoaWvTaAWmUfX3z PhcEwCPNeov6ujfYtQIK5BVqZgO7VpOj33qzOOd2CoNgC1ZBjSLb+qQK9t4isTeJROgK z+jQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=FFW+FYx9Ov8Cc9KZ8X/DfzFQcMwSO9gXzlXqVwmGlc8=; b=hrEKHbN9PgMoy9qb//yi25UYYqNcb6dZqG/LCinATXlMovCflONppqdiTUwHZnFs4V FSr0WwWIYlW6pv4Xb5mcQ28k+cGfviVJB0VGs4CInhuzojh7YWe08jUWBGi2x9C0noDV USeZAw2mEDCNgxuoukvU8B3bnc2MNwQ+5oGYhsSwHe3gINrqKTzDk49WtFEM4kVSoN0A NBp9ZgH680fr+XWf/BboO+0VM0XNa57V3dLZeTurlovwZLcEsUuAtIEtwhiwZX3AG1Tr +M3eIH6u8GL5iwcmA0HZqf247x7Wzsv7D8ESNS8oxpAM3ey4WxQd/5doqJzQ32G8Oa7G NpKQ== 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 j24si11274591ejo.639.2021.06.07.07.25.56; Mon, 07 Jun 2021 07:26:21 -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 S230220AbhFGO0o (ORCPT + 99 others); Mon, 7 Jun 2021 10:26:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:19330 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbhFGO0o (ORCPT ); Mon, 7 Jun 2021 10:26:44 -0400 IronPort-SDR: sbMYfQTA+IAwvhJDTDVb+E5viHmbCFJO2mooUQjklefImMa4b5FFVSepFmFoDD0KDJr7zap6Js XFvvThv5TQAw== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="204599635" X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="204599635" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 07:24:49 -0700 IronPort-SDR: 3B2pL0UoeC87KJNkTDSWxwQc9k2MwVDXcmwJIidvMEs4Vz39dLyXrg6Ugd9hk9PFwdsiGKnqZJ E3Nintv3vikA== X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="551901946" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 07:24:47 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lqGBI-000H6N-Ok; Mon, 07 Jun 2021 17:24:44 +0300 Date: Mon, 7 Jun 2021 17:24:44 +0300 From: Andy Shevchenko To: Jarkko Nikula Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Westerberg , wsa@kernel.org Subject: Re: [PATCH resend v1 1/3] units: Add SI metric prefix definitions Message-ID: References: <20210603160433.35816-1-andriy.shevchenko@linux.intel.com> <0466dab7-f2d2-3b7c-52a6-a12a6b09a67f@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0466dab7-f2d2-3b7c-52a6-a12a6b09a67f@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 03:33:31PM +0300, Jarkko Nikula wrote: > On 6/3/21 7:04 PM, Andy Shevchenko wrote: > > Sometimes it's useful to have well-defined SI metric prefix to be used > > to self-describe the formulas or equations. > > > > List most popular ones in the units.h. ... > > +/* Metric prefixes in accordance with Syst?me international (d'unit?s) */ > > +#define PETA 1000000000000000LL > > +#define TERA 1000000000000LL > > +#define GIGA 1000000000L > > +#define MEGA 1000000L > > +#define KILO 1000L > > +#define HECTO 100L > > +#define DECA 10L > > +#define DECI 10L > > +#define CENTI 100L > > +#define MILLI 1000L > > +#define MICRO 1000000L > > +#define NANO 1000000000L > > +#define PICO 1000000000000LL > > +#define FEMTO 1000000000000000LL > > For me milli is always 1/1000. For me as well. Kernel does not operate with float point numbers. That's why it's ordered like this. > Might lead to confusion with these defines if > idea is to multiply with KILO but divide with MILLI? If the author of the hypothetical driver doesn't understand this, maybe they can ask first, but I am an optimist here and I assume that whoever writes the driver for a sensor / etc has a minimum education to see what's needed for the certain case. -- With Best Regards, Andy Shevchenko