regulator: core: mark lock functions as __maybe_unused
PATCH 1/1 regulator: core: mark lock functions as __maybe_unused
Commit 9f01cd4a915e1 ("regulator: core: introduce function to lock regulators and its supplies") introduced a pair of new functions that are marked static but so far not used, which causes annoying but harmless compiler warnings:
drivers/regulator/core.c:139:13: warning: 'regulator_lock_supply' defined but not used [-Wunused-function]
static void regulator_lock_supply(struct regulator_dev *rdev)
The best way to avoid these would be to add the code that will use these functions. If that still takes a while, this patch at least shuts up the compiler by marking the functions as __maybe_unused. The same could be achieved by marking them as static inline or non-static, or by hiding them from the compiler, but those seemed less appropriate.
drivers/regulator/core.c +2 -2
@@ -136,7 +136,7 @@ static bool have_full_constraints(void)* regulator_lock_supply - lock a regulator and its supplies * @rdev: regulator source */ -static void regulator_lock_supply (struct regulator_dev *rdev) +static void __maybe_unused regulator_lock_supply (struct regulator_dev *rdev) {struct regulator *supply;int i =0 ;
@@ -156,7 +156,7 @@ static void regulator_lock_supply(struct regulator_dev *rdev)* regulator_unlock_supply - unlock a regulator and its supplies * @rdev: regulator source */ -static void regulator_unlock_supply (struct regulator_dev *rdev) +static void __maybe_unused regulator_unlock_supply (struct regulator_dev *rdev) {struct regulator *supply;
Mark Brown
maintainerQuoted 6 lines · Arnd Bergmann
The best way to avoid these would be to add the code that will use these functions. If that still takes a while, this patch at least shuts up the compiler by marking the functions as
__maybe_unused. The same could be achieved by marking them as static inline or non-static, or by hiding them from the compiler, but those seemed less appropriate.
That code is still in review, it's not looking too hard to get merged.
Quoted 10 lines · Mark Brown
Quoted 6 lines · Arnd Bergmann
The best way to avoid these would be to add the code that will use these functions. If that still takes a while, this patch at least shuts up the compiler by marking the functions as
__maybe_unused. The same could be achieved by marking them as static inline or non-static, or by hiding them from the compiler, but those seemed less appropriate.That code is still in review, it's not looking too hard to get merged.
I'll send an update on that next week after ELCE.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |