Re: [PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-11 Thread Dmitry Torokhov
On Thu, Mar 12, 2015 at 08:00:35AM +1100, Herbert Xu wrote:
> On Wed, Mar 11, 2015 at 08:44:07AM -0700, Dmitry Torokhov wrote:
> > 
> > SIMPLE_DEV_PM_OPS() produces an empty omap_rng_pm structure in case of
> > !CONFIG_PM_SLEEP so neither omap_rng_suspend nor omap_rng_resume will
> > end up being referenced.
> 
> OK, could you please resend this patch?

Done.

Thanks!

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-11 Thread Herbert Xu
On Wed, Mar 11, 2015 at 08:44:07AM -0700, Dmitry Torokhov wrote:
> 
> SIMPLE_DEV_PM_OPS() produces an empty omap_rng_pm structure in case of
> !CONFIG_PM_SLEEP so neither omap_rng_suspend nor omap_rng_resume will
> end up being referenced.

OK, could you please resend this patch?

Thanks,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-11 Thread Dmitry Torokhov
Hi Herbert,

On Wed, Mar 11, 2015 at 09:59:57PM +1100, Herbert Xu wrote:
> On Mon, Mar 09, 2015 at 10:36:36AM -0700, Dmitry Torokhov wrote:
> > Instead of using #ifdefs let's mark suspend and resume methods as
> > __maybe_unused which will suppress compiler warnings about them being
> > unused and provide better compile coverage. This will not increase image
> > size.
> > 
> > Signed-off-by: Dmitry Torokhov 
> > ---
> >  drivers/char/hw_random/omap-rng.c | 15 +++
> >  1 file changed, 3 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/char/hw_random/omap-rng.c 
> > b/drivers/char/hw_random/omap-rng.c
> > index 7f3597d..5c171b1 100644
> > --- a/drivers/char/hw_random/omap-rng.c
> > +++ b/drivers/char/hw_random/omap-rng.c
> > @@ -422,9 +422,7 @@ static int omap_rng_remove(struct platform_device *pdev)
> > return 0;
> >  }
> >  
> > -#ifdef CONFIG_PM_SLEEP
> > -
> > -static int omap_rng_suspend(struct device *dev)
> > +static int __maybe_unused omap_rng_suspend(struct device *dev)
> >  {
> > struct omap_rng_dev *priv = dev_get_drvdata(dev);
> >  
> > @@ -434,7 +432,7 @@ static int omap_rng_suspend(struct device *dev)
> > return 0;
> >  }
> >  
> > -static int omap_rng_resume(struct device *dev)
> > +static int __maybe_unused omap_rng_resume(struct device *dev)
> >  {
> > struct omap_rng_dev *priv = dev_get_drvdata(dev);
> >  
> > @@ -445,18 +443,11 @@ static int omap_rng_resume(struct device *dev)
> >  }
> >  
> >  static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
> > -#defineOMAP_RNG_PM (&omap_rng_pm)
> > -
> > -#else
> > -
> > -#defineOMAP_RNG_PM NULL
> > -
> > -#endif
> >  
> >  static struct platform_driver omap_rng_driver = {
> > .driver = {
> > .name   = "omap_rng",
> > -   .pm = OMAP_RNG_PM,
> > +   .pm = &omap_rng_pm,
> 
> This will cause omap_rng_suspend/omap_rng_resume to be referenced
> always, thus rendering the __maybe_unused moot, no?

SIMPLE_DEV_PM_OPS() produces an empty omap_rng_pm structure in case of
!CONFIG_PM_SLEEP so neither omap_rng_suspend nor omap_rng_resume will
end up being referenced.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-11 Thread Herbert Xu
On Mon, Mar 09, 2015 at 10:36:36AM -0700, Dmitry Torokhov wrote:
> Instead of using #ifdefs let's mark suspend and resume methods as
> __maybe_unused which will suppress compiler warnings about them being
> unused and provide better compile coverage. This will not increase image
> size.
> 
> Signed-off-by: Dmitry Torokhov 
> ---
>  drivers/char/hw_random/omap-rng.c | 15 +++
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/char/hw_random/omap-rng.c 
> b/drivers/char/hw_random/omap-rng.c
> index 7f3597d..5c171b1 100644
> --- a/drivers/char/hw_random/omap-rng.c
> +++ b/drivers/char/hw_random/omap-rng.c
> @@ -422,9 +422,7 @@ static int omap_rng_remove(struct platform_device *pdev)
>   return 0;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
> -
> -static int omap_rng_suspend(struct device *dev)
> +static int __maybe_unused omap_rng_suspend(struct device *dev)
>  {
>   struct omap_rng_dev *priv = dev_get_drvdata(dev);
>  
> @@ -434,7 +432,7 @@ static int omap_rng_suspend(struct device *dev)
>   return 0;
>  }
>  
> -static int omap_rng_resume(struct device *dev)
> +static int __maybe_unused omap_rng_resume(struct device *dev)
>  {
>   struct omap_rng_dev *priv = dev_get_drvdata(dev);
>  
> @@ -445,18 +443,11 @@ static int omap_rng_resume(struct device *dev)
>  }
>  
>  static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
> -#define  OMAP_RNG_PM (&omap_rng_pm)
> -
> -#else
> -
> -#define  OMAP_RNG_PM NULL
> -
> -#endif
>  
>  static struct platform_driver omap_rng_driver = {
>   .driver = {
>   .name   = "omap_rng",
> - .pm = OMAP_RNG_PM,
> + .pm = &omap_rng_pm,

This will cause omap_rng_suspend/omap_rng_resume to be referenced
always, thus rendering the __maybe_unused moot, no?

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] hwrng: omap - remove #ifdefery around PM methods

2015-03-09 Thread Dmitry Torokhov
Instead of using #ifdefs let's mark suspend and resume methods as
__maybe_unused which will suppress compiler warnings about them being
unused and provide better compile coverage. This will not increase image
size.

Signed-off-by: Dmitry Torokhov 
---
 drivers/char/hw_random/omap-rng.c | 15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/char/hw_random/omap-rng.c 
b/drivers/char/hw_random/omap-rng.c
index 7f3597d..5c171b1 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -422,9 +422,7 @@ static int omap_rng_remove(struct platform_device *pdev)
return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-
-static int omap_rng_suspend(struct device *dev)
+static int __maybe_unused omap_rng_suspend(struct device *dev)
 {
struct omap_rng_dev *priv = dev_get_drvdata(dev);
 
@@ -434,7 +432,7 @@ static int omap_rng_suspend(struct device *dev)
return 0;
 }
 
-static int omap_rng_resume(struct device *dev)
+static int __maybe_unused omap_rng_resume(struct device *dev)
 {
struct omap_rng_dev *priv = dev_get_drvdata(dev);
 
@@ -445,18 +443,11 @@ static int omap_rng_resume(struct device *dev)
 }
 
 static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
-#defineOMAP_RNG_PM (&omap_rng_pm)
-
-#else
-
-#defineOMAP_RNG_PM NULL
-
-#endif
 
 static struct platform_driver omap_rng_driver = {
.driver = {
.name   = "omap_rng",
-   .pm = OMAP_RNG_PM,
+   .pm = &omap_rng_pm,
.of_match_table = of_match_ptr(omap_rng_of_match),
},
.probe  = omap_rng_probe,
-- 
2.2.0.rc0.207.ga3a616c

--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html