All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Lee Jones <lee.jones@linaro.org>,
	linus.walleij@linaro.org, tony@atomide.com,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written
Date: Thu, 15 Sep 2016 13:31:28 +0200	[thread overview]
Message-ID: <10514464.46kyQp39gL@wuerfel> (raw)
In-Reply-To: <20160915104521.14286-3-lee.jones@linaro.org>

On Thursday, September 15, 2016 11:45:16 AM CEST Lee Jones wrote:
> Due to the lack of parity in the way array fields have been named/
> numbered, a mistake was made where more debug fields were declared
> than actually existed.  In doing so, 2 fields were added, which
> although unclear, were already declared in the array.  The result
> was that the latter declarations trashed the former ones.
> 
> This patch places the array back in the correct order and removes
> the offending NULL entries.
> 
> While we're at it, let's ensure this doesn't happen again by naming
> each field properly and add a new *_LAST define to describe how
> many fields there should be.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/ab8500-debugfs.c      | 50 ++++++++++++++++-----------------------
>  include/linux/mfd/abx500/ab8500.h |  2 ++
>  2 files changed, 23 insertions(+), 29 deletions(-)

I tried doing the same thing at some point and never submitted.
For reference, here is my version. Yours looks better though,
so keep that.

	Arnd

commit daa445be130176d946af78e7a8460e44d3a792dd
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Wed Jun 8 10:29:18 2016 +0200

    mfd: ab8500: remove duplicate table entries
    
    gcc -Wextra finds two duplicate initializations for ab8500_debug_ranges:
    
    drivers/mfd/ab8500-debugfs.c:466:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:466:11: note: (near initialization for 'ab8500_debug_ranges[17]')
    drivers/mfd/ab8500-debugfs.c:470:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:470:11: note: (near initialization for 'ab8500_debug_ranges[18]')
    
    In both cases, one initialization looks valid, the other one overrides
    it with an empty one. I'm removing the empty overrides now, assuming
    they were not intentional.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7bd35f8..c23104b277c4 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -463,14 +463,6 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x11] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
-	[0x12] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
 	[0x13] = {
 		.num_ranges = 0,
 		.range = NULL,

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written
Date: Thu, 15 Sep 2016 13:31:28 +0200	[thread overview]
Message-ID: <10514464.46kyQp39gL@wuerfel> (raw)
In-Reply-To: <20160915104521.14286-3-lee.jones@linaro.org>

On Thursday, September 15, 2016 11:45:16 AM CEST Lee Jones wrote:
> Due to the lack of parity in the way array fields have been named/
> numbered, a mistake was made where more debug fields were declared
> than actually existed.  In doing so, 2 fields were added, which
> although unclear, were already declared in the array.  The result
> was that the latter declarations trashed the former ones.
> 
> This patch places the array back in the correct order and removes
> the offending NULL entries.
> 
> While we're at it, let's ensure this doesn't happen again by naming
> each field properly and add a new *_LAST define to describe how
> many fields there should be.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/ab8500-debugfs.c      | 50 ++++++++++++++++-----------------------
>  include/linux/mfd/abx500/ab8500.h |  2 ++
>  2 files changed, 23 insertions(+), 29 deletions(-)

I tried doing the same thing at some point and never submitted.
For reference, here is my version. Yours looks better though,
so keep that.

	Arnd

commit daa445be130176d946af78e7a8460e44d3a792dd
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Wed Jun 8 10:29:18 2016 +0200

    mfd: ab8500: remove duplicate table entries
    
    gcc -Wextra finds two duplicate initializations for ab8500_debug_ranges:
    
    drivers/mfd/ab8500-debugfs.c:466:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:466:11: note: (near initialization for 'ab8500_debug_ranges[17]')
    drivers/mfd/ab8500-debugfs.c:470:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:470:11: note: (near initialization for 'ab8500_debug_ranges[18]')
    
    In both cases, one initialization looks valid, the other one overrides
    it with an empty one. I'm removing the empty overrides now, assuming
    they were not intentional.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7bd35f8..c23104b277c4 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -463,14 +463,6 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x11] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
-	[0x12] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
 	[0x13] = {
 		.num_ranges = 0,
 		.range = NULL,

  reply	other threads:[~2016-09-15 11:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 10:45 [PATCH 0/7] mfd: Fix all W=1 warnings Lee Jones
2016-09-15 10:45 ` Lee Jones
2016-09-15 10:45 ` Lee Jones
2016-09-15 10:45 ` [PATCH 1/7] mfd: max8997-irq: 'inline' should be at the beginning of the declaration Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:28   ` Arnd Bergmann
2016-09-15 11:28     ` Arnd Bergmann
2016-09-15 10:45 ` [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:31   ` Arnd Bergmann [this message]
2016-09-15 11:31     ` Arnd Bergmann
2016-09-15 10:45 ` [PATCH 3/7] mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-10-06 20:35   ` Ulf Hansson
2016-10-06 20:35     ` Ulf Hansson
2016-10-06 20:35     ` Ulf Hansson
2016-09-15 10:45 ` [PATCH 4/7] mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem() Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 10:45 ` [PATCH 5/7] mfd: ab8500-debugfs: Remove 'weak' function suspend_test_wake_cause_interrupt_is_mine() Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 10:45 ` [PATCH 6/7] mfd: omap-usb-host: Return value is not 'const int' Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:33   ` Arnd Bergmann
2016-09-15 11:33     ` Arnd Bergmann
2016-09-15 10:45 ` [PATCH 7/7] mfd: cros_ec_spi: Remove unused variable 'request' Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:35 ` [PATCH 0/7] mfd: Fix all W=1 warnings Arnd Bergmann
2016-09-15 11:35   ` Arnd Bergmann
2016-10-26 12:27   ` Lee Jones
2016-10-26 12:27     ` Lee Jones
2016-09-15 12:44 ` Linus Walleij
2016-09-15 12:44   ` Linus Walleij
2016-09-15 12:44   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10514464.46kyQp39gL@wuerfel \
    --to=arnd@arndb.de \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.