Skip to contentSkip to conversation

platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb()

PATCH In review Matthias Kaehlcke 3 participants 4 messages May 23, 2017 – May 25, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb()

The function was added by commit 0a8b83530b6f ("intel_pmc_ipc: Add Intel Apollo Lake PMC IPC driver") in 2015 and hasn't been used since then. Removing it 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 | 5 -----
 1 file changed, 5 deletions(-)
drivers/platform/x86/intel_pmc_ipc.c +0 -5
index e4d4dfe3e1d1..aa2fd58b75c4 100644
@@ -186,11 +186,6 @@ 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)
-{
-	return readb(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
-}
-
 static inline u32 ipc_data_readl(u32 offset)
 {
 	return readl(ipcdev.ipc_base + IPC_READ_BUFFER + offset);
Signature · 1 line
2.13.0.219.gdb65acc882-goog
#1 lore raw
Quoted 6 lines · On Tue, 23 May 2017 13:55:39 -0700 Matthias Kaehlcke <[email protected]> wrote:

The function was added by commit 0a8b83530b6f ("intel_pmc_ipc: Add Intel Apollo Lake PMC IPC driver") in 2015 and hasn't been used since then. Removing it 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]

It is however also part of the API and a consistent sensible function to have present should it be needed. As it's static it's eliminated correctly by gcc.

I'm all for eliminating unused functions but in this case I have to wonder

Alan

#2 lore raw

Hi,

Quoted 7 lines · Alan Cox
Quoted 4 lines · On Tue, 23 May 2017 13:55:39 -0700 Matthias Kaehlcke <[email protected]> wrote:

The function was added by commit 0a8b83530b6f ("intel_pmc_ipc: Add Intel Apollo Lake PMC IPC driver") in 2015 and hasn't been used since then. Removing it fixes the following warning when building with clang:

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

It is however also part of the API and a consistent sensible function to have present should it be needed. As it's static it's eliminated correctly by gcc.

I'm all for eliminating unused functions but in this case I have to wonder

If it's a useful function to have present, it seems like adding "__maybe_unused" makes sense, as Matthias did in
<https://patchwork.kernel.org/patch/9732009/>. Would that work for you?

-Doug

#3 lore raw
Quoted 17 lines · On Wed, 24 May 2017 08:39:29 -0700 Doug Anderson <[email protected]> wrote:

Hi,

Quoted 14 lines · Alan Cox
Quoted 6 lines · On Tue, 23 May 2017 13:55:39 -0700 Matthias Kaehlcke <[email protected]> wrote:

The function was added by commit 0a8b83530b6f ("intel_pmc_ipc: Add Intel Apollo Lake PMC IPC driver") in 2015 and hasn't been used since then. Removing it 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]  

It is however also part of the API and a consistent sensible function to have present should it be needed. As it's static it's eliminated correctly by gcc.

Quoted 7 lines
Quoted 1 line

I'm all for eliminating unused functions but in this case I have to wonder

If it's a useful function to have present, it seems like adding "__maybe_unused" makes sense, as Matthias did in
<https://patchwork.kernel.org/patch/9732009/>. Would that work for you?

Yep

Alan