Linux IIO development
 help / color / mirror / Atom feed
From: Vasileios Amoiridis <vassilisamir@gmail.com>
To: jic23@kernel.org, lars@metafoo.de, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	andriy.shevchenko@linux.intel.com
Cc: ajarizzo@gmail.com, ak@it-klinger.de, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	vassilisamir@gmail.com
Subject: [PATCH v1 2/3] iio: pressure: bmp280: Use sizeof() for denominator
Date: Fri, 29 Nov 2024 00:24:49 +0100	[thread overview]
Message-ID: <20241128232450.313862-3-vassilisamir@gmail.com> (raw)
In-Reply-To: <20241128232450.313862-1-vassilisamir@gmail.com>

Instead of using magic number 2 as a denominator, make it intuitive by
using sizeof().

Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
---
 drivers/iio/pressure/bmp280.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/pressure/bmp280.h b/drivers/iio/pressure/bmp280.h
index 2df1175b6b85..a3631bc0e188 100644
--- a/drivers/iio/pressure/bmp280.h
+++ b/drivers/iio/pressure/bmp280.h
@@ -470,8 +470,8 @@ struct bmp280_data {
 		/* Sensor data buffer */
 		u8 buf[BME280_BURST_READ_BYTES];
 		/* Calibration data buffers */
-		__le16 bmp280_cal_buf[BMP280_CONTIGUOUS_CALIB_REGS / 2];
-		__be16 bmp180_cal_buf[BMP180_REG_CALIB_COUNT / 2];
+		__le16 bmp280_cal_buf[BMP280_CONTIGUOUS_CALIB_REGS / sizeof(__le16)];
+		__be16 bmp180_cal_buf[BMP180_REG_CALIB_COUNT / sizeof(__be16)];
 		u8 bme280_humid_cal_buf[BME280_CONTIGUOUS_CALIB_REGS];
 		u8 bmp380_cal_buf[BMP380_CALIB_REG_COUNT];
 		/* Miscellaneous, endianness-aware data buffers */
-- 
2.43.0


  parent reply	other threads:[~2024-11-28 23:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 23:24 [PATCH v1 0/3] iio: pressure: bmp280: Minor cleanup Vasileios Amoiridis
2024-11-28 23:24 ` [PATCH v1 1/3] dt-bindings: iio: pressure: bmp085: Add SPI interface Vasileios Amoiridis
2024-11-29  7:22   ` Krzysztof Kozlowski
2024-11-29 23:51     ` Vasileios Amoiridis
2024-11-28 23:24 ` Vasileios Amoiridis [this message]
2024-11-29 15:20   ` [PATCH v1 2/3] iio: pressure: bmp280: Use sizeof() for denominator Andy Shevchenko
2024-11-28 23:24 ` [PATCH v1 3/3] iio: pressure: bmp280: Make time vars intuitive and move to fsleep Vasileios Amoiridis
2024-11-29 15:01   ` Andy Shevchenko
2024-11-29 23:54     ` Vasileios Amoiridis
2024-11-30 14:30 ` [PATCH v1 0/3] iio: pressure: bmp280: Minor cleanup Jonathan Cameron
2024-12-02 18:10   ` Vasileios Amoiridis
  -- strict thread matches above, loose matches on Subject: below --
2024-12-02 18:19 [PATCH v2 " Vasileios Amoiridis
2024-12-02 18:19 ` [PATCH v1 2/3] iio: pressure: bmp280: Use sizeof() for denominator Vasileios Amoiridis
2024-12-08 18:06   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241128232450.313862-3-vassilisamir@gmail.com \
    --to=vassilisamir@gmail.com \
    --cc=ajarizzo@gmail.com \
    --cc=ak@it-klinger.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox