From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765155AbcIOLb6 (ORCPT ); Thu, 15 Sep 2016 07:31:58 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:59779 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754432AbcIOLb5 (ORCPT ); Thu, 15 Sep 2016 07:31:57 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Lee Jones , 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 Message-ID: <10514464.46kyQp39gL@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20160915104521.14286-3-lee.jones@linaro.org> References: <20160915104521.14286-1-lee.jones@linaro.org> <20160915104521.14286-3-lee.jones@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Qhwi/aNiRJ70kvfAnbTFufmv/9fUVZ5+G9SBUVBxboDg+lUxsuX RofcBSbOStGpUkq7RfDlNBKy9MHsxOUVpjrUuDbptrKEaP4mpGFh2xZPnt7nVeG7WKheV8n ekJ9rosc2Y2Bk66rnhR/ZWL2jHoVaEpR3c3p3ti22ELe/2jClPWEZbM3j7keAIgZToUCHe7 Ti1puJpVvpjtN1DQVE73A== X-UI-Out-Filterresults: notjunk:1;V01:K0:wYxnbUyogIg=:otMr3x+k7X6eqvkd16JvDz MWyPPJU9jtNP+R28TxDKfFm5sL7i44LDRCQJJIvC1imUxVEHVMJmKd8sXptxlmGjRbXWlMTYB xhHgOgaTNeQfLYAmKMq2+2dNzKNQDhXYGyKzqmwn4gRzQcrxDGfQiAAKAjCZhAVTLUmuwI1ze /z02/akI9LV1YguRw0IR4mL/WOngimmtAr8eaHdEuMAfbqXdz/l2ZtvuljE6YsvWZKy8gELS2 C7PvwZvVjkkOwFs7n4JuWr36vwpel70Amn1aHPmrcppJdo6vcm+Eh75/4PXnS6WYprKgM+HYI SV1H9jI5mDF4+Cmc3WmBARxgjhdUrWRVSzYEQDP0I6YfZ5lmQ4HTn8oFjQEHGt9Py2gF2y9p2 Q7M90N0RK0Fzzy2/i7aWz3RYFf+kgwu+Zh1D+AD7w0WWbbdV4zOQYrU1G0JuCxpr4+NWdPd2v 5yqJOfdynBOlcqU8M2F4ARTHg71i9kKuLL7CSXXAYJwIBkv7VGOi5AzWJNbsDgB3z1gLlseKg dRZ+OACItzZEI+aZIpDOn4ybZeH5ORcDWxCY/xaBvOeyyj9D8tX4KB8MfP7IrL93ImmIIDpSh 8+YcLANKE3jVixgDL9h+Etkr6PaTWa8wcYyfnATYjxt3Leb6oQmL01w/PcQ54frmMw+uSwyoa U3z22BCTWakwixhxMt0/Y9rN2g7W5+bGniQo5eFzvL+lbBhpAmy23JfJIR9I6lArRgrJ7ofRP cl7pDyQ/zgJN+xJA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > --- > 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 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 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,