From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Date: Tue, 02 Apr 2019 22:39:21 +0000 Subject: [PATCH] sh: fix multiple function definition build errors Message-Id: <9ee4e0c5-f100-86a2-bd4d-1d3287ceab31@infradead.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: LKML , Andrew Morton Cc: Takashi Iwai , Yoshinori Sato , Rich Felker , Linux-sh list From: Randy Dunlap Many of the sh CPU-types have their own plat_irq_setup() and arch_init_clk_ops() functions, so these same (empty) functions in arch/sh/boards/of-generic.c are not needed and cause build errors. If there is some case where these empty functions are needed, they can be retained by marking them as "__weak" while at the same time making builds that do not need them succeed. Fixes these build errors: arch/sh/boards/of-generic.o: In function `plat_irq_setup': (.init.text+0x134): multiple definition of `plat_irq_setup' arch/sh/kernel/cpu/sh2/setup-sh7619.o:(.init.text+0x30): first defined here arch/sh/boards/of-generic.o: In function `arch_init_clk_ops': (.init.text+0x118): multiple definition of `arch_init_clk_ops' arch/sh/kernel/cpu/sh2/clock-sh7619.o:(.init.text+0x0): first defined here Reported-by: kbuild test robot Signed-off-by: Randy Dunlap Cc: Takashi Iwai Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/sh/boards/of-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- lnx-51-rc2.orig/arch/sh/boards/of-generic.c +++ lnx-51-rc2/arch/sh/boards/of-generic.c @@ -164,10 +164,10 @@ static struct sh_machine_vector __initmv struct sh_clk_ops; -void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) +void __init __weak arch_init_clk_ops(struct sh_clk_ops **ops, int idx) { } -void __init plat_irq_setup(void) +void __init __weak plat_irq_setup(void) { } From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DDAEC4360F for ; Tue, 2 Apr 2019 22:39:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A1BB20700 for ; Tue, 2 Apr 2019 22:39:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="m0EOxOoc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726337AbfDBWj3 (ORCPT ); Tue, 2 Apr 2019 18:39:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33326 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbfDBWj2 (ORCPT ); Tue, 2 Apr 2019 18:39:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:Cc:To:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6Dc4yOd/LsQUmIb21uC+y24e1MF+JwP4QAcIUwTjmeg=; b=m0EOxOocF/r8HG76LdT7ZjhW5I aOjh9P3R0V4Ine1Qu/uMk1YpbEhv2C/Zwhs2SnLVLqnkZVCvfTMP3pyYUU8577RYBgIFclk79BWsP arCNXMPwnsvjT725rDRZfCbwNC8apBUTxxgIFeGet5tqgr0zjrDuiH5ty2LbeQPtZdCgXnzNwpciS 2fHsSGTW0W9usuMBKQubb/xY1xqB6IkLDNAoYVN6B0wGkyC1lBID2i8pbytkQaxaqaAJiGKXozO6h HOEM4NeylC3GO9GUCEmg2UN2nPFzO9pNd8L4Y6a5K6FCs4olgHmTpRQ4tix8vtEgSUGRDsmwgrTHk z8iF5EuQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBS3v-0005eB-8v; Tue, 02 Apr 2019 22:39:23 +0000 To: LKML , Andrew Morton Cc: Takashi Iwai , Yoshinori Sato , Rich Felker , Linux-sh list From: Randy Dunlap Subject: [PATCH] sh: fix multiple function definition build errors Message-ID: <9ee4e0c5-f100-86a2-bd4d-1d3287ceab31@infradead.org> Date: Tue, 2 Apr 2019 15:39:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap Many of the sh CPU-types have their own plat_irq_setup() and arch_init_clk_ops() functions, so these same (empty) functions in arch/sh/boards/of-generic.c are not needed and cause build errors. If there is some case where these empty functions are needed, they can be retained by marking them as "__weak" while at the same time making builds that do not need them succeed. Fixes these build errors: arch/sh/boards/of-generic.o: In function `plat_irq_setup': (.init.text+0x134): multiple definition of `plat_irq_setup' arch/sh/kernel/cpu/sh2/setup-sh7619.o:(.init.text+0x30): first defined here arch/sh/boards/of-generic.o: In function `arch_init_clk_ops': (.init.text+0x118): multiple definition of `arch_init_clk_ops' arch/sh/kernel/cpu/sh2/clock-sh7619.o:(.init.text+0x0): first defined here Reported-by: kbuild test robot Signed-off-by: Randy Dunlap Cc: Takashi Iwai Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/sh/boards/of-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- lnx-51-rc2.orig/arch/sh/boards/of-generic.c +++ lnx-51-rc2/arch/sh/boards/of-generic.c @@ -164,10 +164,10 @@ static struct sh_machine_vector __initmv struct sh_clk_ops; -void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx) +void __init __weak arch_init_clk_ops(struct sh_clk_ops **ops, int idx) { } -void __init plat_irq_setup(void) +void __init __weak plat_irq_setup(void) { }