From patchwork Sun Dec 15 18:28:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908845 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC4E513C8FF for ; Sun, 15 Dec 2024 18:29:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287373; cv=none; b=iVPqxw09n54LTeSo2iFFnAawmWhSPcWpaOhoqHXbhRA93pgqzREa5TCdBGSHpJO4al46xlkRe4eqOlDuIHFwbfhfwGXOqVll0udxJKxujjZVB1famCb5WT+Q8Iapq/TFmT2N3aaoEhaAEDFnxfCscf2scrAhDGmNOzX0c8OOtcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287373; c=relaxed/simple; bh=srMjROyKEUkASEaY4+Hspwa+SL2XyaFApsZ9uHmC964=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vprh2ubDfDsoA7Nx6L7/erkpsen6jzFqcrnSCwbFA9P6dfFgV9D58l1aJMGNowSS1dzRX7Yxf4H1fU6sV8qwmx+NvCcWprQO6NRSFsNi6V1HPvgGOVGPExAeWJL5fvfdMezXbKygfLrf0OqZqeo84GkIsb+nawJT/smwHyNvbMc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NrrL2fIq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NrrL2fIq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22D2DC4CED3; Sun, 15 Dec 2024 18:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287373; bh=srMjROyKEUkASEaY4+Hspwa+SL2XyaFApsZ9uHmC964=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NrrL2fIqtNyB40A/0ZeObBzQS5UpY1o+dPomucVVi49XiEli25j5wKP/OH6YSonBv akiMu1TNF5gp7ewyyQ6Nmu+4nSBCFRHxE9paPnUJenf+R9lyY7XqU0xziQ+W722aEY nxi3zU8blGhS3brsYkphZEsYQdgKmVFWDWlDxVMT7QapbKnGvKh8xm2VhFeusmiEj7 vMawdTcl0NEk6MC36ftehSokVUs34nVlhW+RQ2i8Mx+9/sYRhlpM7sffWHZtRBnM1U QrA/IaIn0qL5UPvoxVEE5c/BpYdEDTJ5t8PheuQ2c8maqgJxxps3+TpXWfmAYFK0Ys ULTO2hkWsqLWg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 01/20] iio: adc: ad7944: Fix sign and use aligned_s64 for timestamp. Date: Sun, 15 Dec 2024 18:28:52 +0000 Message-ID: <20241215182912.481706-2-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Whilst it doesn't actually make any difference because the code that fills this field doesn't care, timestamps are all signed. Use the new aligned_s64 instead of open coding alignment to avoid confusing static analyzers and give slightly cleaner code. Signed-off-by: Jonathan Cameron Reviewed-by: David Lechner --- drivers/iio/adc/ad7944.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7944.c b/drivers/iio/adc/ad7944.c index a5aea4e9f1a7..0ec9cda10f5f 100644 --- a/drivers/iio/adc/ad7944.c +++ b/drivers/iio/adc/ad7944.c @@ -75,7 +75,7 @@ struct ad7944_adc { u16 u16; u32 u32; } raw; - u64 timestamp __aligned(8); + aligned_s64 timestamp; } sample __aligned(IIO_DMA_MINALIGN); }; From patchwork Sun Dec 15 18:28:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908846 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3FC813C8FF for ; Sun, 15 Dec 2024 18:29:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287376; cv=none; b=Iu213MeJZTUMX9TDeudnPtN4GNddqSKO3ypdVFEBwVfMxzXzoeJnO/LPNhSUIilsps4LeteCqRalIkRkpHQSqldchY3srMaLuIEa/wiP/auQ/3ta5OZh+3B9GiEaMm6ViJN7izT08jJ/nB1ML+phaPeReMTMDa1atWimMODliU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287376; c=relaxed/simple; bh=1WTeeEaBe9njS2zLj0MVTaTiIdyyf+X+6zDMsOVdavU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kc0h60j7uiy4Qi7mmKQkd7h78M9o83fFa7QAw6VNeodN80vuok8uPLYve+pKg7JEl/AkCn8BZhh2iGWwyWZlOqPB+bzdWlWaxGHFZlCoPQJSojxpH+VSZ7jFAhJyq2fAUma6IHkZN/TwprZjM4hzXFqJmAqE9V3xZi6EMmWwDWk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=imbjCwH1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="imbjCwH1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 017E3C4CECE; Sun, 15 Dec 2024 18:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287376; bh=1WTeeEaBe9njS2zLj0MVTaTiIdyyf+X+6zDMsOVdavU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imbjCwH1whIf6mkC+dG0mY9p8zXEH4qUQQXIsB6/y3j1CqdQtwZLNdAt+1H11X2Pq p9qQkH/hlwuNKrzMAUo15cj69rj+QpVS8wMur6sNViTvRRPfJpceurAtfgKf6pLpo7 AjbhvDZz7HPBRx1GQc1yAJu4/l/QVyHm1xd8Ou7mWmsIG6+A5yhM6ON5SD7UlTov23 fCd+p9jD12cUYbg0vj+1DnbqLd3ZllWH09mvT7ZTENs1T6VEjRjA/zQhlrp8OgJLvX vuuyP6b0B1yYGsnho7Wd7xmLaTPt9yZRaKgD0syVK+lwRodXD1UpD514djRZNFGWk8 Jm0JTXU9bUx3Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 02/20] io: adc: ina2xx-adc: Fix sign and use aligned_s64 for timestamp. Date: Sun, 15 Dec 2024 18:28:53 +0000 Message-ID: <20241215182912.481706-3-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Whilst it doesn't actually make any difference because the code that fills this field doesn't care, timestamps are all signed. Use the new aligned_s64 instead of open coding alignment to avoid confusing static analyzers and give slightly cleaner code. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ina2xx-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c index 48c95e12e791..40d14faa71c5 100644 --- a/drivers/iio/adc/ina2xx-adc.c +++ b/drivers/iio/adc/ina2xx-adc.c @@ -150,7 +150,7 @@ struct ina2xx_chip_info { /* data buffer needs space for channel data and timestamp */ struct { u16 chan[4]; - u64 ts __aligned(8); + aligned_s64 ts; } scan; }; From patchwork Sun Dec 15 18:28:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908847 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 514D313C8FF for ; Sun, 15 Dec 2024 18:29:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287379; cv=none; b=o1Pp7Xk8mRvnO9F1U6OlezpAx3+GfFBqgu0oojTaXISpCeay+hXg+68+h5BJVcDDQTxTx3EmoY/cnmiSE3BlaQWYAgBBhSnq80q0/8YND+OSTzOgvK8jEK4sKmA6zZ4r2ZdAKuSYohMhMHfWw5d1rZbI1EgdwheQ9Vja+fvzLgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287379; c=relaxed/simple; bh=G4nI2P24Y3fIooMWa4anK1EWslXELM4X1MLzm0Ajlz0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QFsDiJGmngJVnbIrCpXiShRBKDb0jqFEV10ZorFwd5dK6Ydln7l7MiVG1hNfg7IP7k5i2cquhRGw2pJ1eKRrwfV3H9JrQmUrvImeO9DpKlUc9CA2a9u4vQEJtkJEO9YrfeftLh+/LLFGBFY9NEjKBtxRj2FheaiCocDk7cfQrqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W31qGfcH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W31qGfcH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1A72C4CED3; Sun, 15 Dec 2024 18:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287378; bh=G4nI2P24Y3fIooMWa4anK1EWslXELM4X1MLzm0Ajlz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W31qGfcH83QZP8xiZKwVPXN3qNTxBcAgTAcJWIe5FKlN8riQ5rmIIfgL7AT2wEdrQ f/wGmAYyhdU258P3gSc84EW4LDA9DF5a3rjoE3sbY8XM5NdZFONRz1v48N6RJMnKgd hij5dUKPxkgfsJm0G1lOCPNSgfx81OdHZOyA+ypO/bOHk2yo8aX2HcvA7bKiEWuCor m7F9aaWuuCfIwVhd1NnTdbL2Y7cui9VbEGoyg/KEpd+cboRFGq3vK55he2dWl0+4hH Mog6filLOfgowzzq6/OP/dBFQc7hzpEtSpRTPb/iEbGvIyMdthI4NxbDK/umGbvJy6 l0FJImx2Pol8g== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 03/20] iio: temperature: tmp006: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:28:54 +0000 Message-ID: <20241215182912.481706-4-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/temperature/tmp006.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c index 0c844137d7aa..7beaabc9ecc7 100644 --- a/drivers/iio/temperature/tmp006.c +++ b/drivers/iio/temperature/tmp006.c @@ -248,7 +248,7 @@ static irqreturn_t tmp006_trigger_handler(int irq, void *p) struct tmp006_data *data = iio_priv(indio_dev); struct { s16 channels[2]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; s32 ret; From patchwork Sun Dec 15 18:28:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908848 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94C3013C8FF for ; Sun, 15 Dec 2024 18:29:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287382; cv=none; b=YNJ0UI80lcIxDqPd1mT3RRw4sbm4QZAAW0vBmHK5036woXT3lf8u2dt29eKgNjlrqXBsdByY+kiPUI0JUNEthBKvW+1cEOd6+QQlOSwlXpiUxOfQt9pdflFyd6AfzcFAWCp8stCXWHRYX/Ys0WMpShh2dBG/t2kRm76Uo5GIIPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287382; c=relaxed/simple; bh=30scRPRz18cDGbxdI/s9w8GHcmSgayjwpuO7o5JozZ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uNqh2fC3hX3LttDru9+3KUe2LiqNIAqBXVnHTKEFmaemYeBfAYR0k3ozt8j5Yedn+smlDN985u3XsH0QruTSuB9EuxECNT9sIkR6vsdWzDlVnkWqxmdb2APKuQI3tG2F524yUzEsYw+KvpuTdRkXV1dGqAx3tDH+JoIu/gDIEcU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OLbvwmzj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OLbvwmzj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B88EC4CECE; Sun, 15 Dec 2024 18:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287382; bh=30scRPRz18cDGbxdI/s9w8GHcmSgayjwpuO7o5JozZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OLbvwmzjMv0qnP0oh429dc8QFdKWAEBXNJdtK+2ZBNXl7m9++t/qcKKYSBGn6VHgw cYUcZ3YFF0IW4kxKa80Gm5vYvWlZtsJpBqwu413eJ/InuGCy7fMu4pHRwXQB+q1tHx CxxJiInkm4AECe24maYRsNQ6SAuRNgAx+7Y4Nbu3zyYJ3hL/33yxqw5CIit0yn4/jf v7V7/5RJfMljnIJY4S9QKWPaql6jiWCMVXCxXhvIyHwiJLSnEA8AfG2ZWxJPgFsuOu NrlQXKEgtgxShJ2WKmY1sad9liHuADYyCK1xUOT8zCWh9b1gH8rbSnKvN0kyIq23oN n6AYb/sfRmbvg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 04/20] iio: resolver: ad2s1210: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:28:55 +0000 Message-ID: <20241215182912.481706-5-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/resolver/ad2s1210.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/resolver/ad2s1210.c b/drivers/iio/resolver/ad2s1210.c index a414eef12e5e..b681129a99b6 100644 --- a/drivers/iio/resolver/ad2s1210.c +++ b/drivers/iio/resolver/ad2s1210.c @@ -164,7 +164,7 @@ struct ad2s1210_state { struct { __be16 chan[2]; /* Ensure timestamp is naturally aligned. */ - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; /** SPI transmit buffer. */ u8 rx[2]; From patchwork Sun Dec 15 18:28:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908849 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55DF013C8FF for ; Sun, 15 Dec 2024 18:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287385; cv=none; b=YGRtb3weGVvkzMXynjKV7rjOwF9gd/tWxnzC2Ns/tMAH+VnYTmLIaX1OeOgIONcBUpyuYaO/WAR7jtjOCRWgSahOvhZKazRXoQe0ThdVUuxSMg4cUiCQ4+zTdTYRsY6TX2dhQlAespyChFscaExap3nDawhUiQ43S/aVbpAAOtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287385; c=relaxed/simple; bh=ZY6Ge5XFAfx+PwOfwawtOirybKhWZFqSUbvMUDsBvAM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TXB4jHBbgq1dh2iJ7sgqNJovbhwXWG3/FHp/NPzCtDvXgRFpqOcfxb4u/g8MNfqd+e7Nf32dWdltpgwXWNMfFNIjY/4r3OAvDInbJZUNRCsui0QYrSoD8bRZw2ENqCVA+0q1B+7SFpTvLssPYQljraI+h1R006up1AId9sarrwM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PSsC1Diq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PSsC1Diq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC1C3C4CED3; Sun, 15 Dec 2024 18:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287384; bh=ZY6Ge5XFAfx+PwOfwawtOirybKhWZFqSUbvMUDsBvAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PSsC1DiqjZT2isgPMGZngh6kfATvB7vfaCuk0UlSsdOAirOmHsKxZdkg/p+BwnHhl D5eicPWqB8Zj/G4WsaWSGVDNgiiCWKCQhFmxgnShIgGAmqw+zBFdU6eEYN7aPejnRy yEhBxejqhIdX8icVffdGwj55LDVnLj7vrChqFrHW59Qobg3YgNary5N4EzJmlUYVWa K8eQcIjRJksKL0Dt+yJeRok8aSN6NBPsZRDsHCfRxBBgvUQ/zI/MpqP56cF4pYqYig hOlXdvgsjgmDHQR3h0QLu+GtPfqoXzo53NfWQGE7kQApIXJNdPB2d8WW61sdEYW5K9 8knDSgKSXS/Pg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 05/20] iio: proximity: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:28:56 +0000 Message-ID: <20241215182912.481706-6-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/proximity/as3935.c | 2 +- drivers/iio/proximity/hx9023s.c | 2 +- drivers/iio/proximity/mb1232.c | 2 +- drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 2 +- drivers/iio/proximity/srf08.c | 2 +- drivers/iio/proximity/sx_common.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c index 96fa97451cbf..9d3caf2bef18 100644 --- a/drivers/iio/proximity/as3935.c +++ b/drivers/iio/proximity/as3935.c @@ -63,7 +63,7 @@ struct as3935_state { /* Ensure timestamp is naturally aligned */ struct { u8 chan; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; u8 buf[2] __aligned(IIO_DMA_MINALIGN); }; diff --git a/drivers/iio/proximity/hx9023s.c b/drivers/iio/proximity/hx9023s.c index 4021feb7a7ac..99788c116c85 100644 --- a/drivers/iio/proximity/hx9023s.c +++ b/drivers/iio/proximity/hx9023s.c @@ -134,7 +134,7 @@ struct hx9023s_data { struct { __le16 channels[HX9023S_CH_NUM]; - s64 ts __aligned(8); + aligned_s64 ts; } buffer; /* diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c index 614e65cb9d42..cfc75d001f20 100644 --- a/drivers/iio/proximity/mb1232.c +++ b/drivers/iio/proximity/mb1232.c @@ -45,7 +45,7 @@ struct mb1232_data { /* Ensure correct alignment of data to push to IIO buffer */ struct { s16 distance; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index 5c959730aecd..f3d054b06b4c 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -47,7 +47,7 @@ struct lidar_data { /* Ensure timestamp is naturally aligned */ struct { u16 chan; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c index a75ea5042876..86cab113ef3d 100644 --- a/drivers/iio/proximity/srf08.c +++ b/drivers/iio/proximity/srf08.c @@ -66,7 +66,7 @@ struct srf08_data { /* Ensure timestamp is naturally aligned */ struct { s16 chan; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; /* Sensor-Type */ diff --git a/drivers/iio/proximity/sx_common.h b/drivers/iio/proximity/sx_common.h index fb14e6f06a6d..259b5c695233 100644 --- a/drivers/iio/proximity/sx_common.h +++ b/drivers/iio/proximity/sx_common.h @@ -125,7 +125,7 @@ struct sx_common_data { /* Ensure correct alignment of timestamp when present. */ struct { __be16 channels[SX_COMMON_MAX_NUM_CHANNELS]; - s64 ts __aligned(8); + aligned_s64 ts; } buffer; unsigned int suspend_ctrl; From patchwork Sun Dec 15 18:28:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908850 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96D1A13C8FF for ; Sun, 15 Dec 2024 18:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287388; cv=none; b=Krkw40/E8n90r54Eo7gKoeXx/kpxWQAkhzfutrm/e7c6gnYVzkgBjFy0i9m+itmhLfe5Sr7tPXeHRsNsci/p8wW5+aRRr8SVWbvBtXOigdqujjN4zRkE5afWMswL9a3c2puWxqftcCuFJDfhJC+eQWM8o/nnO+LM5i6Up035Nq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287388; c=relaxed/simple; bh=+QSUAQf5K7CbQR9jUqyMbTBvWWZB1GJ6Buqr4USL0qc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ApKNwWeiF1oF+Dqu/FDZkmd6Fiq9gOmzdkG4l+PudFH76Qntx/9JHyYVT16Pco+rTWe3IfaGLYVNEy4AE0fwiOWwRXKZZ6UHtwRH4Q1+6EgfeySXTSH0O55X8i4d+zKZAQ2qx4FUMsWLwRlYiA9vHCAbRZ05Vrc2qq84RFHe6LY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b96jUKU5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b96jUKU5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5D9EC4CECE; Sun, 15 Dec 2024 18:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287388; bh=+QSUAQf5K7CbQR9jUqyMbTBvWWZB1GJ6Buqr4USL0qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b96jUKU5KYJUignZK3XevpPN7CH2G3geXezZK+ScrFzBG142r17Tc3W1jHfV47/x9 E1t9gsOR6o+ITkLWEnJx+2oeIdRQ83bIGn0VKEnQvbNdiPFMidJEqqqxTBeCAbs4xl t/W5k3Sif4kpcxfKQSuFi6P4fhWmAfyzayY2nTLnTZmsokZZy1oZlmKXIV0rBk68H/ WJk9M918mw4/PNI64kXNjfU3r1jzzCW/AejqsSplfnQRLfs7AQ//tOszqhHcPU/AJE 1xcu7MnfIwGnQfgjRj/RYsqUnKjnoJ0GENEugS4EQkcrT4t1eqiy4Wsf2fn/9lPzp9 5l3f0Olin70NA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 06/20] iio: pressure: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:28:57 +0000 Message-ID: <20241215182912.481706-7-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron Acked-By: Matti Vaittinen --- drivers/iio/pressure/hsc030pa.h | 2 +- drivers/iio/pressure/ms5611_core.c | 2 +- drivers/iio/pressure/rohm-bm1390.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/pressure/hsc030pa.h b/drivers/iio/pressure/hsc030pa.h index 9b40f46f575f..5db46784f4c6 100644 --- a/drivers/iio/pressure/hsc030pa.h +++ b/drivers/iio/pressure/hsc030pa.h @@ -58,7 +58,7 @@ struct hsc_data { s32 p_offset_dec; struct { __be16 chan[2]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; u8 buffer[HSC_REG_MEASUREMENT_RD_SIZE] __aligned(IIO_DMA_MINALIGN); }; diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c index 056c8271c49d..00c077b2a2a4 100644 --- a/drivers/iio/pressure/ms5611_core.c +++ b/drivers/iio/pressure/ms5611_core.c @@ -213,7 +213,7 @@ static irqreturn_t ms5611_trigger_handler(int irq, void *p) /* Ensure buffer elements are naturally aligned */ struct { s32 channels[2]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; int ret; diff --git a/drivers/iio/pressure/rohm-bm1390.c b/drivers/iio/pressure/rohm-bm1390.c index 6cdb2820171a..9c1197f0e742 100644 --- a/drivers/iio/pressure/rohm-bm1390.c +++ b/drivers/iio/pressure/rohm-bm1390.c @@ -139,7 +139,7 @@ enum { struct bm1390_data_buf { u32 pressure; __be16 temp; - s64 ts __aligned(8); + aligned_s64 ts; }; /* BM1390 has FIFO for 4 pressure samples */ From patchwork Sun Dec 15 18:28:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908851 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2981413C8FF for ; Sun, 15 Dec 2024 18:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287390; cv=none; b=UauGWvD9bD7bvdAXXGLdhsM1MZfLo/lt1XJXhiTWgGEeX6JsGAWa+7Xs3DibhpnAt4bOCz7g4BHjLo+ZiR4+pv1Re9F8i+GDTSTMNIglzNhCqaA8QLk7Yk9tY7ePSiTca26Y9YkecuFIe67lRNCWl9HZWriOJJQByb6TRlrXKwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287390; c=relaxed/simple; bh=m+y6w6GIvbKIegYZ22Jc1OL6DhIg6Z/Nd+M51osfJ6Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UKUtyMRsPeRboZd3/Hpk0ACM97FGaizrdd+f4xsqC3YUxPstQwYziP5uQsruU48qhFK2kFGRfjd7LnTMdKDTr+tDj76JZMJV84ESm3OFFLTFexs5urHGsM/KglBj4JWvLE8C0NgtGONmaUApH2/0OqfpdVHOxkXpLcfiu9h7fsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HO9yItQC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HO9yItQC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99D68C4CED3; Sun, 15 Dec 2024 18:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287389; bh=m+y6w6GIvbKIegYZ22Jc1OL6DhIg6Z/Nd+M51osfJ6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HO9yItQCPE+l024lxtTGfWi6yORj2/RBB592+ZyzthEwr6dYRyWrHMxBzhLwSVdcE 5yXUdnNoWCQTo966ayOh4WTnGKV+LSOqJQ0RB/ctpoNIZV3H+ryzRi9ehpSyhYiMKN DDssuiotAZQ6hvLrezznoP7WIPyDNW0aOoigus/bk5sGY116KRrVZN5XhBCdhOCwt+ AeZPzixWZLDKJFqczj1d7YhieWFIMd+5f6IdKXZtJQl4OrXYSENTpEui7VHwQdvvHV kCEjMV7bsnDPq1gUsy+aqOTuSjq6Z+GPefl7QM8/75zvGDnCCDgDXGK5VSYykZo7Cu 4vVlqP4QwtSCA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 07/20] iio: magnetometer: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:28:58 +0000 Message-ID: <20241215182912.481706-8-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/magnetometer/af8133j.c | 2 +- drivers/iio/magnetometer/ak8974.c | 2 +- drivers/iio/magnetometer/ak8975.c | 2 +- drivers/iio/magnetometer/bmc150_magn.c | 2 +- drivers/iio/magnetometer/hmc5843.h | 2 +- drivers/iio/magnetometer/mag3110.c | 2 +- drivers/iio/magnetometer/yamaha-yas530.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/iio/magnetometer/af8133j.c b/drivers/iio/magnetometer/af8133j.c index acd291f3e792..a70bf8a3c73b 100644 --- a/drivers/iio/magnetometer/af8133j.c +++ b/drivers/iio/magnetometer/af8133j.c @@ -360,7 +360,7 @@ static irqreturn_t af8133j_trigger_handler(int irq, void *p) s64 timestamp = iio_get_time_ns(indio_dev); struct { __le16 values[3]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } sample; int ret; diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index 8306a18706ac..08975c60e325 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -197,7 +197,7 @@ struct ak8974 { /* Ensure timestamp is naturally aligned */ struct { __le16 channels[3]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c index 18077fb463a9..ef1363126cc2 100644 --- a/drivers/iio/magnetometer/ak8975.c +++ b/drivers/iio/magnetometer/ak8975.c @@ -426,7 +426,7 @@ struct ak8975_data { /* Ensure natural alignment of timestamp */ struct { s16 channels[3]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index 7f545740178e..88bb673e40d8 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -140,7 +140,7 @@ struct bmc150_magn_data { /* Ensure timestamp is naturally aligned */ struct { s32 chans[3]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; struct iio_trigger *dready_trig; bool dready_trigger_on; diff --git a/drivers/iio/magnetometer/hmc5843.h b/drivers/iio/magnetometer/hmc5843.h index 60fbb5431c88..ffd669b1ee7c 100644 --- a/drivers/iio/magnetometer/hmc5843.h +++ b/drivers/iio/magnetometer/hmc5843.h @@ -44,7 +44,7 @@ struct hmc5843_data { struct iio_mount_matrix orientation; struct { __be16 chans[3]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c index 5295dc0100e4..2fe8e97f2cf8 100644 --- a/drivers/iio/magnetometer/mag3110.c +++ b/drivers/iio/magnetometer/mag3110.c @@ -60,7 +60,7 @@ struct mag3110_data { struct { __be16 channels[3]; u8 temperature; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c index 65011a8598d3..bba9f4d7c90a 100644 --- a/drivers/iio/magnetometer/yamaha-yas530.c +++ b/drivers/iio/magnetometer/yamaha-yas530.c @@ -236,7 +236,7 @@ struct yas5xx { */ struct { s32 channels[4]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; From patchwork Sun Dec 15 18:28:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908852 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A95F713C8FF for ; Sun, 15 Dec 2024 18:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287392; cv=none; b=qRdUOidMhWf9AaO0frVYs6DKr8jT34LFwpUTba9AvtzwgvH4R//f9F7oXse74TlaE/uOqL3qB8ahPVtJ9ZRKZc1Ad6WG9vpfKXF/MEEeoQl2jNV2hDmOXE/hCHF5wHcEtKJ1niqYP/EFXjreqHylA67qMp4LHPFmPm4g88eaa4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287392; c=relaxed/simple; bh=RnWFaqvQpNM8CAPFk2rcMnaC7d6LYv68VRpgYd5lG1I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dTCnQ/z89x99WibwSluJzSOlKE3AAdwUlB6XCXc3CxzSRJC4mSSrnVpUvTu3wEUR/RvWVvg4u1gQUZv5y6vClA8mnPqAxIlFjoIA90wT5HEXHIehRG0lrhVP5lxm6Wyrw8L0V0G4SF/mTngtX5jwqeHyLI+aBLpFTqe3i/BvxQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C5zHw8fA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C5zHw8fA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2803BC4CEDD; Sun, 15 Dec 2024 18:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287392; bh=RnWFaqvQpNM8CAPFk2rcMnaC7d6LYv68VRpgYd5lG1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C5zHw8fAKhB7yqvPa7o2Ds9IvszjwX5FEzhQaZGnL8x0kcaWzKx8wu8/tREXQ+1xa EEiTStTbQWWrS/6X+o45jArlsdzxRq72yR8oYO/3NAiQAxLZHyKt6EVmoZqXKXHkwM fcUe7AeU0c0nfGM4cFhYh6fh3VKjM7QR3IFgE8hnDyQ13AurNI1l3dboNqANbFESsY JN+ia2nxITMca/FIehS8wAPTD240Vh2vT8BibVYBOGzKBetasINT5b7YXApdFwnu0A UURr82it8GuZK2qnFvEbX0g1hUDGecal/p6TnjZ2dysNEMuW+h/DPN2n5i/HXkQN52 yWBOkF5hYda2Q== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 08/20] iio: light: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:28:59 +0000 Message-ID: <20241215182912.481706-9-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron Acked-By: Matti Vaittinen --- drivers/iio/light/adjd_s311.c | 2 +- drivers/iio/light/as73211.c | 2 +- drivers/iio/light/bh1745.c | 2 +- drivers/iio/light/isl29125.c | 2 +- drivers/iio/light/ltr501.c | 2 +- drivers/iio/light/max44000.c | 2 +- drivers/iio/light/rohm-bu27034.c | 2 +- drivers/iio/light/rpr0521.c | 2 +- drivers/iio/light/st_uvis25.h | 2 +- drivers/iio/light/tcs3414.c | 2 +- drivers/iio/light/tcs3472.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/iio/light/adjd_s311.c b/drivers/iio/light/adjd_s311.c index c1b43053fbc7..cf96e3dd8bc6 100644 --- a/drivers/iio/light/adjd_s311.c +++ b/drivers/iio/light/adjd_s311.c @@ -56,7 +56,7 @@ struct adjd_s311_data { struct i2c_client *client; struct { s16 chans[4]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/light/as73211.c b/drivers/iio/light/as73211.c index be0068081ebb..e0d3f05fcfe7 100644 --- a/drivers/iio/light/as73211.c +++ b/drivers/iio/light/as73211.c @@ -636,7 +636,7 @@ static irqreturn_t as73211_trigger_handler(int irq __always_unused, void *p) struct as73211_data *data = iio_priv(indio_dev); struct { __le16 chan[4]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; int data_result, ret; diff --git a/drivers/iio/light/bh1745.c b/drivers/iio/light/bh1745.c index 56e32689bb97..00a33760893e 100644 --- a/drivers/iio/light/bh1745.c +++ b/drivers/iio/light/bh1745.c @@ -739,7 +739,7 @@ static irqreturn_t bh1745_trigger_handler(int interrupt, void *p) struct bh1745_data *data = iio_priv(indio_dev); struct { u16 chans[4]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; u16 value; int ret; diff --git a/drivers/iio/light/isl29125.c b/drivers/iio/light/isl29125.c index b176bf4c884b..326dc39e7929 100644 --- a/drivers/iio/light/isl29125.c +++ b/drivers/iio/light/isl29125.c @@ -54,7 +54,7 @@ struct isl29125_data { /* Ensure timestamp is naturally aligned */ struct { u16 chans[3]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c index 604f5f900a2e..669da0840eba 100644 --- a/drivers/iio/light/ltr501.c +++ b/drivers/iio/light/ltr501.c @@ -1280,7 +1280,7 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p) struct ltr501_data *data = iio_priv(indio_dev); struct { u16 channels[3]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; __le16 als_buf[2]; u8 mask = 0; diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c index b935976871a6..e8b767680133 100644 --- a/drivers/iio/light/max44000.c +++ b/drivers/iio/light/max44000.c @@ -78,7 +78,7 @@ struct max44000_data { /* Ensure naturally aligned timestamp */ struct { u16 channels[2]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/light/rohm-bu27034.c b/drivers/iio/light/rohm-bu27034.c index 5a3515e47871..cc25596cb248 100644 --- a/drivers/iio/light/rohm-bu27034.c +++ b/drivers/iio/light/rohm-bu27034.c @@ -206,7 +206,7 @@ struct bu27034_data { struct { u32 mlux; __le16 channels[BU27034_NUM_HW_DATA_CHANS]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/light/rpr0521.c b/drivers/iio/light/rpr0521.c index 56f5fbbf79ac..2ba917c5c138 100644 --- a/drivers/iio/light/rpr0521.c +++ b/drivers/iio/light/rpr0521.c @@ -203,7 +203,7 @@ struct rpr0521_data { struct { __le16 channels[3]; u8 garbage; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/light/st_uvis25.h b/drivers/iio/light/st_uvis25.h index 283086887caf..1f93e3dc45c2 100644 --- a/drivers/iio/light/st_uvis25.h +++ b/drivers/iio/light/st_uvis25.h @@ -30,7 +30,7 @@ struct st_uvis25_hw { /* Ensure timestamp is naturally aligned */ struct { u8 chan; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/light/tcs3414.c b/drivers/iio/light/tcs3414.c index 4fecdf10aeb1..884e43e4cda4 100644 --- a/drivers/iio/light/tcs3414.c +++ b/drivers/iio/light/tcs3414.c @@ -56,7 +56,7 @@ struct tcs3414_data { /* Ensure timestamp is naturally aligned */ struct { u16 chans[4]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c index 4186aac04902..2bd36a344ea5 100644 --- a/drivers/iio/light/tcs3472.c +++ b/drivers/iio/light/tcs3472.c @@ -67,7 +67,7 @@ struct tcs3472_data { /* Ensure timestamp is naturally aligned */ struct { u16 chans[4]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; From patchwork Sun Dec 15 18:29:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908853 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F5BC13C8FF for ; Sun, 15 Dec 2024 18:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287395; cv=none; b=leV9lh0RgS+moqLzJg0RhgvMWaTOqfW+E8NwwHlv35nsoHo9fXbCCNwJ8AF4fH7C2NhXQxl49OxSlUGc9BZtpdkoFkAFpPRIoGE5tY3ZbGYsGGWbxwhyou4k7ebrcL9p2kEy+s37p6OES19TwLVBDu9HfqzQlbUZs7CmM820oMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287395; c=relaxed/simple; bh=OcKBTEchoSIypF3lOEOIgJC6VVJb2zQtWYnZriN2cGA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cAggphs6TNobl02S15twVoWGkHkxf4FGiDX063bF9AbZZtWCUBtKvc+Mues4Cyo3/q5t+3vobvNQPU2EtGXaJjgDiMnHAEfWb27tKk+9Q4S4jRbk6+ZvPlUCOetoGEl8TDTx+0AhX3tqRDOnhV8AseYYP92DafpzP9W7sp9CKE4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FKc1jYvx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FKc1jYvx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E801CC4CECE; Sun, 15 Dec 2024 18:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287395; bh=OcKBTEchoSIypF3lOEOIgJC6VVJb2zQtWYnZriN2cGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FKc1jYvxUJ/ZN+b0Oq0KUoCNdXjEFk0OqeFPXk1yuY+CJufkdDOnqi4CjDHHCwLms vLB1NDB4Za2wwWYFm9YTlKWPZATjDRQrQ0kDrS52MOOvM5fDev/j+caNwJ1oZRcXaz T9UcVR+O+W94R9QlVLnHoEknTkGHCSPAd3NUA9vOfwJjbV9lNJBff0UCJJMw26Nc25 f/GzZxWep9C8bo5ojqXpzTSM+mDJ1kE7H4eoXlzTLTpq9TfqjEbzQWqQCwBZ3hCGUJ Wr9+0vJG9vCDuhb5NHw7OJCZmFI+P9+hRblVA6QS9rrxCsXZjoXqqtOnbCg7AB+Tco WeCqwPV+4VFug== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 09/20] iio: imu: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:29:00 +0000 Message-ID: <20241215182912.481706-10-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/imu/bmi323/bmi323_core.c | 2 +- drivers/iio/imu/bno055/bno055.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/bmi323/bmi323_core.c b/drivers/iio/imu/bmi323/bmi323_core.c index f7d7f4442e65..7f386c5e58b4 100644 --- a/drivers/iio/imu/bmi323/bmi323_core.c +++ b/drivers/iio/imu/bmi323/bmi323_core.c @@ -174,7 +174,7 @@ struct bmi323_data { __le16 fifo_buff[BMI323_FIFO_FULL_IN_WORDS] __aligned(IIO_DMA_MINALIGN); struct { __le16 channels[BMI323_CHAN_MAX]; - s64 ts __aligned(8); + aligned_s64 ts; } buffer; __le16 steps_count[BMI323_STEP_LEN]; }; diff --git a/drivers/iio/imu/bno055/bno055.c b/drivers/iio/imu/bno055/bno055.c index 0728d38260a1..f5c43666609d 100644 --- a/drivers/iio/imu/bno055/bno055.c +++ b/drivers/iio/imu/bno055/bno055.c @@ -207,7 +207,7 @@ struct bno055_priv { bool sw_reset; struct { __le16 chans[BNO055_SCAN_CH_COUNT]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } buf; struct dentry *debugfs; }; From patchwork Sun Dec 15 18:29:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908854 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFD7E13C8FF for ; Sun, 15 Dec 2024 18:29:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287397; cv=none; b=dsSanyNBVMgv6y0XzeOAy1XQ/qIx9gQHsSm5/fIHbkRtMfFJLq4Ut1U2C1B2gSbCahXgLZGC8getJ/6Ua9ddzLt8kXhanYBX2Bndvx/m2dGzQqcEEfhwE5wkmOJpd6QxBi3q4kox0HFBbEh5KdSPz4rEG4Zy1cG4s0Z3Z9sOuaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287397; c=relaxed/simple; bh=vZ7RtmPjO+69JDsB3tMd56qNwKSELBqWtBa7mASr2BI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ImG8bvm+zNKMZOjhBc2BwuhluqsNHh8yt2tBOJ/eLd83P7Tv8V53yulNpDBYZmjkkD+iDyLzPCH+y8vvoSbyN8L6/vMC7kbv3Ew0I4qhL4xavG1NOEVVDNbi5WMi+qmV+TzbjTntMXve4jlzp2qVW59k/qQpZNiWV6vjeZMMTRs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ebA3B3Gu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ebA3B3Gu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74C55C4CED3; Sun, 15 Dec 2024 18:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287396; bh=vZ7RtmPjO+69JDsB3tMd56qNwKSELBqWtBa7mASr2BI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ebA3B3Gutd9XqPnZVWtnTqiLkxxoViMrq2iBRSh3Ps8L2oyKqTLOwMVPe75NfAwHe dNqh8B1B0i3WgHZw74OOie1Ovri49cdlMWKCjG4om+kxga8HSgZPgDfKUNPGT5BHfp p/Lt/1vOFfngjzMgK069dZoW10oR6eOVTPxD/iuDfKMXINCHixSvSJbwqEL2CIyXns d2xfd7y4v6lEFMrvdEKT//WfFdtAUOTR5WbaZI8XjDVsbg2lQi2MB+V+++kfiivdys 3w0BqVTHPbYSyIsNGq/PsR0n3YEDFYiD6x4tzqx8doee0MsQboe1yoJuXMWSw0AekM P5XCW3nTfQcig== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 10/20] iio: humidity: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:29:01 +0000 Message-ID: <20241215182912.481706-11-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/humidity/am2315.c | 2 +- drivers/iio/humidity/hdc100x.c | 2 +- drivers/iio/humidity/hts221.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/humidity/am2315.c b/drivers/iio/humidity/am2315.c index 6b0aa3a3f025..2323974b805c 100644 --- a/drivers/iio/humidity/am2315.c +++ b/drivers/iio/humidity/am2315.c @@ -35,7 +35,7 @@ struct am2315_data { /* Ensure timestamp is naturally aligned */ struct { s16 chans[2]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c index 9b355380c9bf..a303f704b7ed 100644 --- a/drivers/iio/humidity/hdc100x.c +++ b/drivers/iio/humidity/hdc100x.c @@ -44,7 +44,7 @@ struct hdc100x_data { /* Ensure natural alignment of timestamp */ struct { __be16 channels[2]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/humidity/hts221.h b/drivers/iio/humidity/hts221.h index 721359e226cb..0215f11fc35e 100644 --- a/drivers/iio/humidity/hts221.h +++ b/drivers/iio/humidity/hts221.h @@ -40,7 +40,7 @@ struct hts221_hw { /* Ensure natural alignment of timestamp */ struct { __le16 channels[2]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; From patchwork Sun Dec 15 18:29:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908855 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F63013C8FF for ; Sun, 15 Dec 2024 18:30:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287400; cv=none; b=fbBm/d/ZK+TsmbRoGz34C9FUNdoc3HRH2xYD8tgTb4laFSots4//WxPi8/LJ1c9u+r0QdqYHjKHvPVNfAtQDrfzAkUJ5EPtQAyvjc8iNP09GDw6Eh3wRmFIaxdRhT/UsAlAhX259B2Elxi8CJdwcMaZCK/C20BAX+6Z5X8TsCeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287400; c=relaxed/simple; bh=LhETy10JQBo3cEySUrTFG8l8CIbO3yNgAUzDxGtc02g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TwRPjKl3Wo+zukqEqC3kVBAs2lWLX9XXwwgiCN99QuCVDF3l+zkZMjkKTX+xfZmWPr4IOQLm/PkXNYuNfEHVUylHFVsClYyyPPZENeMbBJ8yLtsD0todcjTPlkEiZRNhvkN2lQNuAFCA90DRBN3HdcJgAc8LVLyW7nQ0bNu4C+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eq9SxiBN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eq9SxiBN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88353C4CECE; Sun, 15 Dec 2024 18:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287400; bh=LhETy10JQBo3cEySUrTFG8l8CIbO3yNgAUzDxGtc02g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eq9SxiBNcYMYZ5KCHBL39EtiJmCoNzF5weWt0WA0duezWF/jYK1h9SUO+zX5akAyI 1JYdE0AEhDN0iZTh3+3WbjuOMoPLyEmbTc0FVRlyBp7V+EDP7bRDOgq2v0VEmTRjrI phaohiLZ38P4UzrKZdztjAmHE49sNFvxrAMD2E48H5+Zgaar8sZrVucknezOqUT1Gl zJ5zZI9PHsGA4Es7E81IrcCncE5MeSQ9VxZtiIBgvu+n4plsErRJGd0NVtn+GG7P+/ B/oL2KQtcHVdtlB/TVfzyVtp3IDckxDyuO9X9vhOgfcyidm9LmT8QLTMZu09QB8aTv BxEsQe+0aaCGA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 11/20] iio: gyro: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:29:02 +0000 Message-ID: <20241215182912.481706-12-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/gyro/adxrs290.c | 2 +- drivers/iio/gyro/bmg160_core.c | 2 +- drivers/iio/gyro/itg3200_buffer.c | 2 +- drivers/iio/gyro/mpu3050-core.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/gyro/adxrs290.c b/drivers/iio/gyro/adxrs290.c index 600e9725da78..223fc181109c 100644 --- a/drivers/iio/gyro/adxrs290.c +++ b/drivers/iio/gyro/adxrs290.c @@ -75,7 +75,7 @@ struct adxrs290_state { /* Ensure correct alignment of timestamp when present */ struct { s16 channels[3]; - s64 ts __aligned(8); + aligned_s64 ts; } buffer; }; diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c index ba877d067afb..deb3c6459dde 100644 --- a/drivers/iio/gyro/bmg160_core.c +++ b/drivers/iio/gyro/bmg160_core.c @@ -99,7 +99,7 @@ struct bmg160_data { /* Ensure naturally aligned timestamp */ struct { s16 chans[3]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; u32 dps_range; int ev_enable_state; diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c index 4cfa0d439560..a624400a239c 100644 --- a/drivers/iio/gyro/itg3200_buffer.c +++ b/drivers/iio/gyro/itg3200_buffer.c @@ -52,7 +52,7 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p) */ struct { __be16 buf[ITG3200_SCAN_ELEMENTS]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; int ret = itg3200_read_all_channels(st->i2c, scan.buf); diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c index b6883e8b2a8b..d66224bed8e3 100644 --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -474,7 +474,7 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) int ret; struct { __be16 chans[4]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; s64 timestamp; unsigned int datums_from_fifo = 0; From patchwork Sun Dec 15 18:29:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908856 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B6601B6D1B for ; Sun, 15 Dec 2024 18:30:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287402; cv=none; b=JfP3/W3DMHWu1u7iGZ0ljINcCKJdi9KR/wnnkhM9BiieC5bkprPWGkWpLjf1Kt4F4RdYSWbUH5dLumMtV/iGxKwwnzZH8kC0NifHsile6sslIAYvPSvAN7l1+OkC+6Piffz8jhx8b49dloQOedJxWoNiCTJdi/F6J3fshbTuXPY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287402; c=relaxed/simple; bh=JoGWBtbWZbHBiA651Caqi7N3fAt5Jfd75roAxvAVrK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cZmHV1ZGvgk4i3U33QsDPvmLvDhNdLdK1z+t5vpImtu/+JOxe2Bnwa64XnaqT5SwI45wUZ0L+gGqR7RQkc0kiL8PX/Kp89irZFgCIgNP+Y+lBjlxDK632hhUXviPUzJR1XZ8J183zmjS/QxxU27WtVkCUFPsg6g/EW3pSdpq2Hw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oxz8SLFS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oxz8SLFS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 985C3C4CED3; Sun, 15 Dec 2024 18:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287402; bh=JoGWBtbWZbHBiA651Caqi7N3fAt5Jfd75roAxvAVrK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oxz8SLFSfRE1u9SDLgQiMVvwY+5I2VwCPB/l2p/Sq2SAz5iEeukWltzOOQELUE6N7 jA0W9PhA9Yh79rlcOX9g2syEDvsBns6+AiBgoOfxsbXoj7mCLjy6WM6QoHRgptBLN3 6fEY8VTBKTZ4avtGVIS92B+7NsYVm8G+zXAIBqzq+Pds2UkMtNbeFyoL+i3yXMXTNL ZCi7bcNUm9YvdgamoxMZ4vamWjg0k/FAr84jJNx0nVyNR0fxw8eDJvfL0e2KGihWIJ SRCOnCMc3VcxolfFoFOSIC0yPjV3vY1WzjUIs9AbAzYTH5VkZJgOpdJuhfKHnyEHdt MDq1aZCAGT9zA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 12/20] iio: chemical: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:29:03 +0000 Message-ID: <20241215182912.481706-13-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/chemical/ccs811.c | 2 +- drivers/iio/chemical/ens160_core.c | 2 +- drivers/iio/chemical/scd30_core.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/chemical/ccs811.c b/drivers/iio/chemical/ccs811.c index 17d1bc518bf2..451fb65dbe60 100644 --- a/drivers/iio/chemical/ccs811.c +++ b/drivers/iio/chemical/ccs811.c @@ -81,7 +81,7 @@ struct ccs811_data { /* Ensures correct alignment of timestamp if present */ struct { s16 channels[2]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/chemical/ens160_core.c b/drivers/iio/chemical/ens160_core.c index 4a89cd5894d9..48d5ad2075b6 100644 --- a/drivers/iio/chemical/ens160_core.c +++ b/drivers/iio/chemical/ens160_core.c @@ -60,7 +60,7 @@ struct ens160_data { struct mutex mutex; struct { __le16 chans[2]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan __aligned(IIO_DMA_MINALIGN); u8 fw_version[3]; __le16 buf; diff --git a/drivers/iio/chemical/scd30_core.c b/drivers/iio/chemical/scd30_core.c index ac3080929f0b..d613c54cb28d 100644 --- a/drivers/iio/chemical/scd30_core.c +++ b/drivers/iio/chemical/scd30_core.c @@ -594,7 +594,7 @@ static irqreturn_t scd30_trigger_handler(int irq, void *p) struct scd30_state *state = iio_priv(indio_dev); struct { int data[SCD30_MEAS_COUNT]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; int ret; From patchwork Sun Dec 15 18:29:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908857 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 037AD1B4156 for ; Sun, 15 Dec 2024 18:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287405; cv=none; b=jfQFGbOWGmRXPAwWENaz+NfjbOVqx1LGeTVx1GQbPZ1MOilxDvJJkYCoLvAI3+G4to1xuBXHEECV4FUTHgms94pTbe8SxXCuFQ0K2ZKwFtuA5xY9Ol0lGmfnkeQtPqbyVp2eqNbAgMRA5WZGuTIpniJBDUVlpJGRi6ZGt+aGzqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287405; c=relaxed/simple; bh=Tz2kIHXNsR7NLtjotoHtDO1LS6m1woxE6fmK93UoYXo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PZAUU0PjH9NraXghEcMHXJ6LegrY9D+eTV/ZhNc8ImrmQWqhtzBNdG5lRvI6uNW6u3dThACxc5K5zp+uSOVPnTL0EbRjaLlc1fivI9yZdkTVYxm/qFUEShzvSQJnKY9jE0IhqTy6K2ELrjXlee2NueXmwA62kNDZZ9yQvRZ4GBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=njLiJmUi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="njLiJmUi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D5CC4CECE; Sun, 15 Dec 2024 18:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287404; bh=Tz2kIHXNsR7NLtjotoHtDO1LS6m1woxE6fmK93UoYXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=njLiJmUisl8BYS3NgAZfrCjwMVIoZxDuETMT7R2TYwaoyECJP3CsDoO0YL/K3toDw Os3BA1VOG0gacWO12UyVncG+1mRz1w2ZwCn7nycBthl6+6tIBPPpsjEdz9UYdqS1k7 v0rZWx6tN2UW7VentIfotZnka3I5ez5PWYWtJVilCFJviXB2NYH3L4aebCFjABn5ic jZVBvgCyzUbChFxbUYh9rhcRQ2acpksaSq5ToyS7Zi5nTO/UyHuLqi5MGNe2sQh1vJ JAKlXkdBmda4IKBZvqF4G9H0sewgVlHBafdTjxz+UYjZu0pXGgb8ubEYmo4ZjWLMK0 IergUF/oLPMAQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 13/20] iio: adc: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:29:04 +0000 Message-ID: <20241215182912.481706-14-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron Acked-by: Marcelo Schmitt --- drivers/iio/adc/ad4000.c | 2 +- drivers/iio/adc/max1118.c | 2 +- drivers/iio/adc/max11410.c | 2 +- drivers/iio/adc/mcp3911.c | 2 +- drivers/iio/adc/pac1921.c | 2 +- drivers/iio/adc/rtq6056.c | 2 +- drivers/iio/adc/ti-adc081c.c | 2 +- drivers/iio/adc/ti-adc084s021.c | 2 +- drivers/iio/adc/ti-ads1015.c | 2 +- drivers/iio/adc/ti-ads1119.c | 2 +- drivers/iio/adc/ti-ads131e08.c | 2 +- drivers/iio/adc/ti-tsc2046.c | 2 +- drivers/iio/adc/vf610_adc.c | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/iio/adc/ad4000.c b/drivers/iio/adc/ad4000.c index c6149a855af3..1d556a842a68 100644 --- a/drivers/iio/adc/ad4000.c +++ b/drivers/iio/adc/ad4000.c @@ -414,7 +414,7 @@ struct ad4000_state { __be16 sample_buf16; __be32 sample_buf32; } data; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan __aligned(IIO_DMA_MINALIGN); u8 tx_buf[2]; u8 rx_buf[2]; diff --git a/drivers/iio/adc/max1118.c b/drivers/iio/adc/max1118.c index 3d0a7d0eb7ee..565ca2e21c0c 100644 --- a/drivers/iio/adc/max1118.c +++ b/drivers/iio/adc/max1118.c @@ -39,7 +39,7 @@ struct max1118 { /* Ensure natural alignment of buffer elements */ struct { u8 channels[2]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; u8 data __aligned(IIO_DMA_MINALIGN); diff --git a/drivers/iio/adc/max11410.c b/drivers/iio/adc/max11410.c index f0dc4b460903..76abafd47404 100644 --- a/drivers/iio/adc/max11410.c +++ b/drivers/iio/adc/max11410.c @@ -143,7 +143,7 @@ struct max11410_state { int irq; struct { u32 data __aligned(IIO_DMA_MINALIGN); - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c index b097f04172c8..6748b44d568d 100644 --- a/drivers/iio/adc/mcp3911.c +++ b/drivers/iio/adc/mcp3911.c @@ -122,7 +122,7 @@ struct mcp3911 { const struct mcp3911_chip_info *chip; struct { u32 channels[MCP39XX_MAX_NUM_CHANNELS]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; u8 tx_buf __aligned(IIO_DMA_MINALIGN); diff --git a/drivers/iio/adc/pac1921.c b/drivers/iio/adc/pac1921.c index 9f7b3d58549d..90f61c47b1c4 100644 --- a/drivers/iio/adc/pac1921.c +++ b/drivers/iio/adc/pac1921.c @@ -209,7 +209,7 @@ struct pac1921_priv { struct { u16 chan[PAC1921_NUM_MEAS_CHANS]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; diff --git a/drivers/iio/adc/rtq6056.c b/drivers/iio/adc/rtq6056.c index 56ed948a8ae1..337bc8b31b2c 100644 --- a/drivers/iio/adc/rtq6056.c +++ b/drivers/iio/adc/rtq6056.c @@ -634,7 +634,7 @@ static irqreturn_t rtq6056_buffer_trigger_handler(int irq, void *p) struct device *dev = priv->dev; struct { u16 vals[RTQ6056_MAX_CHANNEL]; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } data; unsigned int raw; int i = 0, bit, ret; diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c index 6c2cb3dabbbf..1af9be071d8d 100644 --- a/drivers/iio/adc/ti-adc081c.c +++ b/drivers/iio/adc/ti-adc081c.c @@ -37,7 +37,7 @@ struct adc081c { /* Ensure natural alignment of buffer elements */ struct { u16 channel; - s64 ts __aligned(8); + aligned_s64 ts; } scan; }; diff --git a/drivers/iio/adc/ti-adc084s021.c b/drivers/iio/adc/ti-adc084s021.c index bf98f9bf942a..da16876c32ae 100644 --- a/drivers/iio/adc/ti-adc084s021.c +++ b/drivers/iio/adc/ti-adc084s021.c @@ -29,7 +29,7 @@ struct adc084s021 { /* Buffer used to align data */ struct { __be16 channels[4]; - s64 ts __aligned(8); + aligned_s64 ts; } scan; /* * DMA (thus cache coherency maintenance) may require the diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c index 47fe8e16aee4..4355726b373a 100644 --- a/drivers/iio/adc/ti-ads1015.c +++ b/drivers/iio/adc/ti-ads1015.c @@ -448,7 +448,7 @@ static irqreturn_t ads1015_trigger_handler(int irq, void *p) /* Ensure natural alignment of timestamp */ struct { s16 chan; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; int chan, ret, res; diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c index e9d9d4d46d38..0a68ecdea4e6 100644 --- a/drivers/iio/adc/ti-ads1119.c +++ b/drivers/iio/adc/ti-ads1119.c @@ -501,7 +501,7 @@ static irqreturn_t ads1119_trigger_handler(int irq, void *private) struct ads1119_state *st = iio_priv(indio_dev); struct { unsigned int sample; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; unsigned int index; int ret; diff --git a/drivers/iio/adc/ti-ads131e08.c b/drivers/iio/adc/ti-ads131e08.c index 31f1f229d97a..91a79ebc4bde 100644 --- a/drivers/iio/adc/ti-ads131e08.c +++ b/drivers/iio/adc/ti-ads131e08.c @@ -102,7 +102,7 @@ struct ads131e08_state { struct completion completion; struct { u8 data[ADS131E08_NUM_DATA_BYTES_MAX]; - s64 ts __aligned(8); + aligned_s64 ts; } tmp_buf; u8 tx_buf[3] __aligned(IIO_DMA_MINALIGN); diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c index b56f2503f14c..7dde5713973f 100644 --- a/drivers/iio/adc/ti-tsc2046.c +++ b/drivers/iio/adc/ti-tsc2046.c @@ -157,7 +157,7 @@ struct tsc2046_adc_priv { /* Scan data for each channel */ u16 data[TI_TSC2046_MAX_CHAN]; /* Timestamp */ - s64 ts __aligned(8); + aligned_s64 ts; } scan_buf; /* diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index 61bba39f7e93..513365d42aa5 100644 --- a/drivers/iio/adc/vf610_adc.c +++ b/drivers/iio/adc/vf610_adc.c @@ -173,7 +173,7 @@ struct vf610_adc { /* Ensure the timestamp is naturally aligned */ struct { u16 chan; - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; }; From patchwork Sun Dec 15 18:29:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908858 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3B471B87C9 for ; Sun, 15 Dec 2024 18:30:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287408; cv=none; b=XyI2JgUbC9wHCETtqno04VMcYMPtqh4gTbD57WvKlCqHDd7AYy/BGFjvF4dElpWEjd7o7yJonDrKDX/R6EDZPb/1gL2lASjdQtUZUr9ZtgTWg+lwxZSDvsuf1uGczoJsBbaxHJbYtnGP6WPloW6AX6NCNFwGF+caFgCVxNNpizw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287408; c=relaxed/simple; bh=lHp0QJc48vtV03JO4iJTHOaa4JdkmrAuMvy+bWJyd/A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MPYn4NYXI/U+Odbq5IfUPn3Elz+IFbg5fxeQqPspbxr7bJxgq2bRS4rc5PKC32jI3bD85jaBc2CcP7qXUOMWfgUIhyRT9Ct5qEIMp/LS0DExdjz2EQO5FPbf88xJtuvdLLqSf44aZXlunYv/hUmc2lamKNSGyafwO6uOxmfyyN0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h5r1TWiG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h5r1TWiG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E074C4CECE; Sun, 15 Dec 2024 18:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287407; bh=lHp0QJc48vtV03JO4iJTHOaa4JdkmrAuMvy+bWJyd/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h5r1TWiGFE0kzoe+X7Tk8yA2q+OqroPOLUFvYtlvDmLY4hvTmoZjArZezGdA9NGjp lt5APqd7X8+1aIyeoiu7gyv0vUQuM+3vFzocYswTty6auPOMZpxi5I1eKvrI4cbJT9 xvr3iKUUbfJMnNbDwd3qPVirzR4yTMb0QFdWSnPCnEm92PVdCU+bPnAVnMK3DCHMdA F8W+DmlEkhpYSTxtXt1evRlWcFBb8LJd776xxsHH+S3YKpvzjy8A2d33dfnsWnwO/b i6UjtprWTdtlhs/N316daQzkikOzUDuYz2weG6DQ4cBa2RFLffDC/cwCAjYWtdsLzn jJph6iwTfR0XA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 14/20] iio: accel: bma220: Use aligned_s64 instead of open coding alignment. Date: Sun, 15 Dec 2024 18:29:05 +0000 Message-ID: <20241215182912.481706-15-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron Use this new type to both slightly simplify the code and avoid confusing static analysis tools. Mostly this series is about consistency to avoid this code pattern getting copied into more drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/accel/bma220_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index 009e6243c6cb..96ba028157ee 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -66,7 +66,7 @@ struct bma220_data { struct { s8 chans[3]; /* Ensure timestamp is naturally aligned. */ - s64 timestamp __aligned(8); + aligned_s64 timestamp; } scan; u8 tx_buf[2] __aligned(IIO_DMA_MINALIGN); }; From patchwork Sun Dec 15 18:29:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908859 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8720A1B81C1 for ; Sun, 15 Dec 2024 18:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287410; cv=none; b=j6maxsHlgyE2YFscLF4beGjIDmZeFYZcAD1jib7tm48oTj3hHElKuisRSwd3La57HNeQi3ENVFRhrnW55n97dYwXZo++8eYTs8WvdpUMcjMR5Qg5CppOOGGuXgbUnbqwCPDhDLzGOkHIHX05sV6PSxZatvJ6aNnjNQFyjVq3uYE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287410; c=relaxed/simple; bh=5PrNw/Y/zmvWCTV4BWaNgwfR6d4W7+Xf24j91EFCgN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Sy+uD+V/g6UTQnNyFXrfukXNcb5xtfanJKBPf1CkhRXkSzudnQH98tPUTe9xlRHzPN/zxfbm2QGyUQkLY8YezDSKcd9augVHVVl1oRJJ92KYOIgVgHCreTDtb/Twz7wZhkr2QFgj7+scGVYOcKz131M2j4MnHGFSkDokGcqZd5w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lSqH/IAy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lSqH/IAy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FBE4C4CED3; Sun, 15 Dec 2024 18:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287410; bh=5PrNw/Y/zmvWCTV4BWaNgwfR6d4W7+Xf24j91EFCgN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lSqH/IAyzLdCGglsfRGW4n/2BjeVcKXFz0lNH5IRTi+lD8OjjDH3Yc2UPg+Prp0CB vrBuop5UYGq+XbrCmTRqPMwIOt95XiE+A2UD9Fp0oWkN4dKDSzEHDa/Z1dP3dvfDKc xVDLnjIDqmm7eNuqHbts+DVX1DHC3hVApGMUUfyVwc0yKEuSmlJhVNSHTzEjG9y1fR chaJvm9k+V2YzLtOLeZPrbZCIYlQVI2Ya9TWrSrXZmPnERLS0SMHM1AsjDn4B/mr+W VlFAfV8673PFbbHzXwIjBzUBYPkdLQ8oMj9TbLNmbzdsP1F9wVZ63CkOds/+/UJcPW J5VxaBWtLo/EA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 15/20] iio: buffer: Make timestamp s64 in iio_push_to_buffers_with_timestamp() Date: Sun, 15 Dec 2024 18:29:06 +0000 Message-ID: <20241215182912.481706-16-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron This is a bit of a corner case for selecting between the in kernel types and standard c integer types we tend to prefer for userspace interfaces. The interface is entirely within the kernel but in many cases the data ultimately ends up in userspace (via some time in a kfifo). On balance the value passed is almost always an s64, so standardize on that. Main reason to change this is that it has led to some inconsistency in the storage type used. The majority use aligned_s64 rather than int64_t __aligned(8) and this will ensure there is one obvious choice. Signed-off-by: Jonathan Cameron --- include/linux/iio/buffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h index 418b1307d3f2..88699a341669 100644 --- a/include/linux/iio/buffer.h +++ b/include/linux/iio/buffer.h @@ -35,11 +35,11 @@ int iio_pop_from_buffer(struct iio_buffer *buffer, void *data); * Returns 0 on success, a negative error code otherwise. */ static inline int iio_push_to_buffers_with_timestamp(struct iio_dev *indio_dev, - void *data, int64_t timestamp) + void *data, s64 timestamp) { if (indio_dev->scan_timestamp) { - size_t ts_offset = indio_dev->scan_bytes / sizeof(int64_t) - 1; - ((int64_t *)data)[ts_offset] = timestamp; + size_t ts_offset = indio_dev->scan_bytes / sizeof(s64) - 1; + ((s64 *)data)[ts_offset] = timestamp; } return iio_push_to_buffers(indio_dev, data); From patchwork Sun Dec 15 18:29:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908860 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 079971B6D1A for ; Sun, 15 Dec 2024 18:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287413; cv=none; b=ltFVJMdVrUPqlRCQ0Z7sv6n063ZwXptLxMzcf01BkjXfvtXjefCsIP8DvaCFGZRQRYeUmL8PxNTpkrYJMG3J24jo3I/rXLnLiV+0Fq6yyieJGhfxfe9Eur56YEmBRgx9J9/X1esgX+7SjTX5yuz5TdFCzocJl9u4zsTDdIDsUnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287413; c=relaxed/simple; bh=PDHdQLnWj/WLnDwPCZayZMmmjXMdt0ZGc+n50t9Oh30=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BEPxA+657ldRaP0EHFgQBJNRAHVhJ41ZrWDGVYT84T4oDOcCK/2tE6a7XlAllCmhdOAKEGOSNaCh1GPY+K6nkK1IydHxvJZl1C5Yf50p9dyLqS/ACM7270Q/ZvrpU0BKKTAKiT1xvBwS5H6bEop1IzyZ55MA4oqfEPPVa6ZdKW4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Hq3NceQD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Hq3NceQD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1032C4CECE; Sun, 15 Dec 2024 18:30:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287412; bh=PDHdQLnWj/WLnDwPCZayZMmmjXMdt0ZGc+n50t9Oh30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hq3NceQD5X3mhba/732gAorGYzv1Vbh7/6tL1jiyfBbrbJObLWV0okfBYMGg9xskO +ZkBE+E9llkHnLfVaGCsczguAJQq9AHKWbRL4XN7ogy7Z+XM0BVf/r/2d1PQZy4DBV 0GoTdt/FxMCQbLrgu/3hVhI8DBV9hFIdDc6+LlbuMDBIUvM4PL1Sk2KXVEo1eTO2qi BFryJ/RLHv/0k4QllWT4Bgs+5092O6SxC/mvLjEGQQdCncFdpowEnkDUKlRVgIZN6J iTgM50/TZLFGmk/UA7Dg4jwsBLAacKIjJyOm++w+i5hUiT4baBm8uujvSnUkKjTeqg mYDysxGa1J3vQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 16/20] iio: adc: ti-lmp92064: Switch timestamp type from int64_t __aligned(8) to aligned_s64 Date: Sun, 15 Dec 2024 18:29:07 +0000 Message-ID: <20241215182912.481706-17-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron The vast majority of IIO drivers use aligned_s64 for the type of the timestamp field. It is not a bug to use int64_t and until this series iio_push_to_buffers_with_timestamp() took and int64_t timestamp, it is inconsistent. This change is to remove that inconsistency and ensure there is one obvious choice for future drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ti-lmp92064.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti-lmp92064.c b/drivers/iio/adc/ti-lmp92064.c index 169e3591320b..1e4a78677fe5 100644 --- a/drivers/iio/adc/ti-lmp92064.c +++ b/drivers/iio/adc/ti-lmp92064.c @@ -199,7 +199,7 @@ static irqreturn_t lmp92064_trigger_handler(int irq, void *p) struct lmp92064_adc_priv *priv = iio_priv(indio_dev); struct { u16 values[2]; - int64_t timestamp __aligned(8); + aligned_s64 timestamp; } data; int ret; From patchwork Sun Dec 15 18:29:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908861 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB742149C41 for ; Sun, 15 Dec 2024 18:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287415; cv=none; b=imfEqYJQBIEP3fGGI3uCUXck7pifxB+ZJyBU3Pm+uncATbDL6Sdxc1nT4ihnADFwdup5lFeUHUOATxjkGQHdX30SLAEO0TZtM2lWWA9vQbcT8g7nhTJAZbWr2XDZ9paEHxmPWOjH617A0PDrm98OQtuq3TCYN0cJAo0HJ6RuEfQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287415; c=relaxed/simple; bh=QfoBBvHQQB5OnC+N5aALu+RsqgzPQLZkx8KwEB82kTY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WXEqgF4dQp46Ees7saMAvrtvdN2jBSxHsV83ECXmAVQkmMCBQRsOF8ijZ0blWBDoSiWmY5bG7ySQ1W6NN9nkYnuKc6uxJ/BKL9qB+3wPkfOyu+r8C1DMRh5uWfN40IaL1yc5eXb8bV1ADEay/jD7cnZPDQ9Ue2ISUBlWtQLmwMI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KyPhiDXI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KyPhiDXI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B3EAC4CECE; Sun, 15 Dec 2024 18:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287415; bh=QfoBBvHQQB5OnC+N5aALu+RsqgzPQLZkx8KwEB82kTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KyPhiDXI+ADzR17nDGv3pfk7iK4SyCznxPI8TUtVRAKlWB5V1LALuNHDMqmjo6mgY clfgFqZlY8I14nqPNGNaYQ7Mj3TfHmT01MQvNK/YEHWSeizxL1gKcuPMI/l8JZCjBN vy3Cf35OdqMfX9dcz0FbK3z0ZW+ljCz3VRr2qV7Bljc2nQWvOVPOJGU+KxkH0Bqa0D UVST3clcYnBC2CovHpEecJD/jR9oNOtdfh7o/h0WKvzhOQE5+YSllfCjeUlGluaXS6 wzw+a0eVJBkaae9z8vYcZrWx00+xpRmMOZ8x2z9DVlUb0wsBbqpHbD7foBxlDpKQtv UIlJg4aTi6q5g== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 17/20] iio: chemical: scd4x: switch timestamp type from int64_t __aligned(8) to aligned_s64 Date: Sun, 15 Dec 2024 18:29:08 +0000 Message-ID: <20241215182912.481706-18-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron The vast majority of IIO drivers use aligned_s64 for the type of the timestamp field. It is not a bug to use int64_t and until this series iio_push_to_buffers_with_timestamp() took and int64_t timestamp, it is inconsistent. This change is to remove that inconsistency and ensure there is one obvious choice for future drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/chemical/scd4x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/chemical/scd4x.c b/drivers/iio/chemical/scd4x.c index 52cad54e8572..50e3ac44422b 100644 --- a/drivers/iio/chemical/scd4x.c +++ b/drivers/iio/chemical/scd4x.c @@ -665,7 +665,7 @@ static irqreturn_t scd4x_trigger_handler(int irq, void *p) struct scd4x_state *state = iio_priv(indio_dev); struct { uint16_t data[3]; - int64_t ts __aligned(8); + aligned_s64 ts; } scan; int ret; From patchwork Sun Dec 15 18:29:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908862 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D48B0191461 for ; Sun, 15 Dec 2024 18:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287418; cv=none; b=NeEk0zaqLlDJ6PMkclRlf96e59yE+X/7LmrhB8z2IzmGNLa+Jfcu4Z3vMvipl3Gt7fcyk+C0ZV1kL2QQoMdGcYe2acFnGLxh8k7RevUHJiObLI0SdF0OoHBJXC1tqr3IhI8k2rjr4SMa7We8VERUYiLwBz7U3fjcoli649+YoxY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287418; c=relaxed/simple; bh=a4p6HEQC5fDWXHkQFSRalHiulrtIRFusvcYmrHnSD8o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NZWb3j0Iv6VxNm9VqqzdE1HCsIEg6PP5mwVx+W3oa1OL+Z4AZlFTo/ArMH4ZaYIsBkfU+RvYuvaSy1M5nIee+/3oMigr0iNXkbwwh8kAarBfwGd0HIEKltYlK2bhXEyQRRRZxjxwaj4j2Q9LCyu77tg7eh64BGPJ45OjFRyAUd0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O8ODDzUg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O8ODDzUg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49843C4CECE; Sun, 15 Dec 2024 18:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287418; bh=a4p6HEQC5fDWXHkQFSRalHiulrtIRFusvcYmrHnSD8o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O8ODDzUgJmX0XZe32tSdimRN6PwOidKfmBPVcPfjDQgzFIl4Niad35phjPflEgumi vbUautZYnMl2R4Koytq7/x5uoNYNVfUyM0/w6Ix6qXgPryGs0jtZ2FF4jVovz32upl u6hNem+r0wl6QyEKpcTYQoX7/r4LdqxcWIvnV2L2lQRJKb26Qpnwq9cwjuncX28xd+ 2d+wDW+zyB06moLUtzvB46Hj2AgMurcD4jOGdS8w8z8/HPrmpBzEIfKxu0P58hNOhI SdkR7Wykm2RhlQIn8H+IEE1t1Ka5dp5k2WfYSyWffJelwv+GBPL+XIWxzfPLJ5yDFx ZVy927k+Op2SQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 18/20] iio: imu: inv_icm42600: switch timestamp type from int64_t __aligned(8) to aligned_s64 Date: Sun, 15 Dec 2024 18:29:09 +0000 Message-ID: <20241215182912.481706-19-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron The vast majority of IIO drivers use aligned_s64 for the type of the timestamp field. It is not a bug to use int64_t and until this series iio_push_to_buffers_with_timestamp() took and int64_t timestamp, it is inconsistent. This change is to remove that inconsistency and ensure there is one obvious choice for future drivers. Signed-off-by: Jonathan Cameron Acked-by: Jean-Baptiste Maneyrol --- drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +- drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c index 7968aa27f9fd..388520ec60b5 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c @@ -178,7 +178,7 @@ static const struct iio_chan_spec inv_icm42600_accel_channels[] = { struct inv_icm42600_accel_buffer { struct inv_icm42600_fifo_sensor_data accel; int16_t temp; - int64_t timestamp __aligned(8); + aligned_s64 timestamp; }; #define INV_ICM42600_SCAN_MASK_ACCEL_3AXIS \ diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c index c6bb68bf5e14..591ed78a55bb 100644 --- a/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c +++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c @@ -78,7 +78,7 @@ static const struct iio_chan_spec inv_icm42600_gyro_channels[] = { struct inv_icm42600_gyro_buffer { struct inv_icm42600_fifo_sensor_data gyro; int16_t temp; - int64_t timestamp __aligned(8); + aligned_s64 timestamp; }; #define INV_ICM42600_SCAN_MASK_GYRO_3AXIS \ From patchwork Sun Dec 15 18:29:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908863 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47A2B2629C for ; Sun, 15 Dec 2024 18:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287421; cv=none; b=aVHkiyWPw4JCsCHPXdEjqAOImwwfFxc3NMzh0Lwfq5aa8EpbZ5NSt0fkzFmvstp5Vk96Kt67eKvkyacuD1qGYoJNbYg8nyWSq6dorl/pcepNZqGT1uH8IrjY4qx37a4dExZuqmaTsa1wgEqeXiEoep+5W8h5jgUC/eF3tFz/VTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287421; c=relaxed/simple; bh=rX1K0B1JDmjVDAy1ocrzCx+iLyeaOJo5Nz8j4sblZxk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uwQAiskluv5WNYa75Hj6j59hNDXFL9WKYXa2TUIqpTCw5Xk/flr93R1Qzd4HPLO2wv2YM4ADf5Dn1CoKjP+yK3hoWuAD6icbY6RQ4dP6nKKYOZrPAzZFOpSdmjIW/8gouExnNPKj68c9z3BMEspltixNCzAavngP+mTTkHtSq+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vRsK+Ayr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vRsK+Ayr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FF3BC4CECE; Sun, 15 Dec 2024 18:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287421; bh=rX1K0B1JDmjVDAy1ocrzCx+iLyeaOJo5Nz8j4sblZxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vRsK+AyrKCyPW8rjEmw464eg98mlj9TSuHzm7TOda+4Yl0QU+mip/kl21gdD8U8bb GB+T4OAle0Erj2cGSqpJ/RDPeJSTY4loSJRIc6YtJmlFnpfygVzmbWaf9dOUvAayBr UXFfC81n9LpJ1uUo/xKXiQwrGtXazQkHMZa1LzfsOqGZa3ce/nWTdjkWVmRYK7JUT9 bMMcVUHh0ztnzYoBGxeLQaIFoM9cmKUE0bbU+VlIeLdduPWxP+fO6LwxhaJUbNrowY OrKqWV4Mjnw9gyZG5qg+//hBXeV1f5V6m0M1UVn0M4iCkFfEdDBoiTy9EJUu7JqVm6 g17yZ2HGmk/ZQ== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 19/20] iio: adc: mt6360: Correct marking of timestamp alignment. Date: Sun, 15 Dec 2024 18:29:10 +0000 Message-ID: <20241215182912.481706-20-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron This is sort of a fix as I assume this device only exists on architectures that do 8 byte alignment of 8 byte types. However, drivers should not be written with that assumption and should allow for the 4 byte alignment of these types as seen for example on x86_32. As such, we need to force the alignment of the timestamp field itself not the containing structure, which will also be aligned appropriate given C structure alignment guarantees alignment to at least the alignment of structure member that needs highest alignment. This is even more in the 'sort of' category because if we did have insufficient alignment of the timestamp, then marking the structure __aligned(8) would result in padding after the timestamp field. iio_push_to_buffers_with_timestamp() doesn't actually use the field, but instead where it is expected to be so will place the timestamp in the last 8 bytes, whether or not the structure definition puts it there. Hence it all works before the change. The reasoning is too subtle, just mark the right element aligned and use the new aligned_s64 to do so also clearing up the inconsistency of an int64_t timestamp relative to most other IIO drivers. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/mt6360-adc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/mt6360-adc.c b/drivers/iio/adc/mt6360-adc.c index 4eb2455d6ffa..f8e98b6fa7e9 100644 --- a/drivers/iio/adc/mt6360-adc.c +++ b/drivers/iio/adc/mt6360-adc.c @@ -263,8 +263,8 @@ static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p) struct mt6360_adc_data *mad = iio_priv(indio_dev); struct { u16 values[MT6360_CHAN_MAX]; - int64_t timestamp; - } data __aligned(8); + aligned_s64 timestamp; + } data; int i = 0, bit, val, ret; memset(&data, 0, sizeof(data)); From patchwork Sun Dec 15 18:29:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 13908864 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CF341B5ECB for ; Sun, 15 Dec 2024 18:30:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287425; cv=none; b=NcFMLXtplk6vq+T1OhIOcUS8H5xjO4GZcg4GmJ+dVrIu95ZKzp3J4am+mK3w2sp1zmZTMyPMYQXrsFtZJhWClX8wFwAr4qUG0+CjHln5heRYoMPyRmKeQfx9f+/7J1NfWqfyxvcRbAmJ96c72HzixAyk16PxIdjWL7+fQjfYWZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734287425; c=relaxed/simple; bh=38DvPJLomyAxR+iVOPRrtijLzkDRXrORgoSUQNZfkiY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Lb0pNtMhyxPetu9uHw/K82L/3d/paIPCiNDEi8b6f49FT25zNiPFN7CY0sQZU4RqllV2rYL0XyCZT1ksVhZgL+8hKrqmseuS6LW9yVJTDk/i/4YzQEjxT/+eVfaLVRXGhA+I0xlqntKY8qT+i9m996ahV5uj+6AqXOZ67miaCtw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BsVdsk/C; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BsVdsk/C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2DD5C4CECE; Sun, 15 Dec 2024 18:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734287424; bh=38DvPJLomyAxR+iVOPRrtijLzkDRXrORgoSUQNZfkiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BsVdsk/C8De2oGoSehAEs7Q0QMuESsD3Mhlt+k3QwLv/p1BjSZGYOR31m+NmuEYSL 79KfoODpRPQDYH/pzM4LzsmR2GUzNyRWnkXYUoUhlVrchyCVTzqAaAsEvnc+uZHMdb +5J/n4RBTkQh32uOUth70fB0mJ2m0pX7qlvZO9qxnEVEsDOdmOfNsGf5UuIPAzDA/c Oy71jXR/7hzZK+L8q3B6UQUgHwl5LOXg+K7kFE+mOsRRi1BkBpco3461SOskNrvBOB 8qLWDYkjrwzOvP6vwXVeLMx9qmkKyJfQy7m4wJhH8A05htU46HyvZlzwyDC5tAIcqo 4hev2Im5uWmCA== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Andy Shevchenko Cc: David Lechner , Heiko Stuebner , Jonathan Cameron Subject: [PATCH 20/20] iio: adc: rockchip: correct alignment of timestamp Date: Sun, 15 Dec 2024 18:29:11 +0000 Message-ID: <20241215182912.481706-21-jic23@kernel.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241215182912.481706-1-jic23@kernel.org> References: <20241215182912.481706-1-jic23@kernel.org> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Jonathan Cameron I assume this device is only used on architectures where a 8 byte integer type is always 8 byte aligned. However, I would prefer IIO drivers to never make that assumption as the code gets copied into new drivers which are not so tightly couple to one driver and those can run on architectures that align these types to only 4 bytes in which case this structure may be 4 byte to small leading to a buffer overrun. Signed-off-by: Jonathan Cameron --- drivers/iio/adc/rockchip_saradc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index 240cfa391674..bf4340094031 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -363,7 +363,7 @@ static irqreturn_t rockchip_saradc_trigger_handler(int irq, void *p) */ struct { u16 values[SARADC_MAX_CHANNELS]; - int64_t timestamp; + aligned_s64 timestamp; } data; int ret; int i, j = 0;