Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2553494rwb; Mon, 3 Oct 2022 02:27:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7v5AjrZEGsHU2gvjzeJ/iaBGUC2CNg56vC4oivT89r5dWlBF0Q7CgWlJwcemK4H+yr4HDj X-Received: by 2002:aa7:cc8e:0:b0:457:23db:f0cc with SMTP id p14-20020aa7cc8e000000b0045723dbf0ccmr18009685edt.122.1664789241459; Mon, 03 Oct 2022 02:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664789241; cv=none; d=google.com; s=arc-20160816; b=w+EMz780hHPIU0VFszj4eUUfA4CmJeqz6eU9qvnsHx35ADkW9+Ho8pX7KAsuCtBwXn CGQFLY8DdF5SGnhAF3tJDuOWHR7HORXlI5V6G8NlTxbaO4rNBL9Bmv7jRRgX8ptEGTX6 MF0G7fK0EbCKj6Gd9meIyqzvOK0YTERc0zHQIR+e2G5xMGoYb/oDJBDUSCbjIQPlPIQC LjLsQXq+7HAd2/cOYAZ7Xxd36lQOeYTQt8U0KGAZz4TUXCCOV3Dgw5QMiKiXO3CpGfGC QY/ozIKVA/QKOJ1n3LlZHdJd5X9H1cmOfWJvLik12/bm1JO0r3+myiH/hH6I/INaVYhb 7dkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Tekt/RnJ+zIgFhpYKf/cWAp1pjbrAJzGXVEGdH+XotQ=; b=gbtn2Vz+ZwDY7Cvm30df+MtzAPxNVizjxO/MzL2CvWcxKehIdq5NL9W+YyeQs0YZVw ltUv0lUYvrvYNDdQCMABNfcfEu4HvpAetGjaFnqOof1jaft5RiE3AQE9SqdWVmR/MZKE GKMmGxfTByt2MmeQr+4wEzNFVNjg5tsDH9MRE4UUUM9p/QZIn4RG5EiIffOpe0iQn79q TnVOOHWzeXksxYOD2sSdzCdx4YhlIUIgN3syUbj9/KijlW/3wkVfxFRoqxfuEQVOJHDK LWfVEr5TQtHDnElsTQrxeJdyRLTEn8azXc3PgfHO2M1tJwVi3o2AVGU+hXDqscGsLIgk jKBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XvDd2wQD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i1-20020a05640242c100b004542b557212si9228980edc.337.2022.10.03.02.26.56; Mon, 03 Oct 2022 02:27:21 -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=@gmail.com header.s=20210112 header.b=XvDd2wQD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbiJCIjf (ORCPT + 99 others); Mon, 3 Oct 2022 04:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230381AbiJCIi4 (ORCPT ); Mon, 3 Oct 2022 04:38:56 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB1B15809C; Mon, 3 Oct 2022 01:13:17 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id j16so15477703lfg.1; Mon, 03 Oct 2022 01:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=Tekt/RnJ+zIgFhpYKf/cWAp1pjbrAJzGXVEGdH+XotQ=; b=XvDd2wQDa9wGCTlOXwSZgSlQyMeuu2qRFeDZjqC6hyQTZ14j6aPw0wOPW508aU4zXl fucA/vz+WYkwNR+ImdTWUKH54YhVWlXwnXvQowVu/6WUX0x7PH7kLYRX2+X/oMdTHG8n 4TJrHsqL8jBLKjzjSrSjMYVbsj5i/q3FP6KfSc0nE5s9zGnfe9vI1uNEZNg/QzIM96BY FjzCq4Z3MOwv9Xrj8wkjzcedyDhhU1/ThwiVYqaPRkFEgwxsVPSb28oPQR5eAd7vz6G5 kuKCDWXjHUh7XTO5sGdtAh0nLMKWCVwu76qaj+K4YRjrsbe2g2Zp/o/6bYhEPecaD1N2 VDAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=Tekt/RnJ+zIgFhpYKf/cWAp1pjbrAJzGXVEGdH+XotQ=; b=6Dihwx2Hc7skq17VVzyvp6jZ2ewIs56RNayZ2MzvU6UU+4bpr0GzNKT3LPrIH4XbBR o3e6pKJil93LakMI7LhLmMOxsJNzczOCVOeK0URUiFoLcad1rPGYYE2oehv991CH1bLE hZyITT7ETLmG1yqPWk4LI04jO67bsNmZWgb7jdhUHnaynxUUiRow37aTE7b06GHtRM81 RJ5wnHcp6Akl7aLhCuTffiNI3/feFRVkxkdBBzsZxf811DIu4iyy1FostP3VKDBN1OEM Foi/UO/Xz8js2iwrNLfOuVpKTaTbo6T1syn5zCW3JCsxnu3HlYATcoS1Pci8lVYrrOY6 XejA== X-Gm-Message-State: ACrzQf1M2hJU1eSprV9JybZuzecIKmaZnCcrQvZw9shrBc/xxnX3H3OT UqYecAUjUgdmpvDIiSgWNRU= X-Received: by 2002:a05:6512:3f1c:b0:4a1:d76f:ff4 with SMTP id y28-20020a0565123f1c00b004a1d76f0ff4mr7376248lfa.292.1664784796120; Mon, 03 Oct 2022 01:13:16 -0700 (PDT) Received: from dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::1]) by smtp.gmail.com with ESMTPSA id g14-20020a056512118e00b0049e9122bd1bsm1361635lfr.164.2022.10.03.01.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 01:13:15 -0700 (PDT) Date: Mon, 3 Oct 2022 11:13:10 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Matti Vaittinen , Alexandru Ardelean , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Srinivas Pandruvada , Miquel Raynal , Miaoqian Lin , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 08/10] iio: bmc150-accel-core: Use IIO_STATIC_CONST_DEVICE_ATTR() Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ji24NF+5H9PFnyEA" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 --Ji24NF+5H9PFnyEA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Slightly simplify by dropping open-coded constant data iio_dev_attr functions and using the IIO_STATIC_CONST_DEVICE_ATTR() instead. Signed-off-by: Matti Vaittinen --- drivers/iio/accel/bmc150-accel-core.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc1= 50-accel-core.c index 92f8b139acce..b4a077944896 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -925,22 +925,9 @@ static const struct iio_chan_spec_ext_info bmc150_acce= l_ext_info[] =3D { { } }; =20 -static ssize_t hwfifo_watermark_min_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - return sysfs_emit(buf, "%s\n", "1"); -} - -static ssize_t hwfifo_watermark_max_show(struct device *dev, - struct device_attribute *attr, - char *buf) -{ - return sysfs_emit(buf, "%s\n", __stringify(BMC150_ACCEL_FIFO_LENGTH)); -} - -static IIO_DEVICE_ATTR_RO(hwfifo_watermark_min, 0); -static IIO_DEVICE_ATTR_RO(hwfifo_watermark_max, 0); +IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_min, "1"); +IIO_STATIC_CONST_DEVICE_ATTR(hwfifo_watermark_max, + __stringify(BMC150_ACCEL_FIFO_LENGTH)); static IIO_DEVICE_ATTR(hwfifo_enabled, S_IRUGO, bmc150_accel_get_fifo_state, NULL, 0); static IIO_DEVICE_ATTR(hwfifo_watermark, S_IRUGO, --=20 2.37.3 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --Ji24NF+5H9PFnyEA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmM6mZYACgkQeFA3/03a ocUehQf+IGz38D+aCE7j3lLkm+gNNvU1LaWGFVKkBtqeDCb6CPOvwUBr6Vlb/uWO w+Lor/RmUgc3vTjpPc3GivTQkWmXtRfqR+gHPGoZ3g+bMHJiJzaANjDoIYD3T8uS b31EGJbcE4dmGgox+gvEcHb62ho6g+cczIrlFWHTw9hnZZ0QgDWn7QlUrbf4C/uX pPzjIxdIBOhjSpmHQrnVrQAzQb6j4xaU01CS3Ny9bHeX15od5LYbXzT8LOvRltX0 g9s1S5g09ul+J5YKBMq/Fx/RUiU83zLyYq+/ZyfESj2/QMA+ap0zVS5YKgHvYh9v ixvNSdNbgQrvaBhyJeGP6hwbf1Xphw== =Ze+P -----END PGP SIGNATURE----- --Ji24NF+5H9PFnyEA--