Skip to contentSkip to conversation

perf: riscv: fix broken build due to struct redefinition

PATCH In review Conor Dooley 3 participants 5 messages Aug 12, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: riscv: fix broken build due to struct redefinition

Building riscv/for-next produces following error:
drivers/perf/riscv_pmu_sbi.c:44:7: error: redefinition of 'sbi_pmu_ctr_info'

union sbi_pmu_ctr_info {
      ^

arch/riscv/include/asm/sbi.h:125:7: note: previous definition is here union sbi_pmu_ctr_info {

This appears to have been caused by a merge conflict resolution between riscv/for-next & riscv/fixes, causing the struct define not being properly moved to its header.

Fixes 9a7ccac63f9c ("perf: riscv_pmu{,_sbi}: Miscallenous improvement & fixes")
---
 drivers/perf/riscv_pmu_sbi.c | 14 --------------
 1 file changed, 14 deletions(-)
drivers/perf/riscv_pmu_sbi.c +0 -14
index e7c6fecbf061..6f6681bbfd36 100644
@@ -41,20 +41,6 @@ static const struct attribute_group *riscv_pmu_attr_groups[] = {
 	NULL,
 };
 
-union sbi_pmu_ctr_info {
-	unsigned long value;
-	struct {
-		unsigned long csr:12;
-		unsigned long width:6;
-#if __riscv_xlen == 32
-		unsigned long reserved:13;
-#else
-		unsigned long reserved:45;
-#endif
-		unsigned long type:1;
-	};
-};
-
 /*
  * RISC-V doesn't have hetergenous harts yet. This need to be part of
  * per_cpu in case of harts with different pmu counters
Signature · 1 line
2.36.1
#1 lore raw
Quoted 10 lines · Conor Dooley

Building riscv/for-next produces following error:
drivers/perf/riscv_pmu_sbi.c:44:7: error: redefinition of 'sbi_pmu_ctr_info'

union sbi_pmu_ctr_info {
     ^

arch/riscv/include/asm/sbi.h:125:7: note: previous definition is here union sbi_pmu_ctr_info {

This appears to have been caused by a merge conflict resolution between riscv/for-next & riscv/fixes, causing the struct define not being

union, not struct

Jess

Quoted 41 lines

properly moved to its header.

Fixes 9a7ccac63f9c ("perf: riscv_pmu{,_sbi}: Miscallenous improvement & fixes")

---
drivers/perf/riscv_pmu_sbi.c | 14 --------------

1 file changed, 14 deletions(-)
drivers/perf/riscv_pmu_sbi.c +0 -14
index e7c6fecbf061..6f6681bbfd36 100644
@@ -41,20 +41,6 @@ static const struct attribute_group *riscv_pmu_attr_groups[] = {
 	NULL,
 };
 
-union sbi_pmu_ctr_info {
-	unsigned long value;
-	struct {
-		unsigned long csr:12;
-		unsigned long width:6;
-#if __riscv_xlen == 32
-		unsigned long reserved:13;
-#else
-		unsigned long reserved:45;
-#endif
-		unsigned long type:1;
-	};
-};
-
 /*
 * RISC-V doesn't have hetergenous harts yet. This need to be part of
 * per_cpu in case of harts with different pmu counters
Signature · 7 lines
2.36.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#2 lore raw
Quoted 11 lines · Jessica Clarke

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 8 lines · Conor Dooley

Building riscv/for-next produces following error:
drivers/perf/riscv_pmu_sbi.c:44:7: error: redefinition of 'sbi_pmu_ctr_info'

union sbi_pmu_ctr_info {
      ^

arch/riscv/include/asm/sbi.h:125:7: note: previous definition is here union sbi_pmu_ctr_info {

Quoted 4 lines
Quoted 2 lines

This appears to have been caused by a merge conflict resolution between riscv/for-next & riscv/fixes, causing the struct define not being

union, not struct

autopilot, thanks :)

Quoted 40 lines

Jess

Quoted 37 lines

properly moved to its header.

Fixes 9a7ccac63f9c ("perf: riscv_pmu{,_sbi}: Miscallenous improvement & fixes")

---
drivers/perf/riscv_pmu_sbi.c | 14 --------------

1 file changed, 14 deletions(-)
drivers/perf/riscv_pmu_sbi.c +0 -15
index e7c6fecbf061..6f6681bbfd36 100644
@@ -41,20 +41,6 @@ static const struct attribute_group *riscv_pmu_attr_groups[] = {
       NULL,
 };
 
-union sbi_pmu_ctr_info {
-     unsigned long value;
-     struct {
-             unsigned long csr:12;
-             unsigned long width:6;
-#if __riscv_xlen == 32
-             unsigned long reserved:13;
-#else
-             unsigned long reserved:45;
-#endif
-             unsigned long type:1;
-     };
-};
-
 /*
  * RISC-V doesn't have hetergenous harts yet. This need to be part of
  * per_cpu in case of harts with different pmu counters
--

2.36.1

Quoted 5 lines
Quoted 4 lines

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#3 lore raw
Quoted 47 lines · On Fri, 12 Aug 2022 07:19:54 PDT (-0700), [email protected] wrote:
Quoted 11 lines · Jessica Clarke

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 8 lines · Conor Dooley

Building riscv/for-next produces following error:
drivers/perf/riscv_pmu_sbi.c:44:7: error: redefinition of 'sbi_pmu_ctr_info'

union sbi_pmu_ctr_info {
      ^

arch/riscv/include/asm/sbi.h:125:7: note: previous definition is here union sbi_pmu_ctr_info {

Quoted 4 lines
Quoted 2 lines

This appears to have been caused by a merge conflict resolution between riscv/for-next & riscv/fixes, causing the struct define not being

union, not struct

autopilot, thanks :)

Quoted 28 lines

Jess

Quoted 25 lines

properly moved to its header.

Fixes 9a7ccac63f9c ("perf: riscv_pmu{,_sbi}: Miscallenous improvement & fixes")

---
drivers/perf/riscv_pmu_sbi.c | 14 --------------

1 file changed, 14 deletions(-)
drivers/perf/riscv_pmu_sbi.c +0 -9
index e7c6fecbf061..6f6681bbfd36 100644
@@ -41,20 +41,6 @@ static const struct attribute_group *riscv_pmu_attr_groups[] = {
       NULL,
 };
 
-union sbi_pmu_ctr_info {
-     unsigned long value;
-     struct {
-             unsigned long csr:12;
-             unsigned long width:6;
-#if __riscv_xlen == 32
-             unsigned long reserved:13;
-#else
-             unsigned long reserved:45;
Quoted 8 lines
Quoted 8 lines

drivers/perf/riscv_pmu_sbi.c static const struct attribute_group *riscv_pmu_attr_groups[] = { · line 46

Quoted 8 lines
drivers/perf/riscv_pmu_sbi.c +0 -5
-#endif
-             unsigned long type:1;
-     };
-};
-
 /*
  * RISC-V doesn't have hetergenous harts yet. This need to be part of
  * per_cpu in case of harts with different pmu counters

Atish just poked me about this as I was tagging my PR, I squashed it in. I don't see a message on lore, not sure if something went off the rails or if it's just in the outbox on my box at home.

#4 lore raw
Quoted 52 lines · Palmer Dabbelt
Quoted 51 lines · On Fri, 12 Aug 2022 07:19:54 PDT (-0700), [email protected] wrote:
Quoted 11 lines · Jessica Clarke

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 8 lines · Conor Dooley

Building riscv/for-next produces following error:
drivers/perf/riscv_pmu_sbi.c:44:7: error: redefinition of 'sbi_pmu_ctr_info' union sbi_pmu_ctr_info {
      ^
arch/riscv/include/asm/sbi.h:125:7: note: previous definition is here union sbi_pmu_ctr_info {

Quoted 4 lines
Quoted 2 lines

This appears to have been caused by a merge conflict resolution between riscv/for-next & riscv/fixes, causing the struct define not being

union, not struct

autopilot, thanks :)

Quoted 32 lines

Jess

Quoted 29 lines

properly moved to its header.

Fixes 9a7ccac63f9c ("perf: riscv_pmu{,_sbi}: Miscallenous improvement & fixes")

---
drivers/perf/riscv_pmu_sbi.c | 14 --------------

1 file changed, 14 deletions(-)
drivers/perf/riscv_pmu_sbi.c +0 -13
index e7c6fecbf061..6f6681bbfd36 100644
@@ -41,20 +41,6 @@ static const struct attribute_group *riscv_pmu_attr_groups[] = {
        NULL,
 };
 
-union sbi_pmu_ctr_info {
-     unsigned long value;
-     struct {
-             unsigned long csr:12;
-             unsigned long width:6;
-#if __riscv_xlen == 32
-             unsigned long reserved:13;
-#else
-             unsigned long reserved:45;
-#endif
-             unsigned long type:1;
-     };
-};
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

drivers/perf/riscv_pmu_sbi.c static const struct attribute_group *riscv_pmu_attr_groups[] = { · line 46

Quoted 4 lines
drivers/perf/riscv_pmu_sbi.c +0 -1
-
 /*
   * RISC-V doesn't have hetergenous harts yet. This need to be part of
   * per_cpu in case of harts with different pmu counters

Atish just poked me about this as I was tagging my PR, I squashed it in. I don't see a message on lore, not sure if something went off the rails or if it's just in the outbox on my box at home.

I assume stuck in the outbox. I checked out for-next after I got home from work and the error was gone so I assumed you'd done so.

:)