* [PATCH] platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb()
@ 2017-05-23 20:55 Matthias Kaehlcke
2017-05-24 13:39 ` Alan Cox
0 siblings, 1 reply; 4+ messages in thread
From: Matthias Kaehlcke @ 2017-05-23 20:55 UTC (permalink / raw)
To: Zha Qipeng, Darren Hart, Andy Shevchenko
Cc: linux-kernel, platform-driver-x86, Douglas Anderson, Matthias Kaehlcke
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]
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
drivers/platform/x86/intel_pmc_ipc.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/platform/x86/intel_pmc_ipc.c b/drivers/platform/x86/intel_pmc_ipc.c
index e4d4dfe3e1d1..aa2fd58b75c4 100644
--- a/drivers/platform/x86/intel_pmc_ipc.c
+++ b/drivers/platform/x86/intel_pmc_ipc.c
@@ -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);
--
2.13.0.219.gdb65acc882-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb()
2017-05-23 20:55 [PATCH] platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb() Matthias Kaehlcke
@ 2017-05-24 13:39 ` Alan Cox
2017-05-24 15:39 ` Doug Anderson
0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2017-05-24 13:39 UTC (permalink / raw)
To: Matthias Kaehlcke
Cc: Zha Qipeng, Darren Hart, Andy Shevchenko, linux-kernel,
platform-driver-x86, Douglas Anderson
On Tue, 23 May 2017 13:55:39 -0700
Matthias Kaehlcke <mka@chromium.org> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb()
2017-05-24 13:39 ` Alan Cox
@ 2017-05-24 15:39 ` Doug Anderson
2017-05-25 13:26 ` Alan Cox
0 siblings, 1 reply; 4+ messages in thread
From: Doug Anderson @ 2017-05-24 15:39 UTC (permalink / raw)
To: Alan Cox
Cc: Matthias Kaehlcke, Zha Qipeng, Darren Hart, Andy Shevchenko,
linux-kernel, platform-driver-x86
Hi,
On Wed, May 24, 2017 at 6:39 AM, Alan Cox <gnomes@lxorguk.ukuu.org.uk> wrote:
> On Tue, 23 May 2017 13:55:39 -0700
> Matthias Kaehlcke <mka@chromium.org> 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
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb()
2017-05-24 15:39 ` Doug Anderson
@ 2017-05-25 13:26 ` Alan Cox
0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2017-05-25 13:26 UTC (permalink / raw)
To: Doug Anderson
Cc: Matthias Kaehlcke, Zha Qipeng, Darren Hart, Andy Shevchenko,
linux-kernel, platform-driver-x86
On Wed, 24 May 2017 08:39:29 -0700
Doug Anderson <dianders@chromium.org> wrote:
> Hi,
>
> On Wed, May 24, 2017 at 6:39 AM, Alan Cox <gnomes@lxorguk.ukuu.org.uk> wrote:
> > On Tue, 23 May 2017 13:55:39 -0700
> > Matthias Kaehlcke <mka@chromium.org> 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
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-25 13:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-23 20:55 [PATCH] platform/x86: intel_pmc_ipc: Delete unused function ipc_data_readb() Matthias Kaehlcke
2017-05-24 13:39 ` Alan Cox
2017-05-24 15:39 ` Doug Anderson
2017-05-25 13:26 ` Alan Cox
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).