linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: Mark Brown <broonie@kernel.org>, Jiri Kosina <trivial@kernel.org>,
	Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	Pavel Machek <pavel@denx.de>,
	linux-spi <linux-spi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Prabhakar <prabhakar.csengg@gmail.com>,
	Chris Brandt <Chris.Brandt@renesas.com>
Subject: Re: [PATCH 2/2] spi: rpc-if: Remove CONFIG_PM_SLEEP ifdefery
Date: Mon, 4 Jan 2021 13:34:16 +0100	[thread overview]
Message-ID: <CAMuHMdVCD52-eTnEwftGz8ExMkZkJRyM=3M8zU11yhn1UNPxxA@mail.gmail.com> (raw)
In-Reply-To: <20201230145708.28544-3-prabhakar.mahadev-lad.rj@bp.renesas.com>

Hi Prabhakar,

On Wed, Dec 30, 2020 at 4:00 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> Use __maybe_unused for the suspend()/resume() hooks and get rid of
> the CONFIG_PM_SLEEP ifdefery to improve the code.
>
> Suggested-by: Pavel Machek <pavel@denx.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Thanks for your patch!

> --- a/drivers/spi/spi-rpc-if.c
> +++ b/drivers/spi/spi-rpc-if.c
> @@ -176,15 +176,14 @@ static int rpcif_spi_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -#ifdef CONFIG_PM_SLEEP
> -static int rpcif_spi_suspend(struct device *dev)
> +static int __maybe_unused rpcif_spi_suspend(struct device *dev)
>  {
>         struct spi_controller *ctlr = dev_get_drvdata(dev);
>
>         return spi_controller_suspend(ctlr);
>  }
>
> -static int rpcif_spi_resume(struct device *dev)
> +static int __maybe_unused rpcif_spi_resume(struct device *dev)
>  {
>         struct spi_controller *ctlr = dev_get_drvdata(dev);
>
> @@ -192,17 +191,13 @@ static int rpcif_spi_resume(struct device *dev)
>  }
>
>  static SIMPLE_DEV_PM_OPS(rpcif_spi_pm_ops, rpcif_spi_suspend, rpcif_spi_resume);
> -#define DEV_PM_OPS     (&rpcif_spi_pm_ops)
> -#else
> -#define DEV_PM_OPS     NULL
> -#endif
>
>  static struct platform_driver rpcif_spi_driver = {
>         .probe  = rpcif_spi_probe,
>         .remove = rpcif_spi_remove,
>         .driver = {
>                 .name   = "rpc-if-spi",
> -               .pm     = DEV_PM_OPS,
> +               .pm     = &rpcif_spi_pm_ops,

You're aware rpcif_spi_pm_ops is now always referenced and thus emitted,
increasing kernel size by 92 bytes if CONFIG_PM_SLEEP=n?
This may matter for RZ/A SoCs running from internal SRAM.

>         },
>  };
>  module_platform_driver(rpcif_spi_driver);

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  parent reply	other threads:[~2021-01-04 12:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-30 14:57 [PATCH 0/2] spi: rpc-if: Trivial fixes Lad Prabhakar
2020-12-30 14:57 ` [PATCH 1/2] spi: rpc-if: Avoid use of C++ style comments Lad Prabhakar
2020-12-30 16:27   ` Sergei Shtylyov
2020-12-30 23:16     ` Lad, Prabhakar
2020-12-30 14:57 ` [PATCH 2/2] spi: rpc-if: Remove CONFIG_PM_SLEEP ifdefery Lad Prabhakar
2020-12-30 18:05   ` Pavel Machek
2021-01-04 12:34   ` Geert Uytterhoeven [this message]
2021-01-04 21:25     ` Lad, Prabhakar
2021-01-04 21:30       ` Mark Brown
2021-01-04 23:40         ` Pavel Machek
2021-01-05  7:37           ` Geert Uytterhoeven
2021-01-05 10:42             ` Pavel Machek
2021-01-05 11:11               ` Geert Uytterhoeven
2020-12-31 13:29 ` (subset) [PATCH 0/2] spi: rpc-if: Trivial fixes Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMuHMdVCD52-eTnEwftGz8ExMkZkJRyM=3M8zU11yhn1UNPxxA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=Chris.Brandt@renesas.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=pavel@denx.de \
    --cc=prabhakar.csengg@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=sergei.shtylyov@gmail.com \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).