]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: chemical: bme680: use BME680_NUM_CHANNELS for scan buffer
authorNikhil Gautam <nikhilgtr@gmail.com>
Mon, 20 Apr 2026 08:24:36 +0000 (13:54 +0530)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:42 +0000 (10:59 +0100)
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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/chemical/bme680_core.c

index 6aeac132394c7e902d9c3082437df4428e86de6b..ac9a737481dc712aac765a9d448b105cc9ef6d39 100644 (file)
@@ -128,7 +128,7 @@ struct bme680_data {
        u16 heater_temp;
 
        struct {
-               s32 chan[4];
+               s32 chan[BME680_NUM_CHANNELS];
                aligned_s64 ts;
        } scan;