All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: core: mark lock functions as __maybe_unused
@ 2015-10-07 10:12 Arnd Bergmann
  2015-10-07 10:24 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2015-10-07 10:12 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, Sascha Hauer

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 7896ef53ff86..96dd7e1f1f28 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -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;
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: core: mark lock functions as __maybe_unused
  2015-10-07 10:12 [PATCH] regulator: core: mark lock functions as __maybe_unused Arnd Bergmann
@ 2015-10-07 10:24 ` Mark Brown
  2015-10-07 14:01   ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2015-10-07 10:24 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Liam Girdwood, linux-kernel, Sascha Hauer

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

On Wed, Oct 07, 2015 at 12:12:09PM +0200, Arnd Bergmann wrote:

> 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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: core: mark lock functions as __maybe_unused
  2015-10-07 10:24 ` Mark Brown
@ 2015-10-07 14:01   ` Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2015-10-07 14:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Arnd Bergmann, Liam Girdwood, linux-kernel

On Wed, Oct 07, 2015 at 11:24:07AM +0100, Mark Brown wrote:
> On Wed, Oct 07, 2015 at 12:12:09PM +0200, Arnd Bergmann wrote:
> 
> > 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

-- 
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 |

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-07 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 10:12 [PATCH] regulator: core: mark lock functions as __maybe_unused Arnd Bergmann
2015-10-07 10:24 ` Mark Brown
2015-10-07 14:01   ` Sascha Hauer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.