Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3470003imu; Sun, 11 Nov 2018 15:50:31 -0800 (PST) X-Google-Smtp-Source: AJdET5ck7aNstnIhL4eZCtoAgy8HFBt1Xpx7MGtulY5yMljVAnntMu327TA+QjGmmrLIgmfivbKv X-Received: by 2002:a62:7982:: with SMTP id u124-v6mr17538043pfc.95.1541980231800; Sun, 11 Nov 2018 15:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980231; cv=none; d=google.com; s=arc-20160816; b=Kb4AXIYyRL6YV03djjLWKjVHBRf7kssOVVe+V0KqQoUkfCAzuShpydlQbt7IJk8GzJ 8nd7DX07DHIQBEe2RkS5aO0GaW+FsdZpmc/KfKYLt9fYcqMvv5Uy9ljIAQmh1kLbWHx9 72qLcxXgK6qCu6zr8Xf3ALbsdiAbaeUW5LMnk/4ZvQ8wismf5jaOe3I8xnV+D04vuDHa il2xwfzLJbuoKmqb77LDBF6Y2f2kYFdaYdqGsDUaRbfplOnEmEzX5GZa+/2afl/XvpnD eMKXgpsfSAK6yV+57WgXEKtzak39lu+CzAa5UhwowEsgOUCtfuvoDiW5+nCshMXqwm9j BAyQ== 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=7RT5QnM3wMA+e+mwvuWSH2flZmFCR2IU0jEnVirYdRo=; b=G+F4yI2PXY3jo65krFIbA5kYPgpWMRiWHvOzomui0Gp0aaFYejNfD4ffWf9+eEui3M K3qoS4t68cx5Zite8Um63bwpUCha+hWCJIH53AyuaGJabkBvD/oCgjFT3bhoeVea6a52 DOwqRXW8J9HrsBZVo40ewGb6tV86ryUVSWXqhyNpr3Gt5a0pvuyNDxgjntgcMr8t6SO5 BtT+qy5owOzjSfyzwB3f2VJNqmpn6STrDmiE07stbZ6KtUVfLO2ZnrnpWcWPKYcV+BuZ rBreP1LFDYgbhW7dq4+6PsBNQLRUIUdhHGpI9n96OUwgy+WklXTGNws2H6WKtapZ8cJI Np/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nzmNIa0J; 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 d187-v6si17279182pfa.68.2018.11.11.15.50.16; Sun, 11 Nov 2018 15:50:31 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=nzmNIa0J; 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 S1733153AbeKLJkT (ORCPT + 99 others); Mon, 12 Nov 2018 04:40:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:38130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732908AbeKLISh (ORCPT ); Mon, 12 Nov 2018 03:18:37 -0500 Received: from localhost (unknown [206.108.79.134]) (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 8E68C223C6; Sun, 11 Nov 2018 22:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975321; bh=oQijSSnbLOwdbw8XwFK2ONSc0/4cr9hkQyEJVo0+Mbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nzmNIa0Jkp6B6ytDYqzQR72MGt/WiibVQ9lCNNlBkRq+j5eWtNynNeqp9Ewjk5oiF jpsDZgN9xNfWEfXWm8bFWZM/k60pw2bUzVCpecELCh18fROC3/KdlwYj5z5ZlwiQqW UZcnENo79tNoQGMRXHLogOpogwMFV7u8AbdRPMHc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Maciej W. Rozycki" , Alexandre Belloni Subject: [PATCH 4.19 286/361] rtc: cmos: Fix non-ACPI undefined reference to `hpet_rtc_interrupt Date: Sun, 11 Nov 2018 14:20:33 -0800 Message-Id: <20181111221656.308454300@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej W. Rozycki commit d197a253855d2d8e507a003880aab35c4e2473db upstream. Fix a commit 311ee9c151ad ("rtc: cmos: allow using ACPI for RTC alarm instead of HPET") `rtc-cmos' regression causing a link error: drivers/rtc/rtc-cmos.o: In function `cmos_platform_probe': rtc-cmos.c:(.init.text+0x33c): undefined reference to `hpet_rtc_interrupt' rtc-cmos.c:(.init.text+0x3f4): undefined reference to `hpet_rtc_interrupt' with non-ACPI platforms using this driver. The cause is the change of the condition guarding the use of `hpet_rtc_interrupt'. Previously it was a call to `is_hpet_enabled'. That function is static inline and has a hardcoded 0 result for non-ACPI platforms, which imply !HPET_EMULATE_RTC. Consequently the compiler optimized the whole block away including the reference to `hpet_rtc_interrupt', which never made it to the link stage. Now the guarding condition is a call to `use_hpet_alarm', which is not static inline and therefore the compiler may not be able to prove that it actually always returns 0 for non-ACPI platforms. Consequently the build breaks with an unsatisfied reference, because `hpet_rtc_interrupt' is nowhere defined at link time. Fix the problem by marking `use_hpet_alarm' inline. As the `inline' keyword serves as an optimization hint rather than a requirement the compiler is still free to choose whether inlining will be beneficial or not for ACPI platforms. Signed-off-by: Maciej W. Rozycki Fixes: 311ee9c151ad ("rtc: cmos: allow using ACPI for RTC alarm instead of HPET") Cc: stable@vger.kernel.org # 4.18+ Signed-off-by: Alexandre Belloni Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-cmos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -167,7 +167,7 @@ static inline int hpet_unregister_irq_ha #endif /* Don't use HPET for RTC Alarm event if ACPI Fixed event is used */ -static int use_hpet_alarm(void) +static inline int use_hpet_alarm(void) { return is_hpet_enabled() && !use_acpi_alarm; }