Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2531836rwb; Mon, 3 Oct 2022 02:04:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5T+4OwkrQBCERbCT48Ifdcl05vjpg+r8f5ZjMq4htneJ/ocwAirhbKA3pS0COcWYVqabGP X-Received: by 2002:a17:90a:cd02:b0:205:efbd:6f60 with SMTP id d2-20020a17090acd0200b00205efbd6f60mr11223590pju.111.1664787883635; Mon, 03 Oct 2022 02:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664787883; cv=none; d=google.com; s=arc-20160816; b=iqNPihKA3mxC7yTroH2VdUwFs1fgkFSf2xAbvVZqDjZkDdFu3N6E+mLEO4hqUQoyew eiZpm0v36RcGZfBL1EVGj1+FaMZiCwq11PafiQH5uJtmdmGQn7flEwt++4euuUnlu8hu hvHAgxDnX2UnxFJL+xu8veQh079sa0o1T00ZZnLMdPYTIVtaucvflrmFzP96hfhgngap PJZNWmvH0lVqj2YIEoH708xcEUY4UAMB8EBhKMOv5tTik3uiPAoMHLEjP+b1n7EWlDg1 UeihiaIp+A+0z4+T3XGc9JvJkapczT49MyDRbfaMPkIygu7aueZDHdUH8f39LNepoB+I 80Rw== 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=UMNEw7AgUh6ajeyzrA1GuUtXPh6a1JamMlxbjeOzpbk=; b=tVyvV53ISG2H0CZa/rivEvFShM9LZvu2GqLU3jUQ9dmvBo0ysn5QkLyxX1tNMaXsjk IcI7vjWRRYf3w4R/gUTdrJU7vx/YFbFzkYCQsusiHGZ7Rm6I/wC1NWBUVUk3B4YPYpJc CuzfdKjEBFFAxK+ZYYy/gAIUt4fOrdbyCb4pwAoh9hvIcYCGBYebIQsqGoNN4gRLm5yO G93/+jnGE9rzf6ZoWxzQPbBaNSLZRSzztUIHukLjxYdh1NCSYZXBdCs0us/NBKpuxndL V/uzJhBHjxY4NnnPdownxgQ7PIUM4fnQMWe1Jqr1SSIgj6k4VIFbq7P0adpRwVEa5hDO jZHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hfm4nX+s; 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 j8-20020a655588000000b00434b739a66bsi10837597pgs.276.2022.10.03.02.04.30; Mon, 03 Oct 2022 02:04:43 -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=hfm4nX+s; 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 S230420AbiJCIj2 (ORCPT + 99 others); Mon, 3 Oct 2022 04:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbiJCIin (ORCPT ); Mon, 3 Oct 2022 04:38:43 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91976273D; Mon, 3 Oct 2022 01:12:56 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 25so5188504lft.9; Mon, 03 Oct 2022 01:12:56 -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=UMNEw7AgUh6ajeyzrA1GuUtXPh6a1JamMlxbjeOzpbk=; b=hfm4nX+sk6VY/Wn7Qen6OsNSteSqazo02JNzObtmrxTGDGKHxtGksOX303/ZXDRzrR d9dNw+7kEEsSXdei5DGSCETX5G1Wt+8NxzZJNFvLkpIwsy8TE2dBr76s30L8u7sw8h/h VnEhDUCqvhJ3UcyLNAIyc3Yqg3f+lNLASsuuXGD69uOIfoSseNgi6cn7BhPlUspqf2G8 XHw7GZWix4C8XunOTEBn7vLqCj4K8tTbBXl7psw2AOHG82/3LmuR0agpmAJT3OQkAptv MVJFldwu++6kQb7YrsjcTRiFml3Wlnc9UEVMeasaedRWacjGVRZH4kNSkihvHp2s7haA JX2w== 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=UMNEw7AgUh6ajeyzrA1GuUtXPh6a1JamMlxbjeOzpbk=; b=hadUzam6sjJ+tXVvhyuU921K3mHWS/idVXJp/vzubJrjwFMsCETIu50z/S6lLTetT7 I9yXUfmrGU7xQjMEtAD1QHI0vfrEeE2Oq6g82bu+uw6Os9sF3htNghHa16xgXvwQAaym rnuRl5G/8T49ADZVzyq4xWY6paNakHYkcCu/skOFhCYYiwQeAKm9PDT2wYbJdWV/T3Sn oUKp4XhtBJdECVhjhecwgtJDZcFs1CNAu4SWe5bCTlq/1fvCr0M7If1NBmEbabuhM02g sYtbpyx5PMFucyS/Njxtze22FlMa/HcvqR+o4MiaKM/qoj2IBhwZ05lOsgB4No3I3tVu AMNw== X-Gm-Message-State: ACrzQf2oZm4Zipy0g12dtQramJicKyOuicsp1s2iia4FV94Sx9iCegAp l7v3D2wk4M+bum46gqNSAIo= X-Received: by 2002:a05:6512:32b8:b0:4a2:3a87:39b8 with SMTP id q24-20020a05651232b800b004a23a8739b8mr1721170lfe.6.1664784774744; Mon, 03 Oct 2022 01:12:54 -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 o1-20020ac24c41000000b00494792ea34esm1352141lfk.273.2022.10.03.01.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 01:12:54 -0700 (PDT) Date: Mon, 3 Oct 2022 11:12:48 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 07/10] iio: adxl372: Use IIO_STATIC_CONST_DEVICE_ATTR() Message-ID: <3632af8849ef101c54ec1f739596f22c773b067c.1664782676.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XuUgAxgMaJpJE9CR" 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 --XuUgAxgMaJpJE9CR 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/adxl372.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/iio/accel/adxl372.c b/drivers/iio/accel/adxl372.c index bc53af809d5d..90e1d726b9c5 100644 --- a/drivers/iio/accel/adxl372.c +++ b/drivers/iio/accel/adxl372.c @@ -998,22 +998,9 @@ static ssize_t adxl372_get_fifo_watermark(struct devic= e *dev, return sprintf(buf, "%d\n", st->watermark); } =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(ADXL372_FIFO_SIZE)); -} - -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(ADXL372_FIFO_SIZE)); static IIO_DEVICE_ATTR(hwfifo_watermark, 0444, adxl372_get_fifo_watermark, NULL, 0); static IIO_DEVICE_ATTR(hwfifo_enabled, 0444, --=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 --XuUgAxgMaJpJE9CR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmM6mYAACgkQeFA3/03a ocU2gwgAkOPhUFnwfMrlQb3od5kWMJo89ybAyGvd2e2UMAkXkRX+k8K4sFGd0dm9 hUDw+LXJKyKD6g6bOf5AwpRbFBvd9xwP6F5CeObYpyMhG1TGlBk2qUwd+SQqyOq8 xzZjBhigg2jjWrrcbsEJNAwPjPdp5nwAdu7rzOSuZD4ZsyUTbwslqoF3v+Yf/Jaj GOWKkhAPYy/AdmyC4nqvkvfWHgY5pV41TPFZfs6+XH6bAvyBk4PqOj4Mkgyzz+Pp X+dL8SUOF24WQnlDY3uJuyGoBOoF9Adm9Ml77BDHssw5Yxtlc95D0f11tGwGO5A5 Mq3v5lgJb/Bd+FpNP9oV0+5Dex32aA== =8Ee9 -----END PGP SIGNATURE----- --XuUgAxgMaJpJE9CR--