From patchwork Wed Sep 8 02:57:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12479959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33EBAC433EF for ; Wed, 8 Sep 2021 02:57:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E147661153 for ; Wed, 8 Sep 2021 02:57:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E147661153 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 8A8AD94002B; Tue, 7 Sep 2021 22:57:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85745900003; Tue, 7 Sep 2021 22:57:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7202F94002B; Tue, 7 Sep 2021 22:57:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id 5B0BA900003 for ; Tue, 7 Sep 2021 22:57:50 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2405118215EF7 for ; Wed, 8 Sep 2021 02:57:50 +0000 (UTC) X-FDA: 78562896300.39.AACBEA4 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf12.hostedemail.com (Postfix) with ESMTP id D928210000A0 for ; Wed, 8 Sep 2021 02:57:49 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 89F5061152; Wed, 8 Sep 2021 02:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631069869; bh=BA5exPdJs4KGmTTAwh/CDAYqmsgKH/aDx7jsJw2aZUQ=; h=Date:From:To:Subject:In-Reply-To:From; b=r9RI9ALlr6h7atAEOnTsT2/1X8GWpVMIrhXAHPrtL3G1JEftZ++ZrdaDbDTMJpGue zjFdCdVDRFhVrAzUils015C0T+UAz68z4LRkqBijzNH0Rbt496c0lTLrUapFwRxLK9 sFE2xqIJ1S+1yzfR7jIQYwOFaiU5lbB4H4T8qko8= Date: Tue, 07 Sep 2021 19:57:48 -0700 From: Andrew Morton To: akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, ceggers@arri.de, cw00.choi@samsung.com, daniel.lezcano@linaro.org, jic23@kernel.org, Jonathan.Cameron@huawei.com, kyungmin.park@samsung.com, lars@metafoo.de, linux-mm@kvack.org, linux@roeck-us.net, lukasz.luba@arm.com, mcoquelin.stm32@gmail.com, miquel.raynal@bootlin.com, mm-commits@vger.kernel.org, myungjoo.ham@samsung.com, pmeerw@pmeerw.net, rafael@kernel.org, rui.zhang@intel.com, torvalds@linux-foundation.org Subject: [patch 085/147] units: add the HZ macros Message-ID: <20210908025748.wG2khAkS3%akpm@linux-foundation.org> In-Reply-To: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=r9RI9ALl; dmarc=none; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D928210000A0 X-Stat-Signature: f5wajofcwfxf4xkfbrny6drczgnjt9b9 X-HE-Tag: 1631069869-113954 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Daniel Lezcano Subject: units: add the HZ macros The macros for the unit conversion for frequency are duplicated in different places. Provide these macros in the 'units' header, so they can be reused. Link: https://lkml.kernel.org/r/20210816114732.1834145-3-daniel.lezcano@linaro.org Signed-off-by: Daniel Lezcano Reviewed-by: Christian Eggers Reviewed-by: Andy Shevchenko Cc: Chanwoo Choi Cc: Guenter Roeck Cc: Jonathan Cameron Cc: Jonathan Cameron Cc: Kyungmin Park Cc: Lars-Peter Clausen Cc: Lukasz Luba Cc: Maxime Coquelin Cc: Miquel Raynal Cc: MyungJoo Ham Cc: Peter Meerwald Cc: "Rafael J. Wysocki" Cc: Zhang Rui Signed-off-by: Andrew Morton --- include/linux/units.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/include/linux/units.h~units-add-the-hz-macros +++ a/include/linux/units.h @@ -4,6 +4,10 @@ #include +#define HZ_PER_KHZ 1000UL +#define KHZ_PER_MHZ 1000UL +#define HZ_PER_MHZ 1000000UL + #define MILLIWATT_PER_WATT 1000UL #define MICROWATT_PER_MILLIWATT 1000UL #define MICROWATT_PER_WATT 1000000UL