Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: adxl345: replace magic numbers by unit expressions

Replace absolute numbers by their expressions from units.h to avoid
using magic numbers. Use uniform expressions to clarify their usage.

This is a refactoring change and should not impact functionality.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Link: https://patch.msgid.link/20250610215933.84795-7-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Lothar Rubusch and committed by
Jonathan Cameron
e564c054 f7f905f7

+3 -3
+3 -3
drivers/iio/accel/adxl345_core.c
··· 708 708 return IIO_VAL_INT; 709 709 case IIO_EV_INFO_TIMEOUT: 710 710 *val = st->tap_duration_us; 711 - *val2 = 1000000; 711 + *val2 = MICRO; 712 712 return IIO_VAL_FRACTIONAL; 713 713 case IIO_EV_INFO_RESET_TIMEOUT: 714 714 *val = st->tap_window_us; 715 - *val2 = 1000000; 715 + *val2 = MICRO; 716 716 return IIO_VAL_FRACTIONAL; 717 717 case IIO_EV_INFO_TAP2_MIN_DELAY: 718 718 *val = st->tap_latent_us; 719 - *val2 = 1000000; 719 + *val2 = MICRO; 720 720 return IIO_VAL_FRACTIONAL; 721 721 default: 722 722 return -EINVAL;