Skip to contentSkip to conversation

platform/x86: intel_pmc_ipc: Mark ipc_data_readb() as __maybe_unused

PATCH In review Matthias Kaehlcke 2 participants 2 messages May 25, 2017 – May 26, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: intel_pmc_ipc: Mark ipc_data_readb() as __maybe_unused

The function is currently not used, however it is part of the API and might be used in the future. Adding the attribute fixes the following warning when building with clang:

    drivers/platform/x86/intel_pmc_ipc.c:189:18: error: unused function
        'ipc_data_readb' [-Werror,-Wunused-function]
---
 drivers/platform/x86/intel_pmc_ipc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_pmc_ipc.c +1 -1
index e4d4dfe3e1d1..bb792a52248b 100644
@@ -186,7 +186,7 @@ static inline void ipc_data_writel(u32 data, u32 offset)
 	writel(data, ipcdev.ipc_base + IPC_WRITE_BUFFER + offset);
 }
 
-static inline u8 ipc_data_readb(u32 offset)
+static inline u8 __maybe_unused ipc_data_readb(u32 offset)
 {
 	return readb(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
 }
Signature · 1 line
2.13.0.219.gdb65acc882-goog
#1 lore raw
Quoted 7 lines · Matthias Kaehlcke

The function is currently not used, however it is part of the API and might be used in the future. Adding the attribute fixes the following warning when building with clang:

    drivers/platform/x86/intel_pmc_ipc.c:189:18: error: unused function
        'ipc_data_readb' [-Werror,-Wunused-function]

Pushed to testing, thanks!

Quoted 21 lines
---
 drivers/platform/x86/intel_pmc_ipc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_pmc_ipc.c +1 -2
index e4d4dfe3e1d1..bb792a52248b 100644
@@ -186,7 +186,7 @@ static inline void ipc_data_writel(u32 data, u32 offset)
        writel(data, ipcdev.ipc_base + IPC_WRITE_BUFFER + offset);
 }
 
-static inline u8 ipc_data_readb(u32 offset)
+static inline u8 __maybe_unused ipc_data_readb(u32 offset)
 {
        return readb(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
 }
--

2.13.0.219.gdb65acc882-goog

Signature · 2 lines
With Best Regards,
Andy Shevchenko