From patchwork Wed Jun 22 12:39:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9192689 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 06A92601C0 for ; Wed, 22 Jun 2016 12:41:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EABAA28364 for ; Wed, 22 Jun 2016 12:41:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF4DA283FE; Wed, 22 Jun 2016 12:41:26 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 76F1028364 for ; Wed, 22 Jun 2016 12:41:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bFhRv-00083X-Cp; Wed, 22 Jun 2016 12:40:07 +0000 Received: from mout.kundenserver.de ([212.227.17.13]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bFhQz-0006lZ-7T for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2016 12:39:10 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MgOZS-1b385K2NCY-00NhhX; Wed, 22 Jun 2016 14:38:44 +0200 From: Arnd Bergmann To: Stephen Warren Subject: [PATCH] ARM: tegra: remove board_init_funcs array Date: Wed, 22 Jun 2016 14:39:41 +0200 Message-Id: <20160622124052.1263574-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:Qr2Q5QTcSd1mDBpJWlqSJw1Rdm+BMbcopuKcAQ+QV1cdXSkRm8o URyCkL5W5TGcJItVjF5BQBI5rFdI1KEvSBoVdXzKQjXJcysm3wEToJ5q1WzTC5s7HgJmU5P tSLQnBe+QxQBfNmrVRqjHnyhQOmyPRXm2wZCinwxQCujkvLfTjUf43YFXSo2t+x5euvG2vB qrU8zoH7FomRQKK6zHOsw== X-UI-Out-Filterresults: notjunk:1; V01:K0:mY1p18wDrUQ=:qzEED9QQjO3RFmBlyyIX8D Nkqf0kk4QhSdjoXY5DZjuEdrveNhmb7vz64bJqKtBetmqx90SkR2IN1iJABr+wSCuwpAoZkFg vmEGbiBXwy4QY/nqNpZZ5UtoKg9iYFT3szXd/wuPkT3bwJqC6XeO+U8e3aJe6+qveSO3YASWy WesXxtueO9E8Gx+g7n9REl+vhXQGZwMLtGClywP4pna5uTgUnXWETyO6yP3dUcuMGkVC+8IUC DoUsEkXn8x4L+82rSj4tne5o1uQ8Q3+6u+a/dh2Csemg/GUDvyHzplScKp8heJTJGuKC4B+/b zkuURwBWzorgt2nLfkEysZtlyNkTa4eKSYrCcJnLcvDKfXkVmzj76QINmmVZyaW6wrpl4Df4O sXKDBjaEf/1z5bzVUAJ6fL/hxa2lZSUlPbO06Z1wrf2KENA8/EiXwSxXDl4mfg7Tmq8/xlfSN bED7Uq+lVh6ymbT/CUsur5bnG3em6WB1Jlxn0tbDUF96xN9Ysd+X+SHd0yFl6NW0PCcGQgnLc Hj6PS+/16f4fh4rVPDjLm8KYYpMfUFQGZwVmMWdCcarRUL6oY9keI2mpI2s279mvlaM7pZWn7 J3vCJ7S/u9VKcotdcWXEyW38cRbF//oIMrQMKBvFcIkQxvEN+6nDtqUSq7FJZfhY0rHxlVgfz tzbHzWTr5avLUiuxxOTspoKlRUVAGjcawG4mFehpFOVmd0BXA0FaeG445boZjAvVpgQo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160622_053909_754535_AA7699D2 X-CRM114-Status: GOOD ( 13.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Courbot , Arnd Bergmann , linux-kernel@vger.kernel.org, Thierry Reding , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In a configuration that enables CONFIG_UBSAN_SANITIZE_ALL, I am getting a section mismatch warning for tegra20: WARNING: arch/arm/mach-tegra/built-in.o(.data+0x6e0): Section mismatch in reference from the variable board_init_funcs to the function .init.text:paz00_init() The array is no longer useful here since there is only one entry, so we can simply call the function directly after checking of_machine_is_compatible(). This fixes the section mismatch and is easier to read. Signed-off-by: Arnd Bergmann --- arch/arm/mach-tegra/tegra.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c index 2378fa560a21..42d7ee9658fa 100644 --- a/arch/arm/mach-tegra/tegra.c +++ b/arch/arm/mach-tegra/tegra.c @@ -118,32 +118,14 @@ out: of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); } -static void __init paz00_init(void) -{ - if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC)) - tegra_paz00_wifikill_init(); -} - -static struct { - char *machine; - void (*init)(void); -} board_init_funcs[] = { - { "compal,paz00", paz00_init }, -}; - static void __init tegra_dt_init_late(void) { - int i; - tegra_init_suspend(); tegra_cpuidle_init(); - for (i = 0; i < ARRAY_SIZE(board_init_funcs); i++) { - if (of_machine_is_compatible(board_init_funcs[i].machine)) { - board_init_funcs[i].init(); - break; - } - } + if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC) && + of_machine_is_compatible("compal,paz00")) + tegra_paz00_wifikill_init(); } static const char * const tegra_dt_board_compat[] = {