From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2255A2FF147 for ; Sun, 9 Nov 2025 17:09:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762708168; cv=none; b=oALWOX03xrB2mg76R/bhP+ZnDiSbwSP1kcxt9fDnJcubm/cB/9x/FI/Jn3oAQyQ9JceHbJcobU91S8Ohk8CS0XninS4b8BVnfEy1taXTq9xdDI7w4i31mv0HHJIU2r2HJz5jMyP2siSGQnWrc8x2OAoie3YY9CxF7Gv2XgE3qmQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762708168; c=relaxed/simple; bh=ifyQCECAtBcQxgR5E0pL//6P+IXt1bCDRYzHSxJKPtk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tACK7aEAm6/ElmwGGV24UOSPd5aBWBI+scWNzITL6SjzE/T5SIaigbBuoly8Il64fgGrPSoDITT+6Jnc7h0KRzmZpo11s68QN0ECVozxSm5TOgo9O6L7aKWIhk4IKUbmCy4CxkZeQuWrS3UszzNJFKIQtgGYGdMRj/4A05cRhA8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=gC5I4eN2; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gC5I4eN2" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762708167; x=1794244167; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=ifyQCECAtBcQxgR5E0pL//6P+IXt1bCDRYzHSxJKPtk=; b=gC5I4eN2cHfWhRoTXoNcrPD8yPmG7Uey8tiut8m2BurWxcS2FPuWnFRX s8AnXCch6J1k7GUVSRCiUuxIga5QPLXR6pmgAS9ooro+02sNhwpdBYtFn K26I0lE1gQN3xTOyg01rrm1WHR+eL4TXAZovlHnpJ7V6LALavY9WRnyO0 FGl+91n1FltWS9KEWwGwQBJ2Ed2DPFPneSuzNgT/TrVHPxkZvj+HiL/EW gVRy9bnVRX6dIjD6SmP5c438od3WroFgRrzb5yU+WyCYWnq/i5lhINU3w wru1uxxJnHKv6mlChUq6ZXkhdosPscHkGZqmmyq8Rf35kiHC7jcVEjKfg A==; X-CSE-ConnectionGUID: z13eE++KTHCT9Q5XvuphhQ== X-CSE-MsgGUID: 7LmQU+MeTjSdPIX4Z+ScjA== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="64704345" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="64704345" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2025 09:09:26 -0800 X-CSE-ConnectionGUID: Fd17s4YwRPaADzaVcPLRjg== X-CSE-MsgGUID: sw7bb81sQ7+538g9Rlqp5g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,292,1754982000"; d="scan'208";a="188327592" Received: from fpallare-mobl4.ger.corp.intel.com (HELO ashevche-desk.local) ([10.245.245.185]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2025 09:09:23 -0800 Received: from andy by ashevche-desk.local with local (Exim 4.98.2) (envelope-from ) id 1vI8um-000000074ls-1h2F; Sun, 09 Nov 2025 19:09:20 +0200 Date: Sun, 9 Nov 2025 19:09:20 +0200 From: Andy Shevchenko To: Jonathan Cameron Cc: Andy Shevchenko , David Lechner , Hans Verkuil , "linux-iio@vger.kernel.org" , "chrome-platform@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "linux-media@vger.kernel.org" , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Benson Leung , Guenter Roeck , Lars-Peter Clausen , Michael Hennerich , Mauro Carvalho Chehab , "Daniel W. S. Almeida" Subject: Re: [PATCH v2 2/6] units: Add =?utf-8?Q?32?= =?utf-8?Q?-_and_64-bit_signed_values_of_=CF=80?= Message-ID: References: <20251107201005.3156118-1-andriy.shevchenko@linux.intel.com> <20251107201005.3156118-3-andriy.shevchenko@linux.intel.com> <20251109170032.2763ae5b@jic23-huawei> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20251109170032.2763ae5b@jic23-huawei> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Sun, Nov 09, 2025 at 05:00:32PM +0000, Jonathan Cameron wrote: > On Sat, 8 Nov 2025 21:02:54 +0200 > Andy Shevchenko wrote: > > пʼятниця, 7 листопада 2025 р. David Lechner пише: > > > On 11/7/25 2:03 PM, Andy Shevchenko wrote: > > > > There are a few drivers that want to have these values, and > > > > one more known to come soon. Let's define the values for them. ... > > > > +/* Value of π * 10⁸ (fits s32 or signed int) */ > > > > +#define PI 314159265 > > > > > > It isn't clear to me at all in the other patches that e.g. > > > DIV_ROUND_UP(PI, 1000) would be π ✕ 10⁴ (rounded to nearest > > > integer, of course). > > > > > > Calling these PI_E8 and PI_E18 or PI_x10_8 and PI_x10_18 > > > would help to clear that up. > > > > This will be an awful and ugly name(s). I fully disagree on such a > > proposal. The power is chosen to fit the type with maximum precision, no > > need to explain this in the name. > With no indicate of the multiplier we have to check it every time wwe > use it which isn't ideal either. > > So I agree with David that we have to indicate this somewhere. Maybe hold the > multiplier in a separate define > #define PI_MUL > #define PI_MUL_LL > > Then compute the divisions by (PI_MUL) / KILO or something along those lines? I see, we have a disagreement here, because I don't like to uglify the pure PI definition. So, please abandon this series then. > > > > +/* Value of π * 10¹⁸ (fits s64 or signed long long) */ > > > > +#define PI_LL 3141592653589793238LL Note, this constant is used a lot in the tests (3+ modules), so if you go with your version, take this into account. > > > > /* Hz based multipliers */ > > > > #define NANOHZ_PER_HZ 1000000000UL > > > > #define MICROHZ_PER_HZ 1000000UL -- With Best Regards, Andy Shevchenko