2019-10-22 14:30:08

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH] hwrng: omap3-rom - Fix unused function warnings

When runtime-pm is disabled, we get a few harmless warnings:

drivers/char/hw_random/omap3-rom-rng.c:65:12: error: unused function 'omap_rom_rng_runtime_suspend' [-Werror,-Wunused-function]
drivers/char/hw_random/omap3-rom-rng.c:81:12: error: unused function 'omap_rom_rng_runtime_resume' [-Werror,-Wunused-function]

Mark these functions as __maybe_unused so gcc can drop them
silently.

Fixes: 8d9d4bdc495f ("hwrng: omap3-rom - Use runtime PM instead of custom functions")
Signed-off-by: Arnd Bergmann <[email protected]>
---
drivers/char/hw_random/omap3-rom-rng.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/hw_random/omap3-rom-rng.c b/drivers/char/hw_random/omap3-rom-rng.c
index 0b90983c95c8..e08a8887e718 100644
--- a/drivers/char/hw_random/omap3-rom-rng.c
+++ b/drivers/char/hw_random/omap3-rom-rng.c
@@ -62,7 +62,7 @@ static int omap3_rom_rng_read(struct hwrng *rng, void *data, size_t max, bool w)
return r;
}

-static int omap_rom_rng_runtime_suspend(struct device *dev)
+static int __maybe_unused omap_rom_rng_runtime_suspend(struct device *dev)
{
struct omap_rom_rng *ddata;
int r;
@@ -78,7 +78,7 @@ static int omap_rom_rng_runtime_suspend(struct device *dev)
return 0;
}

-static int omap_rom_rng_runtime_resume(struct device *dev)
+static int __maybe_unused omap_rom_rng_runtime_resume(struct device *dev)
{
struct omap_rom_rng *ddata;
int r;
--
2.20.0


2019-10-23 20:06:13

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH] hwrng: omap3-rom - Fix unused function warnings

Hi,

On Tue, Oct 22, 2019 at 04:27:31PM +0200, Arnd Bergmann wrote:
> When runtime-pm is disabled, we get a few harmless warnings:
>
> drivers/char/hw_random/omap3-rom-rng.c:65:12: error: unused function 'omap_rom_rng_runtime_suspend' [-Werror,-Wunused-function]
> drivers/char/hw_random/omap3-rom-rng.c:81:12: error: unused function 'omap_rom_rng_runtime_resume' [-Werror,-Wunused-function]
>
> Mark these functions as __maybe_unused so gcc can drop them
> silently.
>
> Fixes: 8d9d4bdc495f ("hwrng: omap3-rom - Use runtime PM instead of custom functions")
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---

Reviewed-by: Sebastian Reichel <[email protected]>

-- Sebastian

> drivers/char/hw_random/omap3-rom-rng.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/hw_random/omap3-rom-rng.c b/drivers/char/hw_random/omap3-rom-rng.c
> index 0b90983c95c8..e08a8887e718 100644
> --- a/drivers/char/hw_random/omap3-rom-rng.c
> +++ b/drivers/char/hw_random/omap3-rom-rng.c
> @@ -62,7 +62,7 @@ static int omap3_rom_rng_read(struct hwrng *rng, void *data, size_t max, bool w)
> return r;
> }
>
> -static int omap_rom_rng_runtime_suspend(struct device *dev)
> +static int __maybe_unused omap_rom_rng_runtime_suspend(struct device *dev)
> {
> struct omap_rom_rng *ddata;
> int r;
> @@ -78,7 +78,7 @@ static int omap_rom_rng_runtime_suspend(struct device *dev)
> return 0;
> }
>
> -static int omap_rom_rng_runtime_resume(struct device *dev)
> +static int __maybe_unused omap_rom_rng_runtime_resume(struct device *dev)
> {
> struct omap_rom_rng *ddata;
> int r;
> --
> 2.20.0
>


Attachments:
(No filename) (1.66 kB)
signature.asc (849.00 B)
Download all attachments

2019-10-24 00:52:02

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH] hwrng: omap3-rom - Fix unused function warnings

* Sebastian Reichel <[email protected]> [191023 13:15]:
> Hi,
>
> On Tue, Oct 22, 2019 at 04:27:31PM +0200, Arnd Bergmann wrote:
> > When runtime-pm is disabled, we get a few harmless warnings:
> >
> > drivers/char/hw_random/omap3-rom-rng.c:65:12: error: unused function 'omap_rom_rng_runtime_suspend' [-Werror,-Wunused-function]
> > drivers/char/hw_random/omap3-rom-rng.c:81:12: error: unused function 'omap_rom_rng_runtime_resume' [-Werror,-Wunused-function]
> >
> > Mark these functions as __maybe_unused so gcc can drop them
> > silently.
> >
> > Fixes: 8d9d4bdc495f ("hwrng: omap3-rom - Use runtime PM instead of custom functions")
> > Signed-off-by: Arnd Bergmann <[email protected]>
> > ---
>
> Reviewed-by: Sebastian Reichel <[email protected]>

Thanks for fixing these similar issues again:

Reviewwed-by: Tony Lindgren <[email protected]>

2019-11-01 06:09:41

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] hwrng: omap3-rom - Fix unused function warnings

On Tue, Oct 22, 2019 at 04:27:31PM +0200, Arnd Bergmann wrote:
> When runtime-pm is disabled, we get a few harmless warnings:
>
> drivers/char/hw_random/omap3-rom-rng.c:65:12: error: unused function 'omap_rom_rng_runtime_suspend' [-Werror,-Wunused-function]
> drivers/char/hw_random/omap3-rom-rng.c:81:12: error: unused function 'omap_rom_rng_runtime_resume' [-Werror,-Wunused-function]
>
> Mark these functions as __maybe_unused so gcc can drop them
> silently.
>
> Fixes: 8d9d4bdc495f ("hwrng: omap3-rom - Use runtime PM instead of custom functions")
> Signed-off-by: Arnd Bergmann <[email protected]>
> ---
> drivers/char/hw_random/omap3-rom-rng.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt