diff mbox series

[v2,09/11] powerpc/platforms: Move files from 4xx to 44x

Message ID 50d0ce1a96fa978cd0dfabde30cf75d23691622a.1585640942.git.christophe.leroy@c-s.fr (mailing list archive)
State Superseded
Headers show
Series [v2,01/11] powerpc: Mark 4xx as Orphan in MAINTAINERS | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (c6624071c338732402e8c726df6a4074473eaa0e)
snowpatch_ozlabs/checkpatch warning total: 0 errors, 3 warnings, 2 checks, 44 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Christophe Leroy March 31, 2020, 7:49 a.m. UTC
Only 44x uses 4xx now, so only keep one directory.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 arch/powerpc/platforms/44x/Makefile           |  9 +++++++-
 arch/powerpc/platforms/{4xx => 44x}/cpm.c     |  0
 arch/powerpc/platforms/{4xx => 44x}/gpio.c    |  0
 .../powerpc/platforms/{4xx => 44x}/hsta_msi.c |  0
 arch/powerpc/platforms/44x/machine_check.c    | 14 +++++++++++
 arch/powerpc/platforms/{4xx => 44x}/msi.c     |  0
 arch/powerpc/platforms/{4xx => 44x}/pci.c     |  0
 arch/powerpc/platforms/{4xx => 44x}/pci.h     |  0
 arch/powerpc/platforms/{4xx => 44x}/soc.c     |  0
 arch/powerpc/platforms/{4xx => 44x}/uic.c     |  0
 arch/powerpc/platforms/4xx/Makefile           |  8 -------
 arch/powerpc/platforms/4xx/machine_check.c    | 23 -------------------
 arch/powerpc/platforms/Makefile               |  2 +-
 13 files changed, 23 insertions(+), 33 deletions(-)
 rename arch/powerpc/platforms/{4xx => 44x}/cpm.c (100%)
 rename arch/powerpc/platforms/{4xx => 44x}/gpio.c (100%)
 rename arch/powerpc/platforms/{4xx => 44x}/hsta_msi.c (100%)
 rename arch/powerpc/platforms/{4xx => 44x}/msi.c (100%)
 rename arch/powerpc/platforms/{4xx => 44x}/pci.c (100%)
 rename arch/powerpc/platforms/{4xx => 44x}/pci.h (100%)
 rename arch/powerpc/platforms/{4xx => 44x}/soc.c (100%)
 rename arch/powerpc/platforms/{4xx => 44x}/uic.c (100%)
 delete mode 100644 arch/powerpc/platforms/4xx/Makefile
 delete mode 100644 arch/powerpc/platforms/4xx/machine_check.c

Comments

Arnd Bergmann March 31, 2020, 3:14 p.m. UTC | #1
On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
>
> Only 44x uses 4xx now, so only keep one directory.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
>  arch/powerpc/platforms/44x/Makefile           |  9 +++++++-
>  arch/powerpc/platforms/{4xx => 44x}/cpm.c     |  0

No objections to moving everything into one place, but I wonder if the
combined name should be 4xx instead of 44x, given that 44x currently
include 46x and 47x. OTOH your approach has the advantage of
moving fewer files.

       Arnd
Christophe Leroy March 31, 2020, 3:26 p.m. UTC | #2
Le 31/03/2020 à 17:14, Arnd Bergmann a écrit :
> On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
>>
>> Only 44x uses 4xx now, so only keep one directory.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> ---
>>   arch/powerpc/platforms/44x/Makefile           |  9 +++++++-
>>   arch/powerpc/platforms/{4xx => 44x}/cpm.c     |  0
> 
> No objections to moving everything into one place, but I wonder if the
> combined name should be 4xx instead of 44x, given that 44x currently
> include 46x and 47x. OTOH your approach has the advantage of
> moving fewer files.
> 

In that case, should we also rename CONFIG_44x to CONFIG_4xx ?

Christophe
Arnd Bergmann March 31, 2020, 4:04 p.m. UTC | #3
On Tue, Mar 31, 2020 at 5:26 PM Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> Le 31/03/2020 à 17:14, Arnd Bergmann a écrit :
> > On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy
> > <christophe.leroy@c-s.fr> wrote:
> >>
> >> Only 44x uses 4xx now, so only keep one directory.
> >>
> >> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> >> ---
> >>   arch/powerpc/platforms/44x/Makefile           |  9 +++++++-
> >>   arch/powerpc/platforms/{4xx => 44x}/cpm.c     |  0
> >
> > No objections to moving everything into one place, but I wonder if the
> > combined name should be 4xx instead of 44x, given that 44x currently
> > include 46x and 47x. OTOH your approach has the advantage of
> > moving fewer files.
> >
>
> In that case, should we also rename CONFIG_44x to CONFIG_4xx ?

That has the risk of breaking user's defconfig files, but given the
small number of users, it may be nicer for consistency. In either
case, the two symbols should probably hang around as synonyms,
the question is just which one is user visible.

       Arnd
Christophe Leroy March 31, 2020, 4:19 p.m. UTC | #4
Le 31/03/2020 à 18:04, Arnd Bergmann a écrit :
> On Tue, Mar 31, 2020 at 5:26 PM Christophe Leroy
> <christophe.leroy@c-s.fr> wrote:
>> Le 31/03/2020 à 17:14, Arnd Bergmann a écrit :
>>> On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy
>>> <christophe.leroy@c-s.fr> wrote:
>>>>
>>>> Only 44x uses 4xx now, so only keep one directory.
>>>>
>>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>>>> ---
>>>>    arch/powerpc/platforms/44x/Makefile           |  9 +++++++-
>>>>    arch/powerpc/platforms/{4xx => 44x}/cpm.c     |  0
>>>
>>> No objections to moving everything into one place, but I wonder if the
>>> combined name should be 4xx instead of 44x, given that 44x currently
>>> include 46x and 47x. OTOH your approach has the advantage of
>>> moving fewer files.
>>>
>>
>> In that case, should we also rename CONFIG_44x to CONFIG_4xx ?
> 
> That has the risk of breaking user's defconfig files, but given the
> small number of users, it may be nicer for consistency. In either
> case, the two symbols should probably hang around as synonyms,
> the question is just which one is user visible.
> 

Not sure it is a good idea to keep two synonyms. In the past we made our 
best to remove synonyms (We had CONFIG_8xx and CONFIG_PPC_8xx being 
synonyms, we had CONFIG_6xx and CONFIG_BOOK3S_32 and 
CONFIG_PPC_STD_MMU_32 being synonyms).
I think it is a lot cleaner when we can avoid synonyms.

By the way I already dropped CONFIG_4xx in previous patch (8/11). It was 
not many 4xx changed to 44x. It would be a lot more in the other way 
round I'm afraid.

But I agree with you it might be more natural to change to 4xx.

Michael, any preference ?

Christophe
Arnd Bergmann March 31, 2020, 6:38 p.m. UTC | #5
On Tue, Mar 31, 2020 at 6:19 PM Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> Le 31/03/2020 à 18:04, Arnd Bergmann a écrit :
> > That has the risk of breaking user's defconfig files, but given the
> > small number of users, it may be nicer for consistency. In either
> > case, the two symbols should probably hang around as synonyms,
> > the question is just which one is user visible.
> >
>
> Not sure it is a good idea to keep two synonyms. In the past we made our
> best to remove synonyms (We had CONFIG_8xx and CONFIG_PPC_8xx being
> synonyms, we had CONFIG_6xx and CONFIG_BOOK3S_32 and
> CONFIG_PPC_STD_MMU_32 being synonyms).
> I think it is a lot cleaner when we can avoid synonyms.

Ok, fair enough.

> By the way I already dropped CONFIG_4xx in previous patch (8/11). It was
> not many 4xx changed to 44x. It would be a lot more in the other way
> round I'm afraid.

Right. Maybe stay with 44x for both then (as in your current patches), as it
means changing less in a part of the code that has few users anyway.

      Arnd
Michael Ellerman April 1, 2020, 2:20 a.m. UTC | #6
Christophe Leroy <christophe.leroy@c-s.fr> writes:
> Le 31/03/2020 à 18:04, Arnd Bergmann a écrit :
>> On Tue, Mar 31, 2020 at 5:26 PM Christophe Leroy
>> <christophe.leroy@c-s.fr> wrote:
>>> Le 31/03/2020 à 17:14, Arnd Bergmann a écrit :
>>>> On Tue, Mar 31, 2020 at 9:49 AM Christophe Leroy
>>>> <christophe.leroy@c-s.fr> wrote:
>>>>>
>>>>> Only 44x uses 4xx now, so only keep one directory.
>>>>>
>>>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>>>>> ---
>>>>>    arch/powerpc/platforms/44x/Makefile           |  9 +++++++-
>>>>>    arch/powerpc/platforms/{4xx => 44x}/cpm.c     |  0
>>>>
>>>> No objections to moving everything into one place, but I wonder if the
>>>> combined name should be 4xx instead of 44x, given that 44x currently
>>>> include 46x and 47x. OTOH your approach has the advantage of
>>>> moving fewer files.
>>>>
>>>
>>> In that case, should we also rename CONFIG_44x to CONFIG_4xx ?
>> 
>> That has the risk of breaking user's defconfig files, but given the
>> small number of users, it may be nicer for consistency. In either
>> case, the two symbols should probably hang around as synonyms,
>> the question is just which one is user visible.
>> 
>
> Not sure it is a good idea to keep two synonyms. In the past we made our 
> best to remove synonyms (We had CONFIG_8xx and CONFIG_PPC_8xx being 
> synonyms, we had CONFIG_6xx and CONFIG_BOOK3S_32 and 
> CONFIG_PPC_STD_MMU_32 being synonyms).
> I think it is a lot cleaner when we can avoid synonyms.
>
> By the way I already dropped CONFIG_4xx in previous patch (8/11). It was 
> not many 4xx changed to 44x. It would be a lot more in the other way 
> round I'm afraid.
>
> But I agree with you it might be more natural to change to 4xx.
>
> Michael, any preference ?

I'd say just use 44x, we've had the inconsistency of 476 living in
platforms/44x, and it hasn't really led to much confusion.

I think for most folks they see 4xx/44x and just think "some 32-bit
embedded thing", so the precise distinction between 4xx, 44x, 476 etc.
is not that important to justify renaming the symbol everywhere I think.

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 5ba031f57652..ce6989a70b99 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -1,5 +1,5 @@ 
 # SPDX-License-Identifier: GPL-2.0
-obj-y	+= misc_44x.o machine_check.o
+obj-y	+= misc_44x.o machine_check.o uic.o
 ifneq ($(CONFIG_PPC4xx_CPM),y)
 obj-y	+= idle.o
 endif
@@ -12,3 +12,10 @@  obj-$(CONFIG_CANYONLANDS)+= canyonlands.o
 obj-$(CONFIG_CURRITUCK)	+= ppc476.o
 obj-$(CONFIG_AKEBONO)	+= ppc476.o
 obj-$(CONFIG_FSP2)	+= fsp2.o
+
+obj-$(CONFIG_4xx_SOC)		+= soc.o
+obj-$(CONFIG_PCI)		+= pci.o
+obj-$(CONFIG_PPC4xx_HSTA_MSI)	+= hsta_msi.o
+obj-$(CONFIG_PPC4xx_MSI)	+= msi.o
+obj-$(CONFIG_PPC4xx_CPM)	+= cpm.o
+obj-$(CONFIG_PPC4xx_GPIO)	+= gpio.o
diff --git a/arch/powerpc/platforms/4xx/cpm.c b/arch/powerpc/platforms/44x/cpm.c
similarity index 100%
rename from arch/powerpc/platforms/4xx/cpm.c
rename to arch/powerpc/platforms/44x/cpm.c
diff --git a/arch/powerpc/platforms/4xx/gpio.c b/arch/powerpc/platforms/44x/gpio.c
similarity index 100%
rename from arch/powerpc/platforms/4xx/gpio.c
rename to arch/powerpc/platforms/44x/gpio.c
diff --git a/arch/powerpc/platforms/4xx/hsta_msi.c b/arch/powerpc/platforms/44x/hsta_msi.c
similarity index 100%
rename from arch/powerpc/platforms/4xx/hsta_msi.c
rename to arch/powerpc/platforms/44x/hsta_msi.c
diff --git a/arch/powerpc/platforms/44x/machine_check.c b/arch/powerpc/platforms/44x/machine_check.c
index 90ad6ac529d2..bd46c729478d 100644
--- a/arch/powerpc/platforms/44x/machine_check.c
+++ b/arch/powerpc/platforms/44x/machine_check.c
@@ -8,6 +8,20 @@ 
 
 #include <asm/reg.h>
 
+int machine_check_4xx(struct pt_regs *regs)
+{
+	unsigned long reason = regs->dsisr;
+
+	if (reason & ESR_IMCP) {
+		printk("Instruction");
+		mtspr(SPRN_ESR, reason & ~ESR_IMCP);
+	} else
+		printk("Data");
+	printk(" machine check in kernel mode.\n");
+
+	return 0;
+}
+
 int machine_check_440A(struct pt_regs *regs)
 {
 	unsigned long reason = regs->dsisr;
diff --git a/arch/powerpc/platforms/4xx/msi.c b/arch/powerpc/platforms/44x/msi.c
similarity index 100%
rename from arch/powerpc/platforms/4xx/msi.c
rename to arch/powerpc/platforms/44x/msi.c
diff --git a/arch/powerpc/platforms/4xx/pci.c b/arch/powerpc/platforms/44x/pci.c
similarity index 100%
rename from arch/powerpc/platforms/4xx/pci.c
rename to arch/powerpc/platforms/44x/pci.c
diff --git a/arch/powerpc/platforms/4xx/pci.h b/arch/powerpc/platforms/44x/pci.h
similarity index 100%
rename from arch/powerpc/platforms/4xx/pci.h
rename to arch/powerpc/platforms/44x/pci.h
diff --git a/arch/powerpc/platforms/4xx/soc.c b/arch/powerpc/platforms/44x/soc.c
similarity index 100%
rename from arch/powerpc/platforms/4xx/soc.c
rename to arch/powerpc/platforms/44x/soc.c
diff --git a/arch/powerpc/platforms/4xx/uic.c b/arch/powerpc/platforms/44x/uic.c
similarity index 100%
rename from arch/powerpc/platforms/4xx/uic.c
rename to arch/powerpc/platforms/44x/uic.c
diff --git a/arch/powerpc/platforms/4xx/Makefile b/arch/powerpc/platforms/4xx/Makefile
deleted file mode 100644
index d009d2e0b9e8..000000000000
--- a/arch/powerpc/platforms/4xx/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@ 
-# SPDX-License-Identifier: GPL-2.0-only
-obj-y				+= uic.o machine_check.o
-obj-$(CONFIG_4xx_SOC)		+= soc.o
-obj-$(CONFIG_PCI)		+= pci.o
-obj-$(CONFIG_PPC4xx_HSTA_MSI)	+= hsta_msi.o
-obj-$(CONFIG_PPC4xx_MSI)	+= msi.o
-obj-$(CONFIG_PPC4xx_CPM)	+= cpm.o
-obj-$(CONFIG_PPC4xx_GPIO)	+= gpio.o
diff --git a/arch/powerpc/platforms/4xx/machine_check.c b/arch/powerpc/platforms/4xx/machine_check.c
deleted file mode 100644
index a71c29892a91..000000000000
--- a/arch/powerpc/platforms/4xx/machine_check.c
+++ /dev/null
@@ -1,23 +0,0 @@ 
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- */
-
-#include <linux/kernel.h>
-#include <linux/printk.h>
-#include <linux/ptrace.h>
-
-#include <asm/reg.h>
-
-int machine_check_4xx(struct pt_regs *regs)
-{
-	unsigned long reason = regs->dsisr;
-
-	if (reason & ESR_IMCP) {
-		printk("Instruction");
-		mtspr(SPRN_ESR, reason & ~ESR_IMCP);
-	} else
-		printk("Data");
-	printk(" machine check in kernel mode.\n");
-
-	return 0;
-}
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index f67b7fabac4e..5621cd0edfab 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -4,7 +4,7 @@  obj-$(CONFIG_FSL_ULI1575)	+= fsl_uli1575.o
 
 obj-$(CONFIG_PPC_PMAC)		+= powermac/
 obj-$(CONFIG_PPC_CHRP)		+= chrp/
-obj-$(CONFIG_44x)		+= 4xx/ 44x/
+obj-$(CONFIG_44x)		+= 44x/
 obj-$(CONFIG_PPC_MPC512x)	+= 512x/
 obj-$(CONFIG_PPC_MPC52xx)	+= 52xx/
 obj-$(CONFIG_PPC_8xx)		+= 8xx/