Skip to content

Commit b580a80

Browse files
nathanchancegregkh
authored andcommitted
rtc: omap: Use define directive for PIN_CONFIG_ACTIVE_HIGH
commit c501565 upstream. Clang warns when one enumerated type is implicitly converted to another: drivers/rtc/rtc-omap.c:574:21: warning: implicit conversion from enumeration type 'enum rtc_pin_config_param' to different enumeration type 'enum pin_config_param' [-Wenum-conversion] {"ti,active-high", PIN_CONFIG_ACTIVE_HIGH, 0}, ~ ^~~~~~~~~~~~~~~~~~~~~~ drivers/rtc/rtc-omap.c:579:12: warning: implicit conversion from enumeration type 'enum rtc_pin_config_param' to different enumeration type 'enum pin_config_param' [-Wenum-conversion] PCONFDUMP(PIN_CONFIG_ACTIVE_HIGH, "input active high", NULL, false), ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/pinctrl/pinconf-generic.h:163:11: note: expanded from macro 'PCONFDUMP' .param = a, .display = b, .format = c, .has_arg = d \ ^ 2 warnings generated. It is expected that pinctrl drivers can extend pin_config_param because of the gap between PIN_CONFIG_END and PIN_CONFIG_MAX so this conversion isn't an issue. Most drivers that take advantage of this define the PIN_CONFIG variables as constants, rather than enumerated values. Do the same thing here so that Clang no longer warns. Link: ClangBuiltLinux/linux#144 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 3e2dadf commit b580a80

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/rtc/rtc-omap.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,7 @@ static const struct pinctrl_ops rtc_pinctrl_ops = {
559559
.dt_free_map = pinconf_generic_dt_free_map,
560560
};
561561

562-
enum rtc_pin_config_param {
563-
PIN_CONFIG_ACTIVE_HIGH = PIN_CONFIG_END + 1,
564-
};
562+
#define PIN_CONFIG_ACTIVE_HIGH (PIN_CONFIG_END + 1)
565563

566564
static const struct pinconf_generic_params rtc_params[] = {
567565
{"ti,active-high", PIN_CONFIG_ACTIVE_HIGH, 0},

0 commit comments

Comments
 (0)