From patchwork Mon Oct 1 07:26:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10621681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00FD06CB for ; Mon, 1 Oct 2018 07:27:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBC6D29149 for ; Mon, 1 Oct 2018 07:27:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDDEB29157; Mon, 1 Oct 2018 07:27:05 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6147C29149 for ; Mon, 1 Oct 2018 07:27:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728695AbeJAODZ (ORCPT ); Mon, 1 Oct 2018 10:03:25 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:54154 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728677AbeJAODZ (ORCPT ); Mon, 1 Oct 2018 10:03:25 -0400 Received: from 91-156-4-241.elisa-laajakaista.fi ([91.156.4.241] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1g6sbe-0006md-FM; Mon, 01 Oct 2018 10:27:03 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Mon, 1 Oct 2018 10:26:57 +0300 Message-Id: <20181001072657.17277-1-luca@coelho.fi> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [PATCH] backport: check Ubuntu kernel for u64_stats_update_begin_irqsave() Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho Ubuntu cherry-picked the patch that added u64_stat_update_begin_irqsave() in their 4.15 kernel, so we get a redefinition compilation error if we try to compile against that. To solve this, check UTS_UBUNTU_RELEASE_ABI and don't define our backported function if it's 33 or higher. Signed-off-by: Luca Coelho --- backport/backport-include/linux/u64_stats_sync.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backport/backport-include/linux/u64_stats_sync.h b/backport/backport-include/linux/u64_stats_sync.h index 0d2212382db7..251373a74139 100644 --- a/backport/backport-include/linux/u64_stats_sync.h +++ b/backport/backport-include/linux/u64_stats_sync.h @@ -152,7 +152,8 @@ static inline bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp, #endif /* LINUX_VERSION_IS_LESS(3,13,0) */ #if LINUX_VERSION_IS_LESS(4,16,0) && \ - !LINUX_VERSION_IN_RANGE(4,14,44, 4,15,0) + !LINUX_VERSION_IN_RANGE(4,14,44, 4,15,0) && \ + !(LINUX_VERSION_IS_GEQ(4,15,18) && UTS_UBUNTU_RELEASE_ABI >= 33) static inline unsigned long u64_stats_update_begin_irqsave(struct u64_stats_sync *syncp) {