diff mbox series

[-next] memory: omap-gpmc: Fix -Wunused-function warnings

Message ID 20200901035642.22772-1-yuehaibing@huawei.com
State New
Headers show
Series [-next] memory: omap-gpmc: Fix -Wunused-function warnings | expand

Commit Message

YueHaibing Sept. 1, 2020, 3:56 a.m. UTC
drivers/memory/omap-gpmc.c:987:12: warning: ‘gpmc_cs_remap’ defined but not used [-Wunused-function]
 static int gpmc_cs_remap(int cs, u32 base)
            ^~~~~~~~~~~~~
drivers/memory/omap-gpmc.c:926:20: warning: ‘gpmc_cs_get_name’ defined but not used [-Wunused-function]
 static const char *gpmc_cs_get_name(int cs)
                    ^~~~~~~~~~~~~~~~
drivers/memory/omap-gpmc.c:919:13: warning: ‘gpmc_cs_set_name’ defined but not used [-Wunused-function]
 static void gpmc_cs_set_name(int cs, const char *name)
             ^~~~~~~~~~~~~~~~
Make them as  __maybe_unused to fix this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/memory/omap-gpmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Krzysztof Kozlowski Sept. 1, 2020, 6:52 a.m. UTC | #1
On Tue, Sep 01, 2020 at 11:56:42AM +0800, YueHaibing wrote:
> drivers/memory/omap-gpmc.c:987:12: warning: ‘gpmc_cs_remap’ defined but not used [-Wunused-function]
>  static int gpmc_cs_remap(int cs, u32 base)
>             ^~~~~~~~~~~~~
> drivers/memory/omap-gpmc.c:926:20: warning: ‘gpmc_cs_get_name’ defined but not used [-Wunused-function]
>  static const char *gpmc_cs_get_name(int cs)
>                     ^~~~~~~~~~~~~~~~
> drivers/memory/omap-gpmc.c:919:13: warning: ‘gpmc_cs_set_name’ defined but not used [-Wunused-function]
>  static void gpmc_cs_set_name(int cs, const char *name)
>              ^~~~~~~~~~~~~~~~
> Make them as  __maybe_unused to fix this.

Hi,

Do you know what configuration triggers these warnings? What has to be
disabled (e.g. CONFIG_OF)? Such information is useful in the commit
message.

Best regards,
Krzysztof
YueHaibing Sept. 1, 2020, 6:58 a.m. UTC | #2
On 2020/9/1 14:52, Krzysztof Kozlowski wrote:
> On Tue, Sep 01, 2020 at 11:56:42AM +0800, YueHaibing wrote:
>> drivers/memory/omap-gpmc.c:987:12: warning: ‘gpmc_cs_remap’ defined but not used [-Wunused-function]
>>  static int gpmc_cs_remap(int cs, u32 base)
>>             ^~~~~~~~~~~~~
>> drivers/memory/omap-gpmc.c:926:20: warning: ‘gpmc_cs_get_name’ defined but not used [-Wunused-function]
>>  static const char *gpmc_cs_get_name(int cs)
>>                     ^~~~~~~~~~~~~~~~
>> drivers/memory/omap-gpmc.c:919:13: warning: ‘gpmc_cs_set_name’ defined but not used [-Wunused-function]
>>  static void gpmc_cs_set_name(int cs, const char *name)
>>              ^~~~~~~~~~~~~~~~
>> Make them as  __maybe_unused to fix this.
> 
> Hi,
> 
> Do you know what configuration triggers these warnings? What has to be
> disabled (e.g. CONFIG_OF)? Such information is useful in the commit
> message.

Yes, this is triggered by disable CONFIG_OF, I will update the commit log.
> 
> Best regards,
> Krzysztof
> 
> .
>
diff mbox series

Patch

diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index ac0f577a51a1..24372254986e 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -916,14 +916,14 @@  static bool gpmc_cs_reserved(int cs)
 	return gpmc->flags & GPMC_CS_RESERVED;
 }
 
-static void gpmc_cs_set_name(int cs, const char *name)
+static void __maybe_unused gpmc_cs_set_name(int cs, const char *name)
 {
 	struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
 
 	gpmc->name = name;
 }
 
-static const char *gpmc_cs_get_name(int cs)
+static const __maybe_unused char *gpmc_cs_get_name(int cs)
 {
 	struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
 
@@ -984,7 +984,7 @@  static int gpmc_cs_delete_mem(int cs)
  * "base". Returns 0 on success and appropriate negative error code
  * on failure.
  */
-static int gpmc_cs_remap(int cs, u32 base)
+static int __maybe_unused gpmc_cs_remap(int cs, u32 base)
 {
 	int ret;
 	u32 old_base, size;