OSDN Git Service

mfd: lm3533: Expand control-bank accessors
authorJohan Hovold <johan@kernel.org>
Tue, 30 Jun 2020 08:39:48 +0000 (10:39 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 1 Jul 2020 13:54:29 +0000 (14:54 +0100)
commit4d3ec936f80dbb2174c8c1f426eb86c032e9f14e
tree4517c717ae8639303930fcd00d5d0de0fa4dea75
parentf1d8fe2e98d11788cabb2ad5c5becfcc95dd81a9
mfd: lm3533: Expand control-bank accessors

Expand the control-bank accessors that were implemented using macros.
This allows the definitions of these exported functions to be found more
easily and specifically avoids a W=1 compiler warning due to the
redundant brightness sanity check:

drivers/mfd/lm3533-ctrlbank.c: In function 'lm3533_ctrlbank_set_brightness':
drivers/mfd/lm3533-ctrlbank.c:98:10: warning: comparison is always false due to limited range of data type [-Wtype-limits]
   98 |  if (val > LM3533_##_NAME##_MAX)     \
      |          ^
drivers/mfd/lm3533-ctrlbank.c:125:1: note: in expansion of macro 'lm3533_ctrlbank_set'
  125 | lm3533_ctrlbank_set(brightness, BRIGHTNESS);
      | ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/lm3533-ctrlbank.c