diff mbox series

[05/13] ARM: imx: remove unused mx25_revision()

Message ID 20230516153109.514251-6-arnd@kernel.org (mailing list archive)
State Superseded
Headers show
Series ARM: SoC: address -Wmissing-prototype warnings | expand

Commit Message

Arnd Bergmann May 16, 2023, 3:31 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

This function has no prototype and no callers:

arm/mach-imx/cpu-imx25.c:43:5: error: no previous prototype for 'mx25_revision' [-Werror=missing-prototypes]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-imx/Makefile    |  2 +-
 arch/arm/mach-imx/cpu-imx25.c | 50 -----------------------------------
 2 files changed, 1 insertion(+), 51 deletions(-)
 delete mode 100644 arch/arm/mach-imx/cpu-imx25.c

Comments

Fabio Estevam May 16, 2023, 11:34 p.m. UTC | #1
Hi Arnd,

On Tue, May 16, 2023 at 12:32 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> This function has no prototype and no callers:
>
> arm/mach-imx/cpu-imx25.c:43:5: error: no previous prototype for 'mx25_revision' [-Werror=missing-prototypes]
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Martin Kaiser sent a patch adding a user for this function:

https://lore.kernel.org/linux-arm-kernel/20220815190748.102664-2-martin@kaiser.cx/

It would be better to apply Martin's patch instead of removing mx25_revision().

Thanks
Arnd Bergmann May 17, 2023, 6:39 a.m. UTC | #2
On Wed, May 17, 2023, at 01:34, Fabio Estevam wrote:
> On Tue, May 16, 2023 at 12:32 PM Arnd Bergmann <arnd@kernel.org> wrote:
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> This function has no prototype and no callers:
>>
>> arm/mach-imx/cpu-imx25.c:43:5: error: no previous prototype for 'mx25_revision' [-Werror=missing-prototypes]
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Martin Kaiser sent a patch adding a user for this function:
>
> https://lore.kernel.org/linux-arm-kernel/20220815190748.102664-2-martin@kaiser.cx/
>
> It would be better to apply Martin's patch instead of removing mx25_revision().

I think either way is ok to address the warning. If we wanted to do this
properly, the mx{25,27,31,35,5}_revision functions could all be removed
and the logic hooked up to imx_set_soc_revision() in the same way that
they already use mxc_set_cpu_type() for drivers/soc/imx/soc-imx.c.

I'll leave it up to you, if you want to merge Martin's patches or
a replacement for the soc-imx driver through the imx tree for 6.5,
I'll drop my patch from this series, otherwise I'll keep it for now
and we can still do it better at later point.

    Arnd
Martin Kaiser May 17, 2023, 3:45 p.m. UTC | #3
Thus wrote Arnd Bergmann (arnd@arndb.de):

> I think either way is ok to address the warning. If we wanted to do this
> properly, the mx{25,27,31,35,5}_revision functions could all be removed
> and the logic hooked up to imx_set_soc_revision() in the same way that
> they already use mxc_set_cpu_type() for drivers/soc/imx/soc-imx.c.

> I'll leave it up to you, if you want to merge Martin's patches or
> a replacement for the soc-imx driver through the imx tree for 6.5,
> I'll drop my patch from this series, otherwise I'll keep it for now
> and we can still do it better at later point.

I suggest we merge my patches for imx25 first and then clean up all the
older imx families to use the common functions.

I've just rebased the patches against today's linux-next. My understanding
is that they have to go through the clk tree.

Thanks,
Martin
Arnd Bergmann July 28, 2023, 3:59 p.m. UTC | #4
On Wed, May 17, 2023, at 17:45, Martin Kaiser wrote:
> Thus wrote Arnd Bergmann (arnd@arndb.de):
>
>> I think either way is ok to address the warning. If we wanted to do this
>> properly, the mx{25,27,31,35,5}_revision functions could all be removed
>> and the logic hooked up to imx_set_soc_revision() in the same way that
>> they already use mxc_set_cpu_type() for drivers/soc/imx/soc-imx.c.
>
>> I'll leave it up to you, if you want to merge Martin's patches or
>> a replacement for the soc-imx driver through the imx tree for 6.5,
>> I'll drop my patch from this series, otherwise I'll keep it for now
>> and we can still do it better at later point.
>
> I suggest we merge my patches for imx25 first and then clean up all the
> older imx families to use the common functions.
>
> I've just rebased the patches against today's linux-next. My understanding
> is that they have to go through the clk tree.

This never happened, right? I see that mx25_revision() is still in the
tree without any users, so I can't easily turn on the warning by default
yet. Should I just go ahead and remove it for 5.6, or do you expect to
have your patch ready in time for the merge window?

       Arnd
Martin Kaiser July 30, 2023, 4:26 p.m. UTC | #5
Hi Arnd,

Arnd Bergmann (arnd@arndb.de) wrote:

> >> I'll leave it up to you, if you want to merge Martin's patches or
> >> a replacement for the soc-imx driver through the imx tree for 6.5,
> >> I'll drop my patch from this series, otherwise I'll keep it for now
> >> and we can still do it better at later point.

> > I suggest we merge my patches for imx25 first and then clean up all the
> > older imx families to use the common functions.

> > I've just rebased the patches against today's linux-next. My understanding
> > is that they have to go through the clk tree.

> This never happened, right? I see that mx25_revision() is still in the
> tree without any users, so I can't easily turn on the warning by default
> yet. Should I just go ahead and remove it for 5.6, or do you expect to
> have your patch ready in time for the merge window?

sorry for delaying your series.

So far, there's been no response to my patches from the clk maintainers.
Let me resend the patches one final time. If we don't hear anything back
within a week or so, feel free to remove mx25_revision (and probably all
of arch/arm/mach-imx/cpu-imx25.c) for the 6.6 merge window.

Thanks,
Martin
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 5c650bf40e02..35a99888f54a 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -1,7 +1,7 @@ 
 # SPDX-License-Identifier: GPL-2.0
 obj-y := cpu.o system.o irq-common.o
 
-obj-$(CONFIG_SOC_IMX25) += cpu-imx25.o mach-imx25.o pm-imx25.o
+obj-$(CONFIG_SOC_IMX25) += mach-imx25.o pm-imx25.o
 
 obj-$(CONFIG_SOC_IMX27) += cpu-imx27.o pm-imx27.o mach-imx27.o
 
diff --git a/arch/arm/mach-imx/cpu-imx25.c b/arch/arm/mach-imx/cpu-imx25.c
deleted file mode 100644
index cc86977d0a34..000000000000
--- a/arch/arm/mach-imx/cpu-imx25.c
+++ /dev/null
@@ -1,50 +0,0 @@ 
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * MX25 CPU type detection
- *
- * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved
- */
-#include <linux/module.h>
-#include <linux/io.h>
-#include <linux/of.h>
-#include <linux/of_address.h>
-
-#include "iim.h"
-#include "hardware.h"
-
-static int mx25_cpu_rev = -1;
-
-static int mx25_read_cpu_rev(void)
-{
-	u32 rev;
-	void __iomem *iim_base;
-	struct device_node *np;
-
-	np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim");
-	iim_base = of_iomap(np, 0);
-	of_node_put(np);
-	BUG_ON(!iim_base);
-	rev = readl(iim_base + MXC_IIMSREV);
-	iounmap(iim_base);
-
-	switch (rev) {
-	case 0x00:
-		return IMX_CHIP_REVISION_1_0;
-	case 0x01:
-		return IMX_CHIP_REVISION_1_1;
-	case 0x02:
-		return IMX_CHIP_REVISION_1_2;
-	default:
-		return IMX_CHIP_REVISION_UNKNOWN;
-	}
-}
-
-int mx25_revision(void)
-{
-	if (mx25_cpu_rev == -1)
-		mx25_cpu_rev = mx25_read_cpu_rev();
-
-	return mx25_cpu_rev;
-}
-EXPORT_SYMBOL(mx25_revision);