Skip to contentSkip to conversation

s3mci: mark debug_regs[] as static

PATCH Superseded Arnd Bergmann 2 participants 3 messages Jan 3, 2018 MMC, SD and SDIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s3mci: mark debug_regs[] as static

The global array clashes with a newly added symbol of the same name:

drivers/staging/ccree/cc_debugfs.o:(.data+0x0): multiple definition of `debug_regs' drivers/mmc/host/s3cmci.o:(.data+0x70): first defined here

We should fix both, this one addresses the s3cmci driver by removing the symbol from the global namespace.

Fixes 9bdd203b4dc8 ("s3cmci: add debugfs support for examining driver and hardware state")
Fixes b3ec9a6736f2 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface")
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/s3cmci.c +1 -1
index 36daee1e6588..24b27e0957e7 100644
@@ -1421,7 +1421,7 @@ static const struct file_operations s3cmci_fops_state = {
 
 #define DBG_REG(_r) { .addr = S3C2410_SDI##_r, .name = #_r }
 
-struct s3cmci_reg {
+static struct s3cmci_reg {
 	unsigned short	addr;
 	unsigned char	*name;
 } debug_regs[] = {
Signature · 1 line
2.9.0
#1 lore raw
Quoted 9 lines · Arnd Bergmann

The global array clashes with a newly added symbol of the same name:

drivers/staging/ccree/cc_debugfs.o:(.data+0x0): multiple definition of `debug_regs' drivers/mmc/host/s3cmci.o:(.data+0x70): first defined here

We should fix both, this one addresses the s3cmci driver by removing the symbol from the global namespace.

Fixes 9bdd203b4dc8 ("s3cmci: add debugfs support for examining driver and hardware state")

Seems like we need a stable tag as well, would you mind adding it in the next re-spin?

Quoted 11 lines
Fixes b3ec9a6736f2 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface")
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/s3cmci.c +0 -0
index 36daee1e6588..24b27e0957e7 100644

drivers/mmc/host/s3cmci.c static const struct file_operations s3cmci_fops_state = { · line 1427

Quoted 8 lines
drivers/mmc/host/s3cmci.c +1 -1
@@ -1421,7 +1421,7 @@ static const struct file_operations s3cmci_fops_state = {
 
 #define DBG_REG(_r) { .addr = S3C2410_SDI##_r, .name = #_r }
 
-struct s3cmci_reg {
+static struct s3cmci_reg {
        unsigned short  addr;
        unsigned char   *name;
 } debug_regs[] = {

I am not very fond of these kind of declarations/definitions. How about if we instead move the declaration of debug_regs[] to a separate line? Moreover, should it be const?

static struct s3cmci_reg debug_regs[] = {

Kind regards
Uffe

#2 lore raw
Quoted 6 lines · Ulf Hansson
Quoted 5 lines · Arnd Bergmann

The global array clashes with a newly added symbol of the same name:

drivers/staging/ccree/cc_debugfs.o:(.data+0x0): multiple definition of `debug_regs' drivers/mmc/host/s3cmci.o:(.data+0x70): first defined here

Quoted 7 lines
Quoted 4 lines

We should fix both, this one addresses the s3cmci driver by removing the symbol from the global namespace.

Fixes 9bdd203b4dc8 ("s3cmci: add debugfs support for examining driver and hardware state")

Seems like we need a stable tag as well, would you mind adding it in the next re-spin?

It doesn't seem necessary here, this only causes problems on the latest linux-next kernel that has the b3ec9a6736f2 commit as well.

Obviously, you can just add the Cc:stable tag when applying the patch when you consider it appropriate.

Quoted 24 lines
Quoted 11 lines
Fixes b3ec9a6736f2 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface")
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/s3cmci.c +0 -0
index 36daee1e6588..24b27e0957e7 100644

drivers/mmc/host/s3cmci.c static const struct file_operations s3cmci_fops_state = { · line 1427

Quoted 8 lines
drivers/mmc/host/s3cmci.c +1 -1
@@ -1421,7 +1421,7 @@ static const struct file_operations s3cmci_fops_state = {
 
 #define DBG_REG(_r) { .addr = S3C2410_SDI##_r, .name = #_r }
 
-struct s3cmci_reg {
+static struct s3cmci_reg {
        unsigned short  addr;
        unsigned char   *name;
 } debug_regs[] = {

I am not very fond of these kind of declarations/definitions. How about if we instead move the declaration of debug_regs[] to a separate line? Moreover, should it be const?

Quoted 1 line

static struct s3cmci_reg debug_regs[] = {

Ok, I'll resend with that changed.

Arnd