public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s3mci: mark debug_regs[] as static
@ 2018-01-03  9:26 Arnd Bergmann
  2018-01-03 16:47 ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-03  9:26 UTC (permalink / raw)
  To: Ben Dooks, Ulf Hansson
  Cc: Arnd Bergmann, Heiner Kallweit, Julia Lawall, Arvind Yadav,
	Sergio Prado, linux-arm-kernel, linux-mmc, linux-kernel

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")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mmc/host/s3cmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index 36daee1e6588..24b27e0957e7 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -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[] = {
-- 
2.9.0

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

* Re: [PATCH] s3mci: mark debug_regs[] as static
  2018-01-03  9:26 [PATCH] s3mci: mark debug_regs[] as static Arnd Bergmann
@ 2018-01-03 16:47 ` Ulf Hansson
  2018-01-03 22:45   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2018-01-03 16:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ben Dooks, Heiner Kallweit, Julia Lawall, Arvind Yadav,
	Sergio Prado, linux-arm-kernel, linux-mmc@vger.kernel.org,
	Linux Kernel Mailing List

On 3 January 2018 at 10:26, Arnd Bergmann <arnd@arndb.de> wrote:
> 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?

> Fixes: b3ec9a6736f2 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/mmc/host/s3cmci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
> index 36daee1e6588..24b27e0957e7 100644
> --- a/drivers/mmc/host/s3cmci.c
> +++ b/drivers/mmc/host/s3cmci.c
> @@ -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

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

* Re: [PATCH] s3mci: mark debug_regs[] as static
  2018-01-03 16:47 ` Ulf Hansson
@ 2018-01-03 22:45   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-03 22:45 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Ben Dooks, Heiner Kallweit, Julia Lawall, Arvind Yadav,
	Sergio Prado, Linux ARM, linux-mmc@vger.kernel.org,
	Linux Kernel Mailing List

On Wed, Jan 3, 2018 at 5:47 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 3 January 2018 at 10:26, Arnd Bergmann <arnd@arndb.de> wrote:
>> 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?

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.

>> Fixes: b3ec9a6736f2 ("staging: ccree: staging: ccree: replace sysfs by debugfs interface")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>  drivers/mmc/host/s3cmci.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
>> index 36daee1e6588..24b27e0957e7 100644
>> --- a/drivers/mmc/host/s3cmci.c
>> +++ b/drivers/mmc/host/s3cmci.c
>> @@ -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[] = {

Ok, I'll resend with that changed.

      Arnd

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

end of thread, other threads:[~2018-01-03 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-03  9:26 [PATCH] s3mci: mark debug_regs[] as static Arnd Bergmann
2018-01-03 16:47 ` Ulf Hansson
2018-01-03 22:45   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox