Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2012419rwb; Fri, 12 Aug 2022 10:18:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7vm1+H3Uo3LnUPeWJss6ybOTWreJUxCtP8AIjE6fleO0IJkOnc0y0po7kAXHXrueBSTAZ+ X-Received: by 2002:a17:907:1c8f:b0:6e8:f898:63bb with SMTP id nb15-20020a1709071c8f00b006e8f89863bbmr3408485ejc.721.1660324734779; Fri, 12 Aug 2022 10:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660324734; cv=none; d=google.com; s=arc-20160816; b=QEzwdC2MjqwS/O240DD2mg4LRAGdD4/UKPjzTLWNZC0NMukW6fv73Ov1XM+2UpVPiE B+wzn5Gr5vYtXMGUsCAaNxo/zNeB0Dt2SQqaFLNviY8AQmYOrlB4QA6MAmdwZNO/FhTQ oPwBJjpKyLrXIFcAjPnV3CY5MOSrANTOY499Md8HYRzwi28N2x8hE/wcl1/LGjhVwlCe 9u1mqwd8aRkGB9S4umoeBZCcnLz4u8S0hABZNsKwEO82M9pEwRai2S2W1pnsxfQL4W3Y pCMOXOuRNeFhJKHdVSNQxGltlTlneGa2tkpoMQ2tNHN5WCD7dMyyex3ut6XN7k69cYPm c/Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=TzU4kxbiPq2CIG0Dt3uNo8LzBU6MDWGbGwPmFW3Wyc8=; b=E7nd1Q9gLaY6xg/CCtzn6Wod2aKT0N2ht0uGw33DA4Gn5PrDvuoBa/ThCg7seJUCxL Np8aXpyX+kiym7HgQyVWUNlfq4NAUfG3udXXFTncpakeBqv0/mQ/RWJ5Tb/Jpgkyd7eb 8CcMatTNiS+isFVKcgVi4Zml6cYt8+b4s2zJTV5y6BwpvdsJR1zGHT4vBRgABo4eScFw Sq2isYk5hAzFDjkcAKkjlOuog0oyIXxXXBBsDwLEFZgRplXjtm35SAvKk4hSq3zenpd9 9sKI8nWkZt0/3XwQyyKbJRQ6bK7q2jAPmRq8Le60ozBmtKIOzcm2nLyhwI5bh8gyk6k7 MXhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=BcJNak41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a056402032b00b0043d4fe7f8e7si2395340edw.330.2022.08.12.10.18.25; Fri, 12 Aug 2022 10:18:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=BcJNak41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238706AbiHLQxL (ORCPT + 99 others); Fri, 12 Aug 2022 12:53:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239394AbiHLQxF (ORCPT ); Fri, 12 Aug 2022 12:53:05 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FBE8ACA14; Fri, 12 Aug 2022 09:52:59 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id 90E7D5FD0B; Fri, 12 Aug 2022 19:52:57 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1660323177; bh=TzU4kxbiPq2CIG0Dt3uNo8LzBU6MDWGbGwPmFW3Wyc8=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=BcJNak41TNVgMAEqn48XCEkqBus0EK3Fbhn2XPIifejTrR+50LRULNLAv5L8aT3uf QpG+u/FkatyeRKqxwke+LXGLr82wyNFpYZzfkQKLR9U/J/+e3pUXf/3FugvGYKQ5x1 WS6c/zqe8KzjadK/llIu6sRfjvkHFUsX584AvW7Emh2EOJzdDYfRfaWgdPnxdtlFbV g1+OmZGooCxWOHfMX7gaRq4uKougQ17tsMkcA5Tofcz5xx6lFT7qe1DbVhr9SJEWte 1jUGrgENNjaltG4WC+/yZHaEo8Px4UeUj9iJ/UzTuvbgXgJgoxAXWJOQ+IHbHkX7fc kweC8vgSAtO+A== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mail.sberdevices.ru (Postfix) with ESMTP; Fri, 12 Aug 2022 19:52:57 +0300 (MSK) From: Dmitry Rokosov To: "akpm@linux-foundation.org" , "jic23@kernel.org" , "robh+dt@kernel.org" , "andriy.shevchenko@linux.intel.com" , "andy.shevchenko@gmail.com" , "christophe.jaillet@wanadoo.fr" , "stano.jakubek@gmail.com" , "shawnguo@kernel.org" , "stephan@gerhold.net" , "daniel.lezcano@linaro.org" , "wsa@kernel.org" , "lars@metafoo.de" , "Michael.Hennerich@analog.com" , "jbhayana@google.com" , "lucas.demarchi@intel.com" , "jani.nikula@intel.com" , "linus.walleij@linaro.org" CC: "linux-iio@vger.kernel.org" , kernel , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Dmitry Rokosov Subject: [PATCH v5 4/7] iio: common: scmi_sensors: use HZ macro from units.h Thread-Topic: [PATCH v5 4/7] iio: common: scmi_sensors: use HZ macro from units.h Thread-Index: AQHYrmvn6T4LySVM6EmqFD3kF6Rglw== Date: Fri, 12 Aug 2022 16:52:27 +0000 Message-ID: <20220812165243.22177-5-ddrokosov@sberdevices.ru> References: <20220812165243.22177-1-ddrokosov@sberdevices.ru> In-Reply-To: <20220812165243.22177-1-ddrokosov@sberdevices.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/08/12 13:28:00 #20103614 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove duplicated definition of UHZ_PER_HZ, because it's available in the units.h as MICROHZ_PER_HZ. Signed-off-by: Dmitry Rokosov Reviewed-by: Andy Shevchenko --- drivers/iio/common/scmi_sensors/scmi_iio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/common/scmi_sensors/scmi_iio.c b/drivers/iio/commo= n/scmi_sensors/scmi_iio.c index 793d628db55f..54ccf19ab2bb 100644 --- a/drivers/iio/common/scmi_sensors/scmi_iio.c +++ b/drivers/iio/common/scmi_sensors/scmi_iio.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 #define SCMI_IIO_NUM_OF_AXIS 3 =20 @@ -130,7 +131,6 @@ static const struct iio_buffer_setup_ops scmi_iio_buffe= r_ops =3D { static int scmi_iio_set_odr_val(struct iio_dev *iio_dev, int val, int val2= ) { struct scmi_iio_priv *sensor =3D iio_priv(iio_dev); - const unsigned long UHZ_PER_HZ =3D 1000000UL; u64 sec, mult, uHz, sf; u32 sensor_config; char buf[32]; @@ -145,7 +145,7 @@ static int scmi_iio_set_odr_val(struct iio_dev *iio_dev= , int val, int val2) return err; } =20 - uHz =3D val * UHZ_PER_HZ + val2; + uHz =3D val * MICROHZ_PER_HZ + val2; =20 /* * The seconds field in the sensor interval in SCMI is 16 bits long @@ -156,10 +156,10 @@ static int scmi_iio_set_odr_val(struct iio_dev *iio_d= ev, int val, int val2) * count the number of characters */ sf =3D (u64)uHz * 0xFFFF; - do_div(sf, UHZ_PER_HZ); + do_div(sf, MICROHZ_PER_HZ); mult =3D scnprintf(buf, sizeof(buf), "%llu", sf) - 1; =20 - sec =3D int_pow(10, mult) * UHZ_PER_HZ; + sec =3D int_pow(10, mult) * MICROHZ_PER_HZ; do_div(sec, uHz); if (sec =3D=3D 0) { dev_err(&iio_dev->dev, --=20 2.36.0