From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Florian Fainelli <f.fainelli@gmail.com>, linux-kernel@vger.kernel.org
Cc: Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] memory: Add Broadcom STB memory controller driver
Date: Fri, 12 Aug 2022 20:36:14 +0300 [thread overview]
Message-ID: <fa283e3c-5b96-b0a4-95c5-a7230d16d8ca@linaro.org> (raw)
In-Reply-To: <375eac04-dbfd-080a-3003-cae3eda1f42b@gmail.com>
On 12/08/2022 20:29, Florian Fainelli wrote:
> On 8/9/22 02:58, Krzysztof Kozlowski wrote:
>> On 02/08/2022 01:09, Florian Fainelli wrote:
>>> Add support for configuring the Self Refresh Power Down (SRPD)
>>> inactivity timeout on Broadcom STB chips. This is used to conserve power
>>> when the DRAM activity is reduced.
>>>
>>
>>
>>> +static int __maybe_unused brcmstb_memc_resume(struct device *dev)
>>> +{
>>> + struct brcmstb_memc *memc = dev_get_drvdata(dev);
>>> +
>>> + if (memc->timeout_cycles == 0)
>>> + return 0;
>>> +
>>> + return brcmstb_memc_srpd_config(memc, memc->timeout_cycles);
>>> +}
>>> +
>>> +static SIMPLE_DEV_PM_OPS(brcmstb_memc_pm_ops, brcmstb_memc_suspend,
>>> + brcmstb_memc_resume);
>>> +
>>> +static struct platform_driver brcmstb_memc_driver = {
>>> + .probe = brcmstb_memc_probe,
>>> + .remove = brcmstb_memc_remove,
>>> + .driver = {
>>> + .name = "brcmstb_memc",
>>> + .owner = THIS_MODULE,
>>
>> No need, run coccinelle.
>>
>>> + .of_match_table = brcmstb_memc_of_match,
>>> + .pm = &brcmstb_memc_pm_ops,
>>
>> Shouldn't this be pm_ptr()? and then no need for __maybe_unused in
>> brcmstb_memc_resume/suspend.
>
> How can one can remove __maybe_unused without causing a warning for the
> CONFIG_PM=n case, not that I needed to build to convince myself, but
> still did anyway:
>
> drivers/memory/brcmstb_memc.c:275:12: warning: 'brcmstb_memc_resume'
> defined but not used [-Wunused-function]
> static int brcmstb_memc_resume(struct device *dev)
> ^~~~~~~~~~~~~~~~~~~
> drivers/memory/brcmstb_memc.c:252:12: warning: 'brcmstb_memc_suspend'
> defined but not used [-Wunused-function]
> static int brcmstb_memc_suspend(struct device *dev)
> ^~~~~~~~~~~~~~~~~~~~
>
> unless you also implied enclosing those functions under an #if
> IS_ENABLED(CONFIG_PM) or something which is IMHO less preferable.
Are you sure you added also pm_ptr()? I don't see such warnings with W=1
and final object does not have the functions (for a different driver but
same principle).
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-08-12 17:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-01 22:09 [PATCH v3 0/3] Add Broadcom STB memory controller driver Florian Fainelli
2022-08-01 22:09 ` [PATCH v3 1/3] dt-bindings: memory-controller: Document Broadcom STB MEMC Florian Fainelli
2022-08-01 22:09 ` [PATCH v3 2/3] Documentation: sysfs: Document Broadcom STB memc sysfs knobs Florian Fainelli
2022-08-01 22:09 ` [PATCH v3 3/3] memory: Add Broadcom STB memory controller driver Florian Fainelli
2022-08-09 9:58 ` Krzysztof Kozlowski
2022-08-12 17:29 ` Florian Fainelli
2022-08-12 17:36 ` Krzysztof Kozlowski [this message]
2022-08-12 17:52 ` Florian Fainelli
2022-08-12 18:41 ` Krzysztof Kozlowski
2022-08-12 22:22 ` Florian Fainelli
2022-08-16 7:30 ` Krzysztof Kozlowski
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=fa283e3c-5b96-b0a4-95c5-a7230d16d8ca@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@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).