From nobody Thu Dec 26 12:14:13 2024 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75DB417BD3; Sat, 30 Nov 2024 00:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926448; cv=none; b=RTbAmIuxx6njKnyGjY8ILAVL/9Tlo6WoMjBd9qjC+iEzgW6cttte7kDPck2A8IITbxu3YkKWYbb/lJN22HnSVfK9LB8aSs/hkmM94fZ5WUw4W7ddGl272Is8PMMUaz3b6IHv5TvSqsdebTd/Wz0BsEil9hyKXsxtoA5MhXkGMxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926448; c=relaxed/simple; bh=XiVGJVTbEUb40AQjcPLkdyA2iAGvpAfEWBgeZJmdZPo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VI2JhhaslEuZjJ6RPm8+ZwySG/HWE/g2oWXa68NjczSaCuhtzjzK3YWauyPHmtSdKW/Zg+cVMQp+gWNtNm4pFjVH/2uB7lFpeIu8unOtHjkbHGoTDrQSwIaGaD2zhwNp03jFY1CQ3Y05osM2PFv+2wrIsaV5HERcTjLflDiF2+0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m4oDmp7E; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m4oDmp7E" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-385e1fcb0e1so238946f8f.2; Fri, 29 Nov 2024 16:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732926445; x=1733531245; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+BuxdRBifStPjxxiawLv0rBImUatNjkAWFJkyPMMHhw=; b=m4oDmp7E7bK6Rfz6n+LGj3DdJo3Oi3rk0hIfdPRmAQHgxoKoJdOlP6Z0LZxMhuevcr z2GwGOKejgbNSzjppJRg98/0L7gWWdcZ5pY5JrjP2moKun3NfvWtI3jenUCjSnZk0oBC m5Nzk31ISEa7MXG6P/wOCnSlw6ZaXYjgdTWBdFuvOg7XOlPgdPku+MPUnVL1pcNQ1yAb 8iPgH65OaoIbBJq9bX70mYcQ+P9xntrjHVJKJAUUBFUE37CBITXTSv9AVSqS1c0WaLcy sz6L5pd0IkyswwK7VtiVcQT7nswYx4Bm/6vlrjI1t0kNKeoo4eHEhrqNVZIFPpm27JoT OQ+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732926445; x=1733531245; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+BuxdRBifStPjxxiawLv0rBImUatNjkAWFJkyPMMHhw=; b=oMxFijn565agmoYBDYcyNoZamzZz4OHTYRYC19IRCpoaVwygCc3Lxd5eafna2LTm7A dA72fsN/hnglho21CBIIpXfwJCBH3cSgr0hwfuLRUmUHZKtDFB16vAaPgT3NTwyww3fi hPcP4m7DDUhnECwJXIDQ0kxBWXimXyGbwfLqgBGxR/tSVWyOBEDNGd4CRbB6BtTNBZ4M 3RUcTul0/akL60NI5LB9kTpbkkGDkfs9tqIeE1DvgKrh+EgVEi0b946xqDsyJWxWWwpL X8L0vk4fEZQ1UfD3sL1tXePr6VnzgR4ftrMgIJ/5H+sv3nIHqszYaFjpuRG0AZumRNej MC6Q== X-Forwarded-Encrypted: i=1; AJvYcCUw6fwth3vMVaCEGoMB2cpc1PvkrChBb4bAalKPzHhQgDwi+XcKm2oS4c2zolOzntnlt5eKj+Qfsc1enYUJ@vger.kernel.org, AJvYcCVRpHgOG0+a73a5SAbJopVk77tXmBzsGMWIZC5+O8x8hrRM8r6FQzZrYxhEBCk5jo/Deau3LaV3ZYI=@vger.kernel.org X-Gm-Message-State: AOJu0YwEYNRj0yvtjEouTyQqsqqqY0V6l8JeXfRlN2/7ERNWI63VuDJb x/yhWXj7HaTG69RzItES8i01vpNfUyLV1i3UrwePg1W/shyrbian X-Gm-Gg: ASbGnctTaM+xsClFz9tpXv/KEPOve4t4DPuuTXewI2R83Q4NWIUXdQtKioX2uytOUIo YuJuj1AWgIB34pI1odmMkHtUn+ECCl2OzABOo/So3KIlWAmNA+SE4IFePFKeUncIyPmpKR/Zopo PedDil9j3ROyQEUDecK8LjEeanboI6H531fJIJUU2c/rpEYSFSVOFu8Cy/LZ29uPb7y7ugH5DSz GW86ytqXvjKFa6R/1oTkFW5N98+0W8A4SMJhca+ryIqzzfqSmaN/yjE+qrvMA== X-Google-Smtp-Source: AGHT+IEs+5VvLSlKe0whACEqkhTWDMbXqlWWWZ7XNd+k2564ZKw0tU4PVAWWdqNVX9MmQ3cJHgbYMw== X-Received: by 2002:a05:6000:144c:b0:385:e303:8dc6 with SMTP id ffacd0b85a97d-385e3038ec8mr728270f8f.26.1732926444669; Fri, 29 Nov 2024 16:27:24 -0800 (PST) Received: from vamoirid-laptop.. ([2a04:ee41:82:7577:2250:4c83:a8d5:547]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-385ccd2db43sm5873345f8f.7.2024.11.29.16.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 16:27:23 -0800 (PST) From: Vasileios Amoiridis To: jic23@kernel.org, lars@metafoo.de Cc: krzysztof.kozlowski@linaro.org, nuno.sa@analog.com, u.kleine-koenig@baylibre.com, abhashkumarjha123@gmail.com, jstephan@baylibre.com, dlechner@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, vassilisamir@gmail.com Subject: [PATCH RFC 1/6] iio: create accessor for iio_dev->scan_timestamp Date: Sat, 30 Nov 2024 01:27:05 +0100 Message-ID: <20241130002710.18615-2-vassilisamir@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241130002710.18615-1-vassilisamir@gmail.com> References: <20241130002710.18615-1-vassilisamir@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" "scan_timestamp" is supposed to be an internal member of the iio device structure. However, there are some drivers that are using it directly. For that reason, the following accessor is created: iio_is_soft_ts_enabled() The goal of this accessor, is to ultimately mark "scan_timestamp" as a __private member of the struct iio_dev. Signed-off-by: Vasileios Amoiridis --- include/linux/iio/iio.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index ae65890d4567..5661794d1127 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -902,6 +902,15 @@ int iio_active_scan_mask_index(struct iio_dev *indio_d= ev); for_each_set_bit((chan), (indio_dev)->active_scan_mask, \ iio_get_masklength(indio_dev)) =20 +/** + * iio_is_soft_ts_enabled - Check if the software timestamp is enabled + * @indio_dev: the IIO device + */ +static inline bool iio_is_soft_ts_enabled(const struct iio_dev *indio_dev) +{ + return indio_dev->scan_timestamp; +} + ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals= ); =20 int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, --=20 2.43.0 From nobody Thu Dec 26 12:14:13 2024 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C34714436E; Sat, 30 Nov 2024 00:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926450; cv=none; b=d9qH1yfQ7kLgcUBoHslTyXnkwAQA5s7WRifuEIKTwiuTwxJcrNvV5w+2QuoiCgaMCRnkKqA2xdMkFrybRnW7+N6P2FYUJfFF/olb3lpU2hHKA/AsPwjN+Rzamea5hCv0MGX1TiFFHB8n6L2iA2Zyyr1/kCr/YoxHmIiVJGig6dM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926450; c=relaxed/simple; bh=tjujbQpCbJPcxDHKJYeSPCo/U5kToNbx8fRpEVEuUnQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=csJPEnuZtNziE4sTGTth/Tg2s3aWCmm2X7FVB5/pyJlxUAT8KaMo8kBV85nOjoIBw8t/G61KGnQfqutiZ/9kFuurKMnP9o53H3q+FxPvnm9kg9+su4+5hNS9UlgrKUoh6mXdjogNL3/a7qSKOX8Ef0kE8Z5W7K/XlJWzpv1p2T0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kuv6s9mY; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kuv6s9mY" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-38248b810ffso1917371f8f.0; Fri, 29 Nov 2024 16:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732926447; x=1733531247; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oZtWMAM69Cv8U75a6tG/pnUEnTJCw8ZU0QYHAr0vXnY=; b=kuv6s9mYSX+EJsElqF8FMbNdpKc3VErOez06WzTZYgXgSrke58NSTxU5YSWJAhgg8A Eru8iJyTzGNGC2Dg1b0Mss/W/RP0M8LlvgOq2fjUnZO+PkJkJxIbc94fiEoiGbmy5MVz JDUFwxTdw73sO/V7R6ZUXS4cEhHId4kdMRPw9j4vDjjj3Rv2LjdnY00NM2M/IcEyMNlb 6ZFC/3m/z3NoXo3C+aYN7EYjQDqE2H5VHCJrDGcQQdEoTs/W2+wBQ4W9K/JmJqLzCgwv WrygxlKtJnQhY6nsL7CnY+8nv8+ILTbVFbPcWZ+QotsjZHZc5NFmMk02OqDGYeaNPYln BGfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732926447; x=1733531247; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oZtWMAM69Cv8U75a6tG/pnUEnTJCw8ZU0QYHAr0vXnY=; b=LqyD6CSL/8uO2CbtbA2wsVtYos+w0yXFRHb3fYvfQzFT+c/1nanM/2yntS5dI426q3 SABqTNb77FxpO9KuMwVbkG/VwtPcMs5q2Z8F7ItIEqIgYdHc7u9SMAuOgwbx3wk0q8FX RPkEocCuy2U/4pX/9Dq51t01V0J95z0s4o8PKpT9XLGrQqIN6MEjRwGKeveAjgSd+AJt oSs3caJjEoDUTxINUCnGXcJNLUmABG0mHFTSRtxzRMi6L8LJUPwk+MIrJz19RZuNLTi6 7hU0VAgUM1L2nLhPE9QagQH8NOGRu261edX62PjQ765KtMgG5e0gFCEuOCxm4OzyHcsI e3Qw== X-Forwarded-Encrypted: i=1; AJvYcCUq7pt6Wz9B0/gr3ROtGsWUSfvqCc7rnliqjdlbgS5090TXzq8Up0frU6ZAGI2WL7wksE8xbnVpk6s=@vger.kernel.org, AJvYcCVm8/YnTH9iiMKDnnvnl74xL0vnpe06fd+MsuZDm8xEBg/NOwn1pIu//ywuxFg8EVNJuFeRRJime0S0Jqlf@vger.kernel.org X-Gm-Message-State: AOJu0YxeuC3HTvhiuSJmlG1aY4EmnDHa7qMywkoqH1Ftj7fAjFWH/3Wf TlwQnRQeO2xKuV4L3s3p9JdpG9VTP68z9JxpXEepaPab0Kv/nDap X-Gm-Gg: ASbGnctGDOHRMz+2RbvTgydJyVeayXQCDp8HTVbXe2YVXFuU10nxWpgh8eK25fODcte /cC5XkJ7PQ1nP6fbbzDXjXveSrnuXMO2scSnXraOt0wYVUAGGTx78+SxYCtM9IIL3T/AV6OUfPZ jO/LBXx4tdfB/GriRscRe3J3t3thhy7J4ftUcRb8Xqu6r97IGmZihAZQ9YkljpotsmZNJPvUdmW SNFoEhJ0u/6dxeOMKBRbxaYpvgNzNxwrEgjJqH6/IlJ38IjNwuPgM+kOm+STA== X-Google-Smtp-Source: AGHT+IFWIDJxjusB8DewTXn48qqKRrlMIdOt0Q36io7WT1cPyKupKKrWJQ3GDNb+7/4avEv+e36I0A== X-Received: by 2002:a05:6000:20c8:b0:382:3d04:964b with SMTP id ffacd0b85a97d-385c6ee26b1mr8079340f8f.57.1732926446969; Fri, 29 Nov 2024 16:27:26 -0800 (PST) Received: from vamoirid-laptop.. ([2a04:ee41:82:7577:2250:4c83:a8d5:547]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-385ccd2db43sm5873345f8f.7.2024.11.29.16.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 16:27:25 -0800 (PST) From: Vasileios Amoiridis To: jic23@kernel.org, lars@metafoo.de Cc: krzysztof.kozlowski@linaro.org, nuno.sa@analog.com, u.kleine-koenig@baylibre.com, abhashkumarjha123@gmail.com, jstephan@baylibre.com, dlechner@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, vassilisamir@gmail.com Subject: [PATCH RFC 2/6] iio: make use of iio_is_soft_ts_enabled() Date: Sat, 30 Nov 2024 01:27:06 +0100 Message-ID: <20241130002710.18615-3-vassilisamir@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241130002710.18615-1-vassilisamir@gmail.com> References: <20241130002710.18615-1-vassilisamir@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the iio_is_soft_ts_enabled() accessor to access the value of the scan_timestamp. This way, it can be marked as __private when there are no direct accessors of it. Signed-off-by: Vasileios Amoiridis --- include/linux/iio/buffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 418b1307d3f2..3d82b110a8b9 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h @@ -37,7 +37,7 @@ int iio_pop_from_buffer(struct iio_buffer *buffer, void *= data); static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio= _dev, void *data, int64_t timestamp) { - if (indio_dev->scan_timestamp) { + if (iio_is_soft_ts_enabled(indio_dev)) { size_t ts_offset =3D indio_dev->scan_bytes / sizeof(int64_t) - 1; ((int64_t *)data)[ts_offset] =3D timestamp; } --=20 2.43.0 From nobody Thu Dec 26 12:14:13 2024 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15C8A70815; Sat, 30 Nov 2024 00:27:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926452; cv=none; b=Ib8+meh8qlOtIwgsbfARSQ8koAvqFDSJ6VVHXWwSJ2J/rezHm4tDmKQaDxgSPKBLsXBsmTXSK22m9OJdtzzzGwqxDK01jKn+dp78JrzYE+/KXFeDoEUPo1TJRgIOkSiIlDqHKMuYp6Vb55/00oEsfFLufXK+pH7rgPo3uU1GILY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926452; c=relaxed/simple; bh=iK9SpgFGEwbDnkbJKJAu0EMEWhwPxUHiWV6sBfC7nAU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R+sbRHbRpsuoDxuPon/Hr5skt90qFz7XLdXL7SNLYot9Fe9XQsrf9G8cRkPMErXZFay7+XPSMXNW8oZ28o563+Mt2C2RqX+6im+md0m7jkUGdQ5SToV/GaTpdwRvmt9CGXozdSSTPv3Xa2h3wZGdeZE00Sgu+IXaipP6nd4N4HU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eRWzOmK5; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eRWzOmK5" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-385e27c75f4so245945f8f.2; Fri, 29 Nov 2024 16:27:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732926449; x=1733531249; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9x5HbkMUGVcybCzCkxnY7lPZTEVlJ6/80ReGefbDjA8=; b=eRWzOmK5ffblWxnNrU3uCP41vx6ekcNOvhugyJiXLA/3tx3I57MY5wTo1LAI2yQKkF DLqAE4YQMDyllOz67dA3nwIkhXDQ/1SbWw2PoDjYlTyE4ELfmnIRyiWjfXPAHWor6FOl d/PbCip5c+Vi33E/fSzasRznVMgwrzOe0rFhKUFllfvmlBgQGgLovKtdi+dv5cAHm6s7 BwpojgHnB2+V8+M6aphA+Pq1DDmUHRSL0tTfwBnAbfYZbgbqUTP4PtRGHPst8H84GVDW E/Ks77e9NG3c/5FTlWtNdnHTfZyCh/5OtIxePmz2xaHLkOZeX9+bY7MzGpUv0qXkLAL5 8uag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732926449; x=1733531249; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9x5HbkMUGVcybCzCkxnY7lPZTEVlJ6/80ReGefbDjA8=; b=FJHLW0zTmlqY/Gnr52u/1U/V9CCBBeNM1YZEXMjYbL57NkG8YzeG+cM7ve6seGGAGr J795UAFxJNqh1iCLpO1FlINCaYZFsX9MOcnBxL5dTJBA84wfvi5hk1hsAJBIhhilM/Sm Lyit+nAeQx09FFujj47HDGQ4Lh9h0wy+zj/r7QGakSfBe3SO0V/ic5hkuFSTOgBlsJKw ve+o+ARusCQbjzRr2JzsDRyykuGCFnagi8IyLvA7IPGsPq/n4k+Pr+wXxJaBkrdIonYq F5/Idb64SnrMgUTbZU9F9cpVWrmbEvUDKjyC7raBBWDL6NsW9YlwUtUkUDgI5jGzu8zt WFHQ== X-Forwarded-Encrypted: i=1; AJvYcCUB5O/gCjx0Lcdn7kGD1aFo9+WI7ysgOf8rWwv602P/6DBkvb+2HSrFZsJ3swbQzJfftxiD3CEuSyUuVprd@vger.kernel.org, AJvYcCWdf5w3AIZCjFZzIO+cYSkwawMd/ozS5TPaqFbiiNli8Sr4UXCKHfqQ8rGN6KxHqJ+QzME5l4u6iHA=@vger.kernel.org X-Gm-Message-State: AOJu0YyQREbeDFcvyBymRl5yH+hDTYKf7IAlcwvRGOfWsFceqiwcoGaD 0uyJ7oA554IMmckpnsEmgAOLD0vEb2jzP3OJHJwzzcfV2AjOQnPY X-Gm-Gg: ASbGnctXZNyT8HxFBtPE8qd+D+Clv1I2n3tWht91jWQLInEvzepo3cwFNdaX0RKFM8Y VgtkzFec9kNdJ2MWUuIfgyyjomlMsU5r5vazWGJ+Z/OLvpsnfYQwsEnwUeNl381UYl9hVopJ7J+ yaOsH136W5aa0OwoK1OZWhroh8jkIBLyQtFinbCCMh2omLi7QjNEgNUCo5IhG13uAsBezUHmQe3 J9ys5tL+SNxJd+I1Nr6u1w05jvoREG+Kh2wJRj9Cum39/+tH+H0VeFyEUKrBQ== X-Google-Smtp-Source: AGHT+IGsSVbsdXgTAQ/VfQnr8ARrP0EQ5AOfBluWjl/TLhz1ETPPJfSn6R9NkBoPgog1k8Q6GU8CBg== X-Received: by 2002:a5d:5888:0:b0:381:f5c3:1d02 with SMTP id ffacd0b85a97d-385c6edb219mr11696070f8f.44.1732926449198; Fri, 29 Nov 2024 16:27:29 -0800 (PST) Received: from vamoirid-laptop.. ([2a04:ee41:82:7577:2250:4c83:a8d5:547]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-385ccd2db43sm5873345f8f.7.2024.11.29.16.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 16:27:28 -0800 (PST) From: Vasileios Amoiridis To: jic23@kernel.org, lars@metafoo.de Cc: krzysztof.kozlowski@linaro.org, nuno.sa@analog.com, u.kleine-koenig@baylibre.com, abhashkumarjha123@gmail.com, jstephan@baylibre.com, dlechner@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, vassilisamir@gmail.com Subject: [PATCH RFC 3/6] iio: adc: dln2-adc: make use of iio_is_soft_ts_enabled() Date: Sat, 30 Nov 2024 01:27:07 +0100 Message-ID: <20241130002710.18615-4-vassilisamir@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241130002710.18615-1-vassilisamir@gmail.com> References: <20241130002710.18615-1-vassilisamir@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the iio_is_soft_ts_enabled() accessor to access the value of the scan_timestamp. This way, it can be marked as __private when there are no direct accessors of it. Signed-off-by: Vasileios Amoiridis --- drivers/iio/adc/dln2-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/dln2-adc.c b/drivers/iio/adc/dln2-adc.c index 30328626d9be..f9cf132c41e6 100644 --- a/drivers/iio/adc/dln2-adc.c +++ b/drivers/iio/adc/dln2-adc.c @@ -128,7 +128,7 @@ static void dln2_adc_update_demux(struct dln2_adc *dln2) in_loc +=3D 2; } =20 - if (indio_dev->scan_timestamp) { + if (iio_is_soft_ts_enabled(indio_dev)) { size_t ts_offset =3D indio_dev->scan_bytes / sizeof(int64_t) - 1; =20 dln2->ts_pad_offset =3D out_loc; --=20 2.43.0 From nobody Thu Dec 26 12:14:13 2024 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C033126C05; Sat, 30 Nov 2024 00:27:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926455; cv=none; b=DLLOyqKb5R1o7zMQbLGGpEmhDENic9K0WhInX2CLclfjRAd9moTWCll1r5P0ESrEyRudPHwX66SG5gs7q5Vtn1cEWvGnx+gGoDJEDwVAJebHoiS9sTCSaJX42PeZeLmDwD5i/zg9NbndkYX5IcRUd10+w/vij+GJG7mC7ahciQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926455; c=relaxed/simple; bh=XItfe9KGwwMzzj6U2t6Vp8rGj8ql6Tma3iAb4mAeMW0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QUoFqXp0lorThKSjBh6jtAy/pxALt+l85+PuEmASOk3dDkKUDwcmSe/pnuDNSSU/qOZdzzXbNBFpNRSS8XNHp/cNBQo7HmQJt8RgPLyCXCQQAGnWZ+xlOdMXohRr7crbPabx+tI/001jQpOPeRxObD6pcFtDHFgQ0huFE7TjhEM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FNE6ryQE; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FNE6ryQE" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-434acf1f9abso21738835e9.2; Fri, 29 Nov 2024 16:27:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732926452; x=1733531252; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xspFG0Ip4WEEo+fxE9j2i3tI4tI3g61qtSN7CT4dO4g=; b=FNE6ryQEeB+JWA2253437Id44MS/Q3ggf96Ii74vUEf7VTRty0SfckrL3LUXCNvqEs eiFYX19bX/zFUT8pjGTeWBXldONVFFoBeDboeTQXBqwX2EYaSSTyTCK5bjGkxukFXF6K gclLqo98SvF6IvGZVFwDZKU3hXlh6/+WYffuIClxczt7m+YJ51a954trlj/aRrsM1g5N vMkZW3hKQZVJ2yrvoSZdDqp2UaivjPqSuNm6plAKmqkRtSDjTifPs7W5bT64uypX2M6P oDK3JPUBzfSzSFVALGWf9htLKzd21EuBdg/128YcWdmgJHgQYE5vCOwYxpfmhpLClkpZ Bwvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732926452; x=1733531252; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xspFG0Ip4WEEo+fxE9j2i3tI4tI3g61qtSN7CT4dO4g=; b=I/mWsOfptI8NxVw0+2wTPAbkVT2lJAvPcCOhJJWAfvOf7X8bJYuOZjYBPeTkeBWSh6 440UlqXyExTD7maTUxxg4cXWxnq+kYewNLWRfYMnseFHrkxaJ6oD39mlUSuo1xSp9gve s7e2AobEuIK89szXqKBJUqRbeiSmUoep2w1VOHpHhHyHxhYTNiSDSSlOVQ0G1liWHJ9R TljVHaFGTBeb42hggygPvyhwZFUJBsOyDgLspYBzr1nQYfnfkeyBoMX4U4XCFfiJHPUu XFeFAjkgY9OvEv61uWiNlxSZ7DMRMeinKrC3AYWQ3a7LwBqFwGu9KnTDGkm2mQSiGXGp D8ew== X-Forwarded-Encrypted: i=1; AJvYcCU7zCz/MBJU0M4H88pfHuPlrH0NmWFNk8l71dqBaWvgV9VEHoK6bcsxlOwh2QGypBPhhV97v2uLcwc=@vger.kernel.org, AJvYcCXdZ2RhmCxtUcyoIvnsUD5n8Mgf5QavE16xntUW3wE6I8N6qU5vNNem6o7JPoAmn1gh2IPcxvHI2S8EeFof@vger.kernel.org X-Gm-Message-State: AOJu0YxMUmV3idEJOUCvNfmSGaWnbPRBGxpM+uAqgzMKqR2M6X3Ao5Mc iHKKG8qY6+/82fuWOKXbsgQswrpSOs5eTEOpnvv+6O0bQGagZvck X-Gm-Gg: ASbGnct+1evP+DdaxQOUL7N0U6ZHj50Vxn8C4DrLpIdEqthoKzEEzxJGH5SzdsURaFq u0DEiMLMnTsX0mxPsfUxF0b9VY85AK2NXT3EnfO9aOAobmLdW0PqeQCl+zDbdVuVHVMRy222mmI 9+3k33DTBlQRiD7DLyQrlL7BAbs+fVDDwJbOn4hmVLLMUFhrLkbg1S5JMK/J4FmJxGIbEnjjVMR HT/ArPGzfzIv3ASJyWQGWG+Ufmz1cisgspE2frkSS7v9QJ5i2QCcSqmxistQA== X-Google-Smtp-Source: AGHT+IGFokx7HlnJ17XafWw0ijsuOtCf8i/bAErUtuBN/+8/PpZbqpN2X1ZFgn5EbEe9+hLXnK50dA== X-Received: by 2002:a5d:59ae:0:b0:382:2d59:b166 with SMTP id ffacd0b85a97d-385c6ebf097mr12106322f8f.31.1732926451592; Fri, 29 Nov 2024 16:27:31 -0800 (PST) Received: from vamoirid-laptop.. ([2a04:ee41:82:7577:2250:4c83:a8d5:547]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-385ccd2db43sm5873345f8f.7.2024.11.29.16.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 16:27:30 -0800 (PST) From: Vasileios Amoiridis To: jic23@kernel.org, lars@metafoo.de Cc: krzysztof.kozlowski@linaro.org, nuno.sa@analog.com, u.kleine-koenig@baylibre.com, abhashkumarjha123@gmail.com, jstephan@baylibre.com, dlechner@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, vassilisamir@gmail.com Subject: [PATCH RFC 4/6] iio: adc: max1363: make use of iio_is_soft_ts_enabled() Date: Sat, 30 Nov 2024 01:27:08 +0100 Message-ID: <20241130002710.18615-5-vassilisamir@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241130002710.18615-1-vassilisamir@gmail.com> References: <20241130002710.18615-1-vassilisamir@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the iio_is_soft_ts_enabled() accessor to access the value of the scan_timestamp. This way, it can be marked as __private when there are no direct accessors of it. Signed-off-by: Vasileios Amoiridis --- drivers/iio/adc/max1363.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c index 9a0baea08ab6..57d9aff729f4 100644 --- a/drivers/iio/adc/max1363.c +++ b/drivers/iio/adc/max1363.c @@ -1473,7 +1473,7 @@ static irqreturn_t max1363_trigger_handler(int irq, v= oid *p) d_size =3D numvals*2; else d_size =3D numvals; - if (indio_dev->scan_timestamp) { + if (iio_is_soft_ts_enabled(indio_dev)) { d_size +=3D sizeof(s64); if (d_size % sizeof(s64)) d_size +=3D sizeof(s64) - (d_size % sizeof(s64)); --=20 2.43.0 From nobody Thu Dec 26 12:14:13 2024 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A827C136671; Sat, 30 Nov 2024 00:27:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926457; cv=none; b=E3hPbYwKuoiGHSYTGxjRskOU0txZzc8gIBCaZPoTTy859DvwI6E9kehMgtp4MraETxC86EP6o7jPmisp6NALySdX0H74lq6nrT6bhRBljhV+YkegnvHGYgCSJBWXFe1PMNL/GrGl3us0rwFVsFASMUzAIAyKg2/L9EPcvAC7SyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926457; c=relaxed/simple; bh=02QdyCX7x4jDMJ3t/IjMhAORjnOpXGujKs5X1hTXblA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AjVeH+usgdnmQWg8d2yudO3tqIy9u8e3gOIEQ5JCdsP9NWWNv8IjoVBHO6r7uIZBmDCRJAXg2zXRQb5YDHHDngqqtfhwei7V+jzreXxa8EJIfC1psuzj11BE8sIt+i16ZSXHz2Z+NOsFpsM8bPqlxVHb01/4X6srGZahUznqW4Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LSJoHTL8; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LSJoHTL8" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-385e35912f1so136323f8f.3; Fri, 29 Nov 2024 16:27:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732926454; x=1733531254; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F1JZkG+mRXjADgwPZalzjZmjrMf0Z2/+XZ6xVW/L86M=; b=LSJoHTL8O6SBrL21Iq3pv2uhgfJ79/AU1ABqTePXTzeaX/FFj+uCILaepK/bMZ/zO/ MP/bTXiDWsUvY23FlohItddpH7N7IckM6qjaeIR87B7pJ/KIz8RPu7h4pCUSjkcUPDRx O4nGgprPxJXG0JuHlVcW9RY0VTrcIUW3O5l/F2B9EEu0/PBcYMoxiUZ5Khy8sj3ZeFpR h+9ktSmESLtkSPrRX6SaANPfj2e2DWtQBah0Ke/1vM1H6rkEW7+GQPZPPe/aBqiil8IG DWW7lG2Ujk+mSpM4PY6fOfxW/sdJuTdx7r3/+4ilzwLjhpJiEQgC1OE6NOKmyGJlnlEN 4KiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732926454; x=1733531254; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F1JZkG+mRXjADgwPZalzjZmjrMf0Z2/+XZ6xVW/L86M=; b=BfS0et9W94KyDRBq32guUTtI3CstOnaJcu+V2ictZhH+gS4AEWc0gqK30DggBXFvT2 Fz7DFbAGf2PuNP7xoM250q/Ax0/ypXLdMY60AH1Lxy2BlZFkJHo02Og6TzVPPiuCusUK z4vpVXPMq0A7zXumT4gB/VSgRrrZtKiOQQ9W1V+ey2mvfM5sU6zl3K4tHDUNYTK4kDx8 xwRw78n5j9bgU9WKyiCEx4oGhzBV0X3AqfftcDrwBGKgHwXLaiXnbNqqpzzZH1jQo7au 817L8f70bsPkSEPDFqy5a8pajZhB+tEK+Wm/NI4cQ21TVLdN0vaZrNH6/8AS1yCm70eO NwDQ== X-Forwarded-Encrypted: i=1; AJvYcCUS4nLbfWGLZCoNWl7Gx2j1EFAKPm75pvC5Ab2xUV/U7yGibE6e/ybfi3nK0EqKjf737mPv5Uzapjo=@vger.kernel.org, AJvYcCVn4DuxV7qNGaS8Xoep3k4b3sPUy+d7iezG5pvkDiyCjmTQ0MBlYDMPuNr0/cm6sPkSAqYa+2bsCuoOTarG@vger.kernel.org X-Gm-Message-State: AOJu0Yyvijz/2++BpF3N/TCYXiasGSrvkHYp+q/lvfzIaIKOaLjKdAn3 aqkeH8PlwokeViLMmiwCkS8B6CK/VR5Nb0v9pQrGI0djxaulLpsu X-Gm-Gg: ASbGnct2xN4yKJ/Ae2S+kYNC8DJ/Z8M2CshdqfaRgA4fb1/doDHF1L3fGh2ujpNB0xV ftOH3Fsi4fIelm985gEMjKUl2K/yLM6n/rH66XTiv5BlKF+VH9j6Jd4IAqSlCpP5FZiZC92uqzK s7CzpB8TwZw9B96niFc1OLYWvyivOtrfYCKZygMTwBuZy2mAYPiRyMtO9T88JoBo9lbbHqQGhQ8 18I7uRFwHSptPMrEPccIntZpnMyT+5d10c/3R3HrcmYdZl/x+qCFKz7Br2vqA== X-Google-Smtp-Source: AGHT+IHj2f+0FlSnxxeMcSa4wwwqZ64CRZGfxYBSVQEdU3y1cktiyvOZaODwPtD6SHkVSx06FIB1Tw== X-Received: by 2002:a5d:64cb:0:b0:382:4a9d:28fb with SMTP id ffacd0b85a97d-385c6ee12c3mr9060909f8f.49.1732926454079; Fri, 29 Nov 2024 16:27:34 -0800 (PST) Received: from vamoirid-laptop.. ([2a04:ee41:82:7577:2250:4c83:a8d5:547]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-385ccd2db43sm5873345f8f.7.2024.11.29.16.27.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 16:27:33 -0800 (PST) From: Vasileios Amoiridis To: jic23@kernel.org, lars@metafoo.de Cc: krzysztof.kozlowski@linaro.org, nuno.sa@analog.com, u.kleine-koenig@baylibre.com, abhashkumarjha123@gmail.com, jstephan@baylibre.com, dlechner@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, vassilisamir@gmail.com Subject: [PATCH RFC 5/6] iio: common: ssp_sensors: make use of iio_is_soft_ts_enabled() Date: Sat, 30 Nov 2024 01:27:09 +0100 Message-ID: <20241130002710.18615-6-vassilisamir@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241130002710.18615-1-vassilisamir@gmail.com> References: <20241130002710.18615-1-vassilisamir@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the iio_is_soft_ts_enabled() accessor to access the value of the scan_timestamp. This way, it can be marked as __private when there are no direct accessors of it. Signed-off-by: Vasileios Amoiridis --- drivers/iio/common/ssp_sensors/ssp_iio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/common/ssp_sensors/ssp_iio.c b/drivers/iio/common/= ssp_sensors/ssp_iio.c index 88b8b56bfa51..c38bf1dfb7bd 100644 --- a/drivers/iio/common/ssp_sensors/ssp_iio.c +++ b/drivers/iio/common/ssp_sensors/ssp_iio.c @@ -82,7 +82,7 @@ int ssp_common_process_data(struct iio_dev *indio_dev, vo= id *buf, */ memcpy(spd->buffer, buf, len); =20 - if (indio_dev->scan_timestamp) { + if (iio_is_soft_ts_enabled(indio_dev)) { memcpy(&time, &((char *)buf)[len], SSP_TIME_SIZE); calculated_time =3D timestamp + (int64_t)le32_to_cpu(time) * 1000000; --=20 2.43.0 From nobody Thu Dec 26 12:14:13 2024 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B713E139579; Sat, 30 Nov 2024 00:27:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926458; cv=none; b=FdS8uFlY3W4TbH2+W80100JdiBS6Dzx8j5Wr9+LoI6yRjyM08FLV2vX6lUZcEPcYwWzg40liMsh51XamUfATRonG4TOpBZgKTff8WFSkUg/n2z2v7wxKnOb6V9MQK6xgxVt2VkicYuwhRBfsfoAgCPep93yl2FuqMHilYEsY6wc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732926458; c=relaxed/simple; bh=z0HMc5U1PTtA2Nr14+pdfS1vr/bqIZLGz5vkPjd7Sjo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O5ZQoptYWBvsbZKu08eUUC3P9jCtn6aRKnNlapN6DHzrql0EY4xS4A58Xfjx0N3zrxC4XJGO9Q2mEeBxNb7Zdn9UdFrhNzg7HHX5ZvZZ16X9ac3aFJjsn3lPdxVn5G0k7aUZpSujNK9DMuh8iFdjFtVqzMUa/fnE7CbDuJLBxWc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MhHkhm1/; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MhHkhm1/" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-385e1f12c82so394323f8f.2; Fri, 29 Nov 2024 16:27:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732926455; x=1733531255; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VFnwIg1SlNfk7YCu4Dnn+679o1iR81Pc1C9n26emMmQ=; b=MhHkhm1/eHSBtSAe/A3As4SHqbKSRNUaFfMd2Fi0WTnVYrerSN1axYl5V3IkzFgNpe foBzryf+jWi4KZJ7YJmiEomi3KUvOR0i7hW/fBzP0O5mD73M+Nk+pf9WNZ+Ix5+tCYA4 ALW33Npf8n96LoND4oVH7fUkO4xeVNMZkmS02wiLfa674MziKzg+gfUg4HaupcrE0spT yIxY2+L/c13Ks38emHQfggYLYaerSsheBkxAUgXOJFWCZZetZOUoix1O2zNwD/no3g3y wpwS3di0OFcIqNeBwMnSrrx0Hr4V7E/p2XLCrus35NvqPmKuO444ZmZn34eeoshrYDl0 Y+xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732926455; x=1733531255; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VFnwIg1SlNfk7YCu4Dnn+679o1iR81Pc1C9n26emMmQ=; b=jGdlr8p1vE25Da6WPYd049OvkuMcDDIG4SPZGjLj2E7h0HiLjjFFSPzoNJuwlUFA8v hxisiCCCE3TsTdNP6Yw4bCQANtgaSR9jKu8Z+2iyFH++awEmgNh9ZY4mFx0cm85OgjiT XuwrOOLlIagmOsNlMgHHgAkmbvgi6lCzz4tO5RppBbC3jKlxdHkiwavhrVQAyvoPpoRl xp/IPqX+FbhWNsTs7RTmksIgsXxG7Q6q7G3I5nbaKtKIojHRoh8aL1fBiiLMQRP7ssmo CfFh4xE3N7NQxX1/800np6UK9BMUzIX7ntVpMspGrpNxMynLVq0gzkrFtAgunoWOGzzW wvsQ== X-Forwarded-Encrypted: i=1; AJvYcCUQI7keuRZbwMn73pdrONHd1OWUEU/D1aIL/p4vzINoxyd6RtEM0m1scxzFUfRoAJkRM+yupLoCb0I=@vger.kernel.org, AJvYcCUxZyGlw++3CpP+FuuqIxl8QFX9tYa//KkC5r/Qo3ik81yKSQGmS1zaPWniHGwr/hQivtWv0gIIoDz0bKiB@vger.kernel.org X-Gm-Message-State: AOJu0YwtKB4fQ+GfIDhYvsVplLx9vbrA5wfhaTIM2FEfC0mgBbjwhNot 9Z36I+PeSt6hBuDbXiKLg7VHm/tUjPLO/uR+HMIbdAvDPuP3DPHjwhpLeJt5 X-Gm-Gg: ASbGnctCsze2uo2UaEfYPZfgMNOa0Bg9HxkfutpCi5mwPjNQXzcTtOY8sCYU7QTesbR vXCeqZPSZmwB7p4UU6HLh0xQsQaFZs1xBGhorrOgMOEmoG+n0mkzD6S21Vif1YrHVgZrK36G0+P wIMs4ttpFy5fH6IFz0CSd62vx8ieJh6/JMVxxugcnTw+wOVNv/1+nnaY8Icl4S9XGiC4Lyomif8 NkuTPF4j1C9B9Ehpb+NFYmCjmtzEyajNaQQl+jgtWvz73qtR0gGClRPLbK9eA== X-Google-Smtp-Source: AGHT+IHQWr+IrxUNAk7zs1/xyAUn/MmlBN/UG2b3dr0rFp6iNWLgDNFXIcOKOxYIaKs4jXlkU/8F4g== X-Received: by 2002:a5d:59ac:0:b0:382:450c:25e9 with SMTP id ffacd0b85a97d-385c6ebb925mr15211897f8f.35.1732926454963; Fri, 29 Nov 2024 16:27:34 -0800 (PST) Received: from vamoirid-laptop.. ([2a04:ee41:82:7577:2250:4c83:a8d5:547]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-385ccd2db43sm5873345f8f.7.2024.11.29.16.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 16:27:34 -0800 (PST) From: Vasileios Amoiridis To: jic23@kernel.org, lars@metafoo.de Cc: krzysztof.kozlowski@linaro.org, nuno.sa@analog.com, u.kleine-koenig@baylibre.com, abhashkumarjha123@gmail.com, jstephan@baylibre.com, dlechner@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, vassilisamir@gmail.com Subject: [PATCH RFC 6/6] iio: core: mark scan_timestamp as __private Date: Sat, 30 Nov 2024 01:27:10 +0100 Message-ID: <20241130002710.18615-7-vassilisamir@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241130002710.18615-1-vassilisamir@gmail.com> References: <20241130002710.18615-1-vassilisamir@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since there are no more direct accesses to the indio_dev->scan_timestamp value, it can be marked as __private and use the macro ACCESS_PRIVATE() in order to access it. Like this, static checkers will be able to inform in case someone tries to either write to the value, or read its value directly. Signed-off-by: Vasileios Amoiridis --- drivers/iio/industrialio-buffer.c | 2 +- include/linux/iio/iio.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-b= uffer.c index 8104696cd475..c332741f3cf4 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -1137,7 +1137,7 @@ static int iio_enable_buffers(struct iio_dev *indio_d= ev, int ret; =20 indio_dev->active_scan_mask =3D config->scan_mask; - indio_dev->scan_timestamp =3D config->scan_timestamp; + ACCESS_PRIVATE(indio_dev, scan_timestamp) =3D config->scan_timestamp; indio_dev->scan_bytes =3D config->scan_bytes; iio_dev_opaque->currentmode =3D config->mode; =20 diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 5661794d1127..669b4ef1280d 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -611,7 +611,7 @@ struct iio_dev { const unsigned long *available_scan_masks; unsigned int __private masklength; const unsigned long *active_scan_mask; - bool scan_timestamp; + bool __private scan_timestamp; struct iio_trigger *trig; struct iio_poll_func *pollfunc; struct iio_poll_func *pollfunc_event; @@ -908,7 +908,7 @@ int iio_active_scan_mask_index(struct iio_dev *indio_de= v); */ static inline bool iio_is_soft_ts_enabled(const struct iio_dev *indio_dev) { - return indio_dev->scan_timestamp; + return ACCESS_PRIVATE(indio_dev, scan_timestamp); } =20 ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals= ); --=20 2.43.0