Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp667054ybz; Wed, 22 Apr 2020 05:51:47 -0700 (PDT) X-Google-Smtp-Source: APiQypIUELvsUGr/e2lOhd04oGLmLJ3x9GRMxaFh7N8zvVBeAOnjMLAvrwvZqLYXg0G9OqoapjY3 X-Received: by 2002:aa7:dac3:: with SMTP id x3mr19842468eds.379.1587559907713; Wed, 22 Apr 2020 05:51:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587559907; cv=none; d=google.com; s=arc-20160816; b=v9+F/JTdei4PV2d9t+aif4VYhl5E+3lT+YwUishX7y78hM2yZoZ3D0NcfMF976lY1Y kKJ9qxaM62rfOzpZQYcj8GHiRVaFaIosDJYUqf7BOt5fkMRhJ/CfVcQfmlh1c7xz4iu5 zOO+hffLlEYINvohBpV8U4JJEYmoKi3EGeqFWWAscfwHTxzaD0WZoI/0IIhPiNqdULtx N8yq01++I5zJzrsGlj7RF8s9CYJ9Flj+54blJxqmHQwm4TN+LtkbFBSGAZzlx4q603ol VB0l/aNETHOPSXd0zcOcfPrhOC2SWE5W0VnhSV8wmWf7dT+GYY/B8VS1btcwfGsdCtam EEiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4C9hNqC1A4s4Fuuk9wbLSZG6Aw+XS8glnYns4UIqsLw=; b=RlcexlZMXYXrTxtgf1rN2YKz7FtT2yq+OJ6J/E5NwsZje+7zMqxHzmvsnbnRj5sFwH EkbNrvSUBB37tXGpeOwHNBqXEBU+wGjbR1wfpLVE4M/a1y1Rf28MtnSRYZDNFW1fg622 Eo0dMewGIpKSzAImj4fOFjheQeFeG0f9mTdk10yYHl35sr+7IEFP0PMIyhigBimBdX1T wIG8gSkca4yG2W5hzJaA7kDAS9Rt7g8XrGhtyIf3+ug4BVCfv6/fJAeGV1iLn1Z1D+7v H/80Gm+XbjhkBoV0+c8KHzSE7XFagIn3CQMzsMnLYD1Qlm3O6HYBeBK8vvCW1OMd1YqA AZHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AWFntszZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr4si3230408ejb.114.2020.04.22.05.51.24; Wed, 22 Apr 2020 05:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AWFntszZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731233AbgDVKd6 (ORCPT + 99 others); Wed, 22 Apr 2020 06:33:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:32944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730433AbgDVKYe (ORCPT ); Wed, 22 Apr 2020 06:24:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A75F520776; Wed, 22 Apr 2020 10:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587551074; bh=usCuz3f0ItfdSJWnll6ILELC7QQ1rmL2dQtqXuMyAy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AWFntszZcobT1Ba/NyhxoNvbNFppfVwqabu4LKnQTKCE3YEoOyYeAZq4BXM1h5Tmq mbgCQLEIhyZxwwIig3ilShfqjB4NsDTwQOpHnTH/xhji++z1z7YS7066FazcU36QGO LYL22K5a9Xe6zYsXMOWqATIpP5iQjsbboi1kGK+k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Ilie Halip , Nathan Chancellor , Michael Ellerman , Sasha Levin Subject: [PATCH 5.6 090/166] powerpc/maple: Fix declaration made after definition Date: Wed, 22 Apr 2020 11:56:57 +0200 Message-Id: <20200422095058.327624260@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095047.669225321@linuxfoundation.org> References: <20200422095047.669225321@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit af6cf95c4d003fccd6c2ecc99a598fb854b537e7 ] When building ppc64 defconfig, Clang errors (trimmed for brevity): arch/powerpc/platforms/maple/setup.c:365:1: error: attribute declaration must precede definition [-Werror,-Wignored-attributes] machine_device_initcall(maple, maple_cpc925_edac_setup); ^ machine_device_initcall expands to __define_machine_initcall, which in turn has the macro machine_is used in it, which declares mach_##name with an __attribute__((weak)). define_machine actually defines mach_##name, which in this file happens before the declaration, hence the warning. To fix this, move define_machine after machine_device_initcall so that the declaration occurs before the definition, which matches how machine_device_initcall and define_machine work throughout arch/powerpc. While we're here, remove some spaces before tabs. Fixes: 8f101a051ef0 ("edac: cpc925 MC platform device setup") Reported-by: Nick Desaulniers Suggested-by: Ilie Halip Signed-off-by: Nathan Chancellor Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200323222729.15365-1-natechancellor@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/maple/setup.c | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index 6f019df37916f..15b2c6eb506d0 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c @@ -291,23 +291,6 @@ static int __init maple_probe(void) return 1; } -define_machine(maple) { - .name = "Maple", - .probe = maple_probe, - .setup_arch = maple_setup_arch, - .init_IRQ = maple_init_IRQ, - .pci_irq_fixup = maple_pci_irq_fixup, - .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, - .restart = maple_restart, - .halt = maple_halt, - .get_boot_time = maple_get_boot_time, - .set_rtc_time = maple_set_rtc_time, - .get_rtc_time = maple_get_rtc_time, - .calibrate_decr = generic_calibrate_decr, - .progress = maple_progress, - .power_save = power4_idle, -}; - #ifdef CONFIG_EDAC /* * Register a platform device for CPC925 memory controller on @@ -364,3 +347,20 @@ static int __init maple_cpc925_edac_setup(void) } machine_device_initcall(maple, maple_cpc925_edac_setup); #endif + +define_machine(maple) { + .name = "Maple", + .probe = maple_probe, + .setup_arch = maple_setup_arch, + .init_IRQ = maple_init_IRQ, + .pci_irq_fixup = maple_pci_irq_fixup, + .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, + .restart = maple_restart, + .halt = maple_halt, + .get_boot_time = maple_get_boot_time, + .set_rtc_time = maple_set_rtc_time, + .get_rtc_time = maple_get_rtc_time, + .calibrate_decr = generic_calibrate_decr, + .progress = maple_progress, + .power_save = power4_idle, +}; -- 2.20.1