From patchwork Thu Sep 20 11:28:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10607535 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 53428157B for ; Thu, 20 Sep 2018 11:29:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A6A2D0AA for ; Thu, 20 Sep 2018 11:29:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 383152D0C0; Thu, 20 Sep 2018 11:29:04 +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 CF2A92D0AA for ; Thu, 20 Sep 2018 11:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732442AbeITRMF (ORCPT ); Thu, 20 Sep 2018 13:12:05 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:51032 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732412AbeITRMF (ORCPT ); Thu, 20 Sep 2018 13:12:05 -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 1g2x8g-0004SQ-Ar; Thu, 20 Sep 2018 14:28:54 +0300 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Thu, 20 Sep 2018 14:28:38 +0300 Message-Id: <20180920112842.27198-11-luca@coelho.fi> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180920112842.27198-1-luca@coelho.fi> References: <20180920112842.27198-1-luca@coelho.fi> Subject: [PATCH 10/14] backport: update u64_stats_init() to a new version in kernels < 4.2 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 The u64_stats_init() macro was turned into a static inline function in v4.2 to prevent warnings that happen when its argument is not used elsewhere. Since we started hitting these warnings, undefine the macro and define the static inline to prevent them. Signed-off-by: Luca Coelho --- backport/backport-include/linux/netdevice.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index 8723f8c58e84..44319331fce8 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -263,6 +263,16 @@ netdev_features_t passthru_features_check(struct sk_buff *skb, netdev_features_t features); #endif /* LINUX_VERSION_IS_LESS(4,1,0) */ +#if LINUX_VERSION_IS_LESS(4,2,0) +#undef u64_stats_init +static inline void u64_stats_init(struct u64_stats_sync *syncp) +{ +#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) + seqcount_init(&syncp->seq); +#endif +} +#endif /* LINUX_VERSION_IS_LESS(4,2,0) */ + #ifndef netdev_alloc_pcpu_stats #define netdev_alloc_pcpu_stats(type) \ ({ \