[PATCH v2 0/4] correct macro issues
From: Michael Harris
Date: Fri Mar 06 2026 - 02:17:52 EST
This patch series fixes various issues with the macros definitions, such
as:
- Config macro names that don't indicate which config it's for
- Magic numbers
- Mask values being before the mask itself
Additionally, some macros are outright removed due to having better
modern standards:
- Offset/shift macros are replaced with the use of FIELD_GET(),
FIELD_PREP(), or FIELD_FIT()
- Macros used for custom sign manipulation are replaced with
sign_extend32()
---
Changes in v2:
- Delete "remove unused macros" patch
- Add a patch that fixes manual temperature calculation and deletes the
associated macros
- Add a patch that removes offset/shift macros
- Add a patch that adds the associated config to
macro names and adjusts ordering so that mask values are below the
mask itself
- Use GENMASK_U32() and BIT_U32() instead of GENMASK() and BIT(), to
prevent sysfs_emit() from expecting unsigned long (thanks to David
Laight for this suggestion)
- Corrected macros that were incorrectly using BIT() or GENMASK()
- Change the cover letter description to better fit all the new patches
- Link to v1: https://lore.kernel.org/r/20260130-adt7316-correct-macros-v1-0-8a71df1e42f1@xxxxxxxxx
---
Michael Harris (4):
staging: iio: adt7316: refactor temperature calculation logic
staging: iio: adt7316: remove shift/offset macros
staging: iio: adt7316: add config names to registers and reorder
staging: iio: adt7316: convert magic numbers to BIT_U32() or GENMASK_U32()
drivers/staging/iio/addac/adt7316.c | 384 +++++++++++++++++++-----------------
1 file changed, 203 insertions(+), 181 deletions(-)
---
base-commit: 5d2905f2c6acdd1c553f9b022dee730ab2cced71
change-id: 20260130-adt7316-correct-macros-b6801b4ae1b1
Best regards,
--
Michael Harris <michaelharriscode@xxxxxxxxx>