Skip to contentSkip to conversation

pinctrl: intel: mark intel_pin_to_gpio __maybe_unused

PATCH Applied Arnd Bergmann 4 participants 4 messages Sep 6, 2019 – Sep 9, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pinctrl: intel: mark intel_pin_to_gpio __maybe_unused

The intel_pin_to_gpio() function is only called by the PM support functions and causes a warning when those are disabled:

drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]

Mark it __maybe_unused to suppress the warning.

---
v2: use __maybe_unused instead of moving the code

---
 drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-intel.c +1 -1
index d66fe2b4221b..1f13bcd0e4e1 100644
@@ -838,7 +838,7 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
  *
  * Translate the pin number of pinctrl to GPIO offset
  */
-static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
+static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
 {
 	const struct intel_community *community;
 	const struct intel_padgroup *padgrp;
Signature · 1 line
2.20.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

The intel_pin_to_gpio() function is only called by the PM support functions and causes a warning when those are disabled:

drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]

Mark it __maybe_unused to suppress the warning.

Acked-by on v2 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

The intel_pin_to_gpio() function is only called by the PM support functions and causes a warning when those are disabled:

drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]

Mark it __maybe_unused to suppress the warning.

Quoted 24 lines

---
v2: use __maybe_unused instead of moving the code

---
 drivers/pinctrl/intel/pinctrl-intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-intel.c +1 -1
index d66fe2b4221b..1f13bcd0e4e1 100644
@@ -838,7 +838,7 @@ static int intel_gpio_to_pin(struct intel_pinctrl *pctrl, unsigned int offset,
  *
  * Translate the pin number of pinctrl to GPIO offset
  */
-static int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
+static __maybe_unused int intel_pin_to_gpio(struct intel_pinctrl *pctrl, int pin)
 {
 	const struct intel_community *community;
 	const struct intel_padgroup *padgrp;
Signature · 1 line
2.20.0
Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer Applied
#3 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 7 lines · Arnd Bergmann

The intel_pin_to_gpio() function is only called by the PM support functions and causes a warning when those are disabled:

drivers/pinctrl/intel/pinctrl-intel.c:841:12: error: unused function 'intel_pin_to_gpio' [-Werror,-Wunused-function]

Mark it __maybe_unused to suppress the warning.

Applied, thanks!