From patchwork Wed Apr 4 12:12:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 132812 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4982889ljb; Wed, 4 Apr 2018 05:14:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx48LWC9G3G3R/Xpzcgf/Dm1ZI9Zeko7X9Pc3N4VQzKVZWWQYQoFkRDgxGEqXVgf7mXerDJXa X-Received: by 2002:a17:902:b707:: with SMTP id d7-v6mr18614206pls.188.1522844047472; Wed, 04 Apr 2018 05:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522844047; cv=none; d=google.com; s=arc-20160816; b=JUONnIL18GbRx85tfm2D37T147iG9KzGI3Q0GEqhoDHkWDll5deF50NHSXes7hmPDb qcuJYTqkEb1pnWX1IRBk/3uozLha17l7gU9q/jL3ISjk6iNeKa4uowoMHTP/3BHPnK0s m1QGrzN+ICrecvvkK+D5c+jXlHDXU5qgJQRGvIUD4fRGHN/T8uwomTuXImE1xTXYdpLz sT5LNFS23sV0zQ5oNxPUjjPxnzWx2B7UZyRhjaTre6G5ecHrOzOxGCTFtFICMobE4kW6 o0AUGWszViJWCjHyLlTQL+Bi0kJW3Oe7nxv3m/SNg8+4+jw+VshUppKWguZDzH58OEvP sgfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EUY1GLzgN5e+gyO+oSEQLFnpZfwKvKJ76JoRPOjp0CE=; b=JJ2uxvmk+Qk3Vz81PluHlP9pGuv03XjESqXTUMQY14SFMlVjng871lmEETsXVtNHVb 9mfNqRiYZljsgEaPi6Lgk80cmVLxtXTYNg6cs5FmI92AR2Xm9nnZR1A4Sz2NA2nvxR/b t7JLGAcxAgl+VOedAxluO8dWkkc8sts31UmWcAYIx03/M8eR2CbWH/sF2ijAvqVVhr9c l4j9/8H2S0aaCkifB6xINg4QDIcUDprr7oBzlH0p04e4MZpMnNcCMaRXnQFvw3/ci8pg sjZsaDfl7ssCoSABcpNQ+PKnatHxBBSpiT65pu5T0l7+U6U+htH4Jd6Uckw58zU0y2Af nqSw== ARC-Authentication-Results: i=1; mx.google.com; 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 x64si4068469pfj.318.2018.04.04.05.14.07; Wed, 04 Apr 2018 05:14:07 -0700 (PDT) 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; 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 S1751469AbeDDMOC (ORCPT + 29 others); Wed, 4 Apr 2018 08:14:02 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:54367 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbeDDMN7 (ORCPT ); Wed, 4 Apr 2018 08:13:59 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LvAna-1eM53V38mw-010OWs; Wed, 04 Apr 2018 14:13:51 +0200 From: Arnd Bergmann To: Jakub Kicinski Cc: Arnd Bergmann , David Ahern , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] netdevsim: remove incorrect __net_initdata annotations Date: Wed, 4 Apr 2018 14:12:39 +0200 Message-Id: <20180404121347.3089169-1-arnd@arndb.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nh03UCXkg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The __net_initdata section cannot currently be used for structures that get cleaned up in an exitcall using unregister_pernet_operations: WARNING: vmlinux.o(.text+0x868c34): Section mismatch in reference from the function nsim_devlink_exit() to the (unknown reference) .init.data:(unknown) The function nsim_devlink_exit() references the (unknown reference) __initdata (unknown). This is often because nsim_devlink_exit lacks a __initdata annotation or the annotation of (unknown) is wrong. WARNING: vmlinux.o(.text+0x868c64): Section mismatch in reference from the function nsim_devlink_init() to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.text+0x8692bc): Section mismatch in reference from the function nsim_fib_exit() to the (unknown reference) .init.data:(unknown) WARNING: vmlinux.o(.text+0x869300): Section mismatch in reference from the function nsim_fib_init() to the (unknown reference) .init.data:(unknown) As that warning tells us, discarding the structure after a module is loaded would lead to a undefined behavior when that module is removed. It might be possible to change that annotation so it has no effect for loadable modules, but I have not figured out exactly how to do that, and we want this to be fixed in -rc1. This just removes the annotations, just like we do for all other such modules. Fixes: 37923ed6b8ce ("netdevsim: Add simple FIB resource controller via devlink") Signed-off-by: Arnd Bergmann --- drivers/net/netdevsim/devlink.c | 2 +- drivers/net/netdevsim/fib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/net/netdevsim/devlink.c b/drivers/net/netdevsim/devlink.c index 27ae05c5fdaf..1dba47936456 100644 --- a/drivers/net/netdevsim/devlink.c +++ b/drivers/net/netdevsim/devlink.c @@ -267,7 +267,7 @@ static int __net_init nsim_devlink_netns_init(struct net *net) return 0; } -static struct pernet_operations nsim_devlink_net_ops __net_initdata = { +static struct pernet_operations nsim_devlink_net_ops = { .init = nsim_devlink_netns_init, .id = &nsim_devlink_id, .size = sizeof(bool), diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c index 0d105bafa261..9bfe9e151e13 100644 --- a/drivers/net/netdevsim/fib.c +++ b/drivers/net/netdevsim/fib.c @@ -230,7 +230,7 @@ static int __net_init nsim_fib_netns_init(struct net *net) return 0; } -static struct pernet_operations nsim_fib_net_ops __net_initdata = { +static struct pernet_operations nsim_fib_net_ops = { .init = nsim_fib_netns_init, .id = &nsim_fib_net_id, .size = sizeof(struct nsim_fib_data),