From patchwork Fri Nov 2 15:49:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 150063 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2236978ljp; Fri, 2 Nov 2018 08:50:16 -0700 (PDT) X-Google-Smtp-Source: AJdET5dtVd7v3CD/imdG2K4g/PbXkIcjMTDO7H6cLcRcNSydp1Nui6SIFu4RsjZLsZkhykePLnLj X-Received: by 2002:a63:4a4a:: with SMTP id j10-v6mr11673612pgl.0.1541173816791; Fri, 02 Nov 2018 08:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541173816; cv=none; d=google.com; s=arc-20160816; b=Ov1q6I7MoVkteVnjbc2ThCzYHGOnw3PKOME750whIePsrVgUvDsyuSq2DQIFV+MLz4 iu6f9ZFrLFheHHomX/jw2ezJNyULScDc7oPcMpXAV8cE/cG0YhhAbigZBa+O+GlfINm3 BLX5VX8nYHk/DaTF0SYDYpBnL/5zci1Tx0Me4ZDV+7Pe+r3Ck8hlbJzoV2SvmjFbYc27 T6wXI0SCMOw7IdYUvVq1hRYLd7s+zFwzFTOmXO28IrYJEms7L0ocDoYMQwD74CNk1lFV yb96g7/6ug842a/PJ8OmPS0OQtIHusE50iHB3eOGzUBRGb8Si/2aRalil/sCmUg8VbTE ZLdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=b07zCk6UXRRLYa76n8LT44hqFDEjSzzIMTM/7BHWajI=; b=w16Iz2B/B/RGDOLQg9ZphBrRMnif9pTsEWwebxj3uczfmgln7KQfXUZVx8IwR7zzfY dRPpnNIChfts3CdQ/vVuMRtOz2VKe+v2CTmBlXjHL9f2X54UOEjj/XFvNJ0jyt3z+qrr hFSmU6xem1sQ9oV4emTk8c/b+dCD3WaeTiQKUB5j5Otg1lo5TBhhl6TxLUB6H6RvjuGQ l539pNJYu5Je6LLj0h1kXNobcv4cVhjxnCAAgYQu9o/ZFeTaqR1gO5ODmeLrAjOXIZW2 l6N2uFVwsKEavO9pw9S+EnhCxp9xFkmgJ5VZqsIlDZa8FBBoF6FH0WVrNJ7/4QN16irp oAPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si4591076plp.323.2018.11.02.08.50.16; Fri, 02 Nov 2018 08:50:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727830AbeKCA5q (ORCPT + 32 others); Fri, 2 Nov 2018 20:57:46 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:54501 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbeKCA5q (ORCPT ); Fri, 2 Nov 2018 20:57:46 -0400 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MAwoL-1gPSP318jh-00BNpa; Fri, 02 Nov 2018 16:49:36 +0100 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MAwoL-1gPSP318jh-00BNpa; Fri, 02 Nov 2018 16:49:36 +0100 From: Arnd Bergmann To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Cc: Arnd Bergmann , "H. Peter Anvin" , Juergen Gross , linux-kernel@vger.kernel.org Subject: [PATCH] x86: vsmp: avoid link error with gcc -Og Date: Fri, 2 Nov 2018 16:49:22 +0100 Message-Id: <20181102154935.2073592-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:fCq3YIon1uKOvhOeX8iivnNGq8J6favtUcCaobIMvUSiBnhqDwi hmi0B7DH4t/2Dli4f6M4lnVkC5fqtEAufGVh0d3sf7ImmA2AQ9jUPyMxkJfNw8ZjbchyhkD lGWOvMyI67HT2E/MQlhCCJnonwypyalo4KpIGxZA0vdMTixoRpwRPfy7+GW9qXUbLi0qtdx ywGJSN3Efm2j3SXdXM4JA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V01:K0:I4HWw2JW6X8=:GtMHXLFsqlVmywN4jYs2gk 6bFB3JKZp1+kU2OUvece2y4SRjCTtMrQDCxcIbdQpn0VWN6t6kWazUSsNuF7e9IGxWgXnhpR7 1pjz1/11xzSTCeofb5oV4lwKWSqiWRBVaqDKW7Hmn+sY4v07cufj50aNChoP+5EXgjRFnuSom PAcLO5n/dhRR965nhG70dtOd9BqLMQa/jPtPCxr+w70TURvL07YDt4oO3QauMJq7HkYdSyjGt PWJqd6ybWfETiWg5CyXtLWFyDVMZWO5QX/hLozM9YBCW4OoMwHgGfgh05g+R8prTIFDAr4rBf BEE5cTO5tuVwJ15CleJf8b8WOPTd5NIm/WehvG4ZcUucTZoBxPV8C7gRIRnSyLeamDVmOBZio flhF9ijNdRd8ZFb2qQnzTWi/B3Do0MCBUg6Ss5RoFVcel/iUs3cki5myOJqL6UFIvjY+9Gf05 IoD8XWksZdp5P2G9LTA7Msp3Zv8H2Hwds4Ny3zkcbV83Y496mV4OxRYKjxrWSO7LkY0LkGd8j s+ya+fEJUCtea7rnrRVxqyKl3EpWwmeO28XzUGIp/7DQ5uz5lmDEz9vi1ZUJx4bMkyieBk08o 4Mwwrgsd+5AYovfCSEuMnkBEdf54fbEjfqmGJozzgHzvO9eRG17q9Hu+w3ifB7DPzqNKYrspx f6qfF+FZmgEsyCA0g8TuLF5hN2abcfAZuigEuPPkIwxqJP5CcAnObXtiREBACcJ5Qy6Q= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the compiler skips optimizations for ease of debugging, teh vsmp_cap_cpus() function is not eliminated from the build with CONFIG_PCI=n: arch/x86/kernel/vsmp_64.o: In function `vsmp_cap_cpus': vsmp_64.c:(.init.text+0x23): undefined reference to `read_pci_config' Change the caller in a way that will always optimize this as required. Signed-off-by: Arnd Bergmann --- arch/x86/kernel/vsmp_64.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.18.0 diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 1eae5af491c2..6a2ae6964ce5 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c @@ -146,8 +146,10 @@ static void __init detect_vsmp_box(void) is_vsmp = 1; } -static int is_vsmp_box(void) +static int __init is_vsmp_box(void) { + detect_vsmp_box(); + if (is_vsmp != -1) return is_vsmp; else { @@ -157,10 +159,7 @@ static int is_vsmp_box(void) } #else -static void __init detect_vsmp_box(void) -{ -} -static int is_vsmp_box(void) +static __always_inline int is_vsmp_box(void) { return 0; } @@ -213,7 +212,6 @@ static void vsmp_apic_post_init(void) void __init vsmp_init(void) { - detect_vsmp_box(); if (!is_vsmp_box()) return;