linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Loongson64: Fix build error about redeclaration of enumerator 'VIRTUAL' and "CONFIG_DM_THIN_PROVISIONING"
@ 2020-08-18 11:32 Youling Tang
  2020-08-18 12:44 ` Huacai Chen
  2020-08-19  5:47 ` WANG Xuerui
  0 siblings, 2 replies; 3+ messages in thread
From: Youling Tang @ 2020-08-18 11:32 UTC (permalink / raw)
  To: Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

After commit 39c1485c8baa (MIPS: KVM: Add kvm guestsupport for Loongson-3)

Fix the following build error:

drivers/md/dm-thin.c:116:2: error: redeclaration of enumerator ‘VIRTUAL’
  VIRTUAL,
  ^
In file included from ./arch/mips/include/asm/mach-loongson64/mmzone.h:12:0,
                 from ./arch/mips/include/asm/mmzone.h:12,
                 from ./include/linux/mmzone.h:962,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/slab.h:15,
                 from ./include/linux/genhd.h:16,
                 from ./include/linux/blkdev.h:8,
                 from drivers/md/persistent-data/dm-block-manager.h:11,
                 from drivers/md/dm-thin-metadata.h:10,
                 from drivers/md/dm-thin.c:7:
./arch/mips/include/asm/mach-loongson64/boot_param.h:198:2: note: previous
definition of ‘VIRTUAL’ was here VIRTUAL = 3
                                 ^
scripts/Makefile.build:283: recipe for target 'drivers/md/dm-thin.o' failed
make[2]: *** [drivers/md/dm-thin.o] Error 1

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
 arch/mips/include/asm/mach-loongson64/boot_param.h | 2 +-
 arch/mips/loongson64/env.c                         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
index afc92b7..a4ef4ac 100644
--- a/arch/mips/include/asm/mach-loongson64/boot_param.h
+++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
@@ -195,7 +195,7 @@ struct boot_params {
 enum loongson_bridge_type {
 	LS7A = 1,
 	RS780E = 2,
-	VIRTUAL = 3
+	VIRT = 3
 };
 
 struct loongson_system_configuration {
diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
index 134cb8e..623b3f1 100644
--- a/arch/mips/loongson64/env.c
+++ b/arch/mips/loongson64/env.c
@@ -180,8 +180,8 @@ void __init prom_init_env(void)
 		loongson_sysconf.early_config = rs780e_early_config;
 		break;
 	default:
-		pr_info("The bridge chip is VIRTUAL\n");
-		loongson_sysconf.bridgetype = VIRTUAL;
+		pr_info("The bridge chip is VIRT\n");
+		loongson_sysconf.bridgetype = VIRT;
 		loongson_sysconf.early_config = virtual_early_config;
 		loongson_fdt_blob = __dtb_loongson64v_4core_virtio_begin;
 		break;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Loongson64: Fix build error about redeclaration of enumerator 'VIRTUAL' and "CONFIG_DM_THIN_PROVISIONING"
  2020-08-18 11:32 [PATCH] MIPS: Loongson64: Fix build error about redeclaration of enumerator 'VIRTUAL' and "CONFIG_DM_THIN_PROVISIONING" Youling Tang
@ 2020-08-18 12:44 ` Huacai Chen
  2020-08-19  5:47 ` WANG Xuerui
  1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2020-08-18 12:44 UTC (permalink / raw)
  To: Youling Tang; +Cc: Jiaxun Yang, Thomas Bogendoerfer, open list:MIPS, LKML

Hi, Youling,

On Tue, Aug 18, 2020 at 7:35 PM Youling Tang <tangyouling@loongson.cn> wrote:
>
> After commit 39c1485c8baa (MIPS: KVM: Add kvm guestsupport for Loongson-3)
>
> Fix the following build error:
>
> drivers/md/dm-thin.c:116:2: error: redeclaration of enumerator ‘VIRTUAL’
>   VIRTUAL,
>   ^
> In file included from ./arch/mips/include/asm/mach-loongson64/mmzone.h:12:0,
>                  from ./arch/mips/include/asm/mmzone.h:12,
>                  from ./include/linux/mmzone.h:962,
>                  from ./include/linux/gfp.h:6,
>                  from ./include/linux/slab.h:15,
>                  from ./include/linux/genhd.h:16,
>                  from ./include/linux/blkdev.h:8,
>                  from drivers/md/persistent-data/dm-block-manager.h:11,
>                  from drivers/md/dm-thin-metadata.h:10,
>                  from drivers/md/dm-thin.c:7:
> ./arch/mips/include/asm/mach-loongson64/boot_param.h:198:2: note: previous
> definition of ‘VIRTUAL’ was here VIRTUAL = 3
>                                  ^
> scripts/Makefile.build:283: recipe for target 'drivers/md/dm-thin.o' failed
> make[2]: *** [drivers/md/dm-thin.o] Error 1
>
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
>  arch/mips/include/asm/mach-loongson64/boot_param.h | 2 +-
>  arch/mips/loongson64/env.c                         | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
> index afc92b7..a4ef4ac 100644
> --- a/arch/mips/include/asm/mach-loongson64/boot_param.h
> +++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
> @@ -195,7 +195,7 @@ struct boot_params {
>  enum loongson_bridge_type {
>         LS7A = 1,
>         RS780E = 2,
> -       VIRTUAL = 3
> +       VIRT = 3
>  };
Thank you for your patch, but I think this problem is because of
invalid .h file inclusion (arch-dependent .h file should not be
included in drivers), and Xuerui Wang has investigated it for some
time. He has a draft patch (haven't sent yet) which I think is a
better way. So, please wait some time.

Huacai
>
>  struct loongson_system_configuration {
> diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
> index 134cb8e..623b3f1 100644
> --- a/arch/mips/loongson64/env.c
> +++ b/arch/mips/loongson64/env.c
> @@ -180,8 +180,8 @@ void __init prom_init_env(void)
>                 loongson_sysconf.early_config = rs780e_early_config;
>                 break;
>         default:
> -               pr_info("The bridge chip is VIRTUAL\n");
> -               loongson_sysconf.bridgetype = VIRTUAL;
> +               pr_info("The bridge chip is VIRT\n");
> +               loongson_sysconf.bridgetype = VIRT;
>                 loongson_sysconf.early_config = virtual_early_config;
>                 loongson_fdt_blob = __dtb_loongson64v_4core_virtio_begin;
>                 break;
> --
> 2.1.0
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] MIPS: Loongson64: Fix build error about redeclaration of enumerator 'VIRTUAL' and "CONFIG_DM_THIN_PROVISIONING"
  2020-08-18 11:32 [PATCH] MIPS: Loongson64: Fix build error about redeclaration of enumerator 'VIRTUAL' and "CONFIG_DM_THIN_PROVISIONING" Youling Tang
  2020-08-18 12:44 ` Huacai Chen
@ 2020-08-19  5:47 ` WANG Xuerui
  1 sibling, 0 replies; 3+ messages in thread
From: WANG Xuerui @ 2020-08-19  5:47 UTC (permalink / raw)
  To: Youling Tang, Huacai Chen, Jiaxun Yang, Thomas Bogendoerfer
  Cc: linux-mips, linux-kernel

Hi Youling,


On 2020/8/18 19:32, Youling Tang wrote:
> After commit 39c1485c8baa (MIPS: KVM: Add kvm guestsupport for Loongson-3)
>
> Fix the following build error:
>
> drivers/md/dm-thin.c:116:2: error: redeclaration of enumerator ‘VIRTUAL’
>   VIRTUAL,
>   ^
> In file included from ./arch/mips/include/asm/mach-loongson64/mmzone.h:12:0,
>                  from ./arch/mips/include/asm/mmzone.h:12,
>                  from ./include/linux/mmzone.h:962,
>                  from ./include/linux/gfp.h:6,
>                  from ./include/linux/slab.h:15,
>                  from ./include/linux/genhd.h:16,
>                  from ./include/linux/blkdev.h:8,
>                  from drivers/md/persistent-data/dm-block-manager.h:11,
>                  from drivers/md/dm-thin-metadata.h:10,
>                  from drivers/md/dm-thin.c:7:
> ./arch/mips/include/asm/mach-loongson64/boot_param.h:198:2: note: previous
> definition of ‘VIRTUAL’ was here VIRTUAL = 3
>                                  ^
> scripts/Makefile.build:283: recipe for target 'drivers/md/dm-thin.o' failed
> make[2]: *** [drivers/md/dm-thin.o] Error 1
>
> Signed-off-by: Youling Tang <tangyouling@loongson.cn>
> ---
>  arch/mips/include/asm/mach-loongson64/boot_param.h | 2 +-
>  arch/mips/loongson64/env.c                         | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
> index afc92b7..a4ef4ac 100644
> --- a/arch/mips/include/asm/mach-loongson64/boot_param.h
> +++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
> @@ -195,7 +195,7 @@ struct boot_params {
>  enum loongson_bridge_type {
>  	LS7A = 1,
>  	RS780E = 2,
> -	VIRTUAL = 3
> +	VIRT = 3

I believe this is only masking the root cause, which is redundant
#include directives inside mach-specific headers. I'll send my version
of fix shortly.

Anyway, thanks for your help!

>  };
>  
>  struct loongson_system_configuration {
> diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
> index 134cb8e..623b3f1 100644
> --- a/arch/mips/loongson64/env.c
> +++ b/arch/mips/loongson64/env.c
> @@ -180,8 +180,8 @@ void __init prom_init_env(void)
>  		loongson_sysconf.early_config = rs780e_early_config;
>  		break;
>  	default:
> -		pr_info("The bridge chip is VIRTUAL\n");
> -		loongson_sysconf.bridgetype = VIRTUAL;
> +		pr_info("The bridge chip is VIRT\n");
> +		loongson_sysconf.bridgetype = VIRT;
>  		loongson_sysconf.early_config = virtual_early_config;
>  		loongson_fdt_blob = __dtb_loongson64v_4core_virtio_begin;
>  		break;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-19  5:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 11:32 [PATCH] MIPS: Loongson64: Fix build error about redeclaration of enumerator 'VIRTUAL' and "CONFIG_DM_THIN_PROVISIONING" Youling Tang
2020-08-18 12:44 ` Huacai Chen
2020-08-19  5:47 ` WANG Xuerui

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).