* [PATCH v2 0/1] iio: chemical: bme680: use BME680_NUM_CHANNELS
@ 2026-04-20 8:24 Nikhil Gautam
2026-04-20 8:24 ` [PATCH v2 1/1] iio: chemical: bme680: use BME680_NUM_CHANNELS for scan buffer Nikhil Gautam
0 siblings, 1 reply; 2+ messages in thread
From: Nikhil Gautam @ 2026-04-20 8:24 UTC (permalink / raw)
To: linux-iio; +Cc: jic23, dlechner, Nikhil Gautam
Hi,
This patch updates the BME680 driver to use the existing
BME680_NUM_CHANNELS macro instead of a hardcoded value in the
scan buffer.
In the previous version, the macro was proposed for removal as it
appeared unused. However, it was pointed out during review that
it is intended to represent the number of channels in the scan
buffer.
This version addresses that feedback by using the macro instead
of removing it, improving readability and maintainability.
Changes in v2:
Use BME680_NUM_CHANNELS instead of hardcoded value
Keep the macro instead of removing it
Address review feedback from Jonathan Cameron
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Thanks,
Nikhil Gautam
Nikhil Gautam (1):
iio: chemical: bme680: use BME680_NUM_CHANNELS for scan buffer
drivers/iio/chemical/bme680_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2 1/1] iio: chemical: bme680: use BME680_NUM_CHANNELS for scan buffer
2026-04-20 8:24 [PATCH v2 0/1] iio: chemical: bme680: use BME680_NUM_CHANNELS Nikhil Gautam
@ 2026-04-20 8:24 ` Nikhil Gautam
0 siblings, 0 replies; 2+ messages in thread
From: Nikhil Gautam @ 2026-04-20 8:24 UTC (permalink / raw)
To: linux-iio; +Cc: jic23, dlechner, Nikhil Gautam
Use BME680_NUM_CHANNELS instead of the hardcoded channel count
in the scan buffer.
This avoids use of a magic number and improves code readability
and maintainability.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Nikhil Gautam <nikhilgtr@gmail.com>
---
drivers/iio/chemical/bme680_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c
index 3e850562ab00..42c1a9de175a 100644
--- a/drivers/iio/chemical/bme680_core.c
+++ b/drivers/iio/chemical/bme680_core.c
@@ -128,7 +128,7 @@ struct bme680_data {
u16 heater_temp;
struct {
- s32 chan[4];
+ s32 chan[BME680_NUM_CHANNELS];
aligned_s64 ts;
} scan;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-20 8:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 8:24 [PATCH v2 0/1] iio: chemical: bme680: use BME680_NUM_CHANNELS Nikhil Gautam
2026-04-20 8:24 ` [PATCH v2 1/1] iio: chemical: bme680: use BME680_NUM_CHANNELS for scan buffer Nikhil Gautam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox