summaryrefslogtreecommitdiffstats
path: root/mm/gup_test.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-10-15 10:14:47 +0200
committerLee Jones <lee.jones@linaro.org>2021-10-21 10:16:18 +0200
commit0fd12262613116a38fd76aefa396e9bc116fbfe2 (patch)
tree7229f77be6bdd5829ed5927513b206fc2aa34a39 /mm/gup_test.c
parentmfd: ti_am335x_tscadc: Clarify the maximum values for DT entries (diff)
downloadlinux-0fd12262613116a38fd76aefa396e9bc116fbfe2.tar.xz
linux-0fd12262613116a38fd76aefa396e9bc116fbfe2.zip
mfd: ti_am335x_tscadc: Drop useless definitions from the header
Drop useless definitions from the header like the "masks" definitions which are only used by the following definition. It could be possible to got even further by removing these definitions entirely and use FIELD_PREP() macros from the code directly, but while I have no troubles making these changes in the header, changing the values in the code directly could darkening a bit the logic and hardening future git-blames for very little added value IMHO (but this is of course a personal taste). Certain macros are using GENMASK() to define the value of a particular field, while this is purely "by chance" that the value and the mask have the same value. In this case, drop the "mask" definition, use FIELD_PREP() and GENMASK() in the macro defining the field, and use the new macro to define the particular value by feeding directly the actual number advertised in the datasheet into that macro, as in: -#define STEPCONFIG_RFM_VREFN GENMASK(24, 23) -#define STEPCONFIG_RFM(val) FIELD_PREP(STEPCONFIG_RFM_VREFN, (val)) +#define STEPCONFIG_RFM(val) FIELD_PREP(GENMASK(24, 23), (val)) +#define STEPCONFIG_RFM_VREFN STEPCONFIG_RFM(3) Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20211015081506.933180-30-miquel.raynal@bootlin.com
Diffstat (limited to 'mm/gup_test.c')
0 files changed, 0 insertions, 0 deletions