From patchwork Sun Sep 23 17:45:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 10611845 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 06F136CB for ; Sun, 23 Sep 2018 17:45:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECCFC29FA8 for ; Sun, 23 Sep 2018 17:45:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E12EB29FAC; Sun, 23 Sep 2018 17:45:50 +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 962AA294A3 for ; Sun, 23 Sep 2018 17:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbeIWXoE (ORCPT ); Sun, 23 Sep 2018 19:44:04 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:38508 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726951AbeIWXoE (ORCPT ); Sun, 23 Sep 2018 19:44:04 -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 1587949129; Sun, 23 Sep 2018 19:45:49 +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 imDP8h8AReiU; Sun, 23 Sep 2018 19:45:46 +0200 (CEST) From: Hauke Mehrtens To: johannes@sipsolutions.net Cc: backports@vger.kernel.org, john@phrozen.org, Hauke Mehrtens Subject: [PATCH 09/10] backports: Make netdev destructor spatch apply correctly again Date: Sun, 23 Sep 2018 19:45:34 +0200 Message-Id: <20180923174535.16198-10-hauke@hauke-m.de> In-Reply-To: <20180923174535.16198-1-hauke@hauke-m.de> References: <20180923174535.16198-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 netdev destructor spatch did not apply to the wil6210 driver any more, because there the calls were done in a different order compared to the spatch. Add an additional rule which applies when the order is changed. Fixes: 30a378636e47 ("backports: speed up netdev destructor spatch by two orders of magnitude") Signed-off-by: Hauke Mehrtens --- patches/0079-netdev-destructor.cocci | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/patches/0079-netdev-destructor.cocci b/patches/0079-netdev-destructor.cocci index f2bea35b..8d7228ec 100644 --- a/patches/0079-netdev-destructor.cocci +++ b/patches/0079-netdev-destructor.cocci @@ -67,6 +67,38 @@ if (<+... RET ...+>) { ...> } +@r11@ +struct net_device *NDEV; +identifier D, C; +identifier TRUE =~ "true"; +@@ +C(...) +{ + <+... +- NDEV->priv_destructor = D; +- NDEV->needs_free_netdev = TRUE; ++ netdev_set_priv_destructor(NDEV, D); + ...+> +} + +@r12 depends on r11@ +identifier r11.D, r11.C; +fresh identifier E = "__" ## D; +@@ + ++#if LINUX_VERSION_IS_LESS(4,12,0) ++static void E(struct net_device *ndev) ++{ ++ D(ndev); ++ free_netdev(ndev); ++} ++#endif ++ +C(...) +{ + ... +} + @r5@ struct net_device *NDEV; identifier TRUE =~ "true";