From patchwork Mon Aug 21 22:28:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 9913885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 03C54603FA for ; Mon, 21 Aug 2017 22:28:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D82F8286AA for ; Mon, 21 Aug 2017 22:28:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD4D6286C1; Mon, 21 Aug 2017 22:28:44 +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=-6.9 required=2.0 tests=BAYES_00,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 705CC286AA for ; Mon, 21 Aug 2017 22:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754229AbdHUW2o (ORCPT ); Mon, 21 Aug 2017 18:28:44 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:48919 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754019AbdHUW2n (ORCPT ); Mon, 21 Aug 2017 18:28:43 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id D3CF942524; Tue, 22 Aug 2017 00:28:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id 9w0dPO6uvpJn; Tue, 22 Aug 2017 00:28:40 +0200 (CEST) From: Hauke Mehrtens To: johannes@sipsolutions.net Cc: backports@vger.kernel.org, Hauke Mehrtens Subject: [PATCH 06/21] patches: adapt the stat64 usage for usbnet Date: Tue, 22 Aug 2017 00:28:02 +0200 Message-Id: <20170821222817.17376-7-hauke@hauke-m.de> In-Reply-To: <20170821222817.17376-1-hauke@hauke-m.de> References: <20170821222817.17376-1-hauke@hauke-m.de> Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The usbnet driver shares the stat64 implementation over multiple drivers and file, the spatch is not able to handle this, add a manual patch to work around this problem. The spatch is still modifying all usbnet drivers, but the function gets exported by the usbnet main driver now. Signed-off-by: Hauke Mehrtens --- patches/0075-ndo-stats-64.cocci | 2 +- patches/0075-ndo-stats-64/usbnet.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 patches/0075-ndo-stats-64/usbnet.patch diff --git a/patches/0075-ndo-stats-64.cocci b/patches/0075-ndo-stats-64.cocci index 756be958..86131824 100644 --- a/patches/0075-ndo-stats-64.cocci +++ b/patches/0075-ndo-stats-64.cocci @@ -18,7 +18,7 @@ identifier r.stats64_fn; @@ void stats64_fn(...) {...} +#if LINUX_VERSION_IS_LESS(4,11,0) -+static struct rtnl_link_stats64 * ++struct rtnl_link_stats64 * +stats64_fn_wrap(struct net_device *dev, + struct rtnl_link_stats64 *stats) +{ diff --git a/patches/0075-ndo-stats-64/usbnet.patch b/patches/0075-ndo-stats-64/usbnet.patch new file mode 100644 index 00000000..09de2784 --- /dev/null +++ b/patches/0075-ndo-stats-64/usbnet.patch @@ -0,0 +1,26 @@ +diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c +index 095bcfd..6305c41 100644 +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1014,6 +1014,7 @@ + } + } + EXPORT_SYMBOL_GPL(usbnet_get_stats64); ++EXPORT_SYMBOL_GPL(bp_usbnet_get_stats64); + + u32 usbnet_get_link (struct net_device *net) + { +diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h +index 9711637..363f6b9 100644 +--- a/include/linux/usb/usbnet.h ++++ b/include/linux/usb/usbnet.h +@@ -283,5 +283,9 @@ extern void usbnet_status_stop(struct usbnet *dev); + extern void usbnet_update_max_qlen(struct usbnet *dev); + extern void usbnet_get_stats64(struct net_device *dev, + struct rtnl_link_stats64 *stats); ++#if LINUX_VERSION_IS_LESS(4,11,0) ++struct rtnl_link_stats64 * ++bp_usbnet_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats); ++#endif + + #endif /* __LINUX_USB_USBNET_H */