From: Nikhil Gautam <nikhilgtr@gmail.com>
To: linux-iio@vger.kernel.org
Cc: jic23@kernel.org, dlechner@baylibre.com,
Nikhil Gautam <nikhilgtr@gmail.com>
Subject: [PATCH v2 1/1] iio: chemical: bme680: use BME680_NUM_CHANNELS for scan buffer
Date: Mon, 20 Apr 2026 13:54:36 +0530 [thread overview]
Message-ID: <20260420082436.7223-2-nikhilgtr@gmail.com> (raw)
In-Reply-To: <20260420082436.7223-1-nikhilgtr@gmail.com>
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
prev parent reply other threads:[~2026-04-20 8:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=20260420082436.7223-2-nikhilgtr@gmail.com \
--to=nikhilgtr@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.