From patchwork Thu Sep 15 11:31:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9333241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 470446077F for ; Thu, 15 Sep 2016 11:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3178A295D7 for ; Thu, 15 Sep 2016 11:32:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 25EDE295DF; Thu, 15 Sep 2016 11:32:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82594295D7 for ; Thu, 15 Sep 2016 11:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756187AbcIOLb6 (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 Received: from wuerfel.localnet ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0MUjoe-1bWK5u0Urk-00YA3I; Thu, 15 Sep 2016 13:31:30 +0200 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 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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,