Skip to content

Commit 20c598e

Browse files
Nikhilgtrjic23
authored andcommitted
iio: chemical: bme680: use BME680_NUM_CHANNELS for scan buffer
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>
1 parent 44f38b4 commit 20c598e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/chemical/bme680_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct bme680_data {
128128
u16 heater_temp;
129129

130130
struct {
131-
s32 chan[4];
131+
s32 chan[BME680_NUM_CHANNELS];
132132
aligned_s64 ts;
133133
} scan;
134134

0 commit comments

Comments
 (0)