xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xenproject.org,
	David Vrabel <david.vrabel@citrix.com>
Subject: [PATCH 4/5] drivers/xen: make sys-hypervisor.c explicitly non-modular
Date: Sun, 14 Feb 2016 15:32:49 -0500	[thread overview]
Message-ID: <1455481970-15239-5-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1455481970-15239-1-git-send-email-paul.gortmaker@windriver.com>

The Kconfig currently controlling compilation of this code is:

config XEN_SYS_HYPERVISOR
       bool "Create xen entries under /sys/hypervisor"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.  However
one could argue that fs_initcall() might make more sense here.

This change means that the one line function xen_properties_destroy()
has only one user left, and since that is inside an #ifdef, we just
manually inline it there vs. adding more ifdeffery around the function
to avoid compile warnings about "defined but not used".

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/xen/sys-hypervisor.c | 31 ++++---------------------------
 1 file changed, 4 insertions(+), 27 deletions(-)

diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index b5a7342e0ba5..ea6e98d60af0 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -9,7 +9,7 @@
 
 #include <linux/slab.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/kobject.h>
 #include <linux/err.h>
 
@@ -366,11 +366,6 @@ static int __init xen_properties_init(void)
 	return sysfs_create_group(hypervisor_kobj, &xen_properties_group);
 }
 
-static void xen_properties_destroy(void)
-{
-	sysfs_remove_group(hypervisor_kobj, &xen_properties_group);
-}
-
 #ifdef CONFIG_XEN_HAVE_VPMU
 struct pmu_mode {
 	const char *name;
@@ -484,11 +479,6 @@ static int __init xen_pmu_init(void)
 {
 	return sysfs_create_group(hypervisor_kobj, &xen_pmu_group);
 }
-
-static void xen_pmu_destroy(void)
-{
-	sysfs_remove_group(hypervisor_kobj, &xen_pmu_group);
-}
 #endif
 
 static int __init hyper_sysfs_init(void)
@@ -517,7 +507,8 @@ static int __init hyper_sysfs_init(void)
 	if (xen_initial_domain()) {
 		ret = xen_pmu_init();
 		if (ret) {
-			xen_properties_destroy();
+			sysfs_remove_group(hypervisor_kobj,
+					   &xen_properties_group);
 			goto prop_out;
 		}
 	}
@@ -535,21 +526,7 @@ version_out:
 out:
 	return ret;
 }
-
-static void __exit hyper_sysfs_exit(void)
-{
-#ifdef CONFIG_XEN_HAVE_VPMU
-	xen_pmu_destroy();
-#endif
-	xen_properties_destroy();
-	xen_compilation_destroy();
-	xen_sysfs_uuid_destroy();
-	xen_sysfs_version_destroy();
-	xen_sysfs_type_destroy();
-
-}
-module_init(hyper_sysfs_init);
-module_exit(hyper_sysfs_exit);
+device_initcall(hyper_sysfs_init);
 
 static ssize_t hyp_sysfs_show(struct kobject *kobj,
 			      struct attribute *attr,
-- 
2.6.1

  parent reply	other threads:[~2016-02-14 20:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1455481970-15239-1-git-send-email-paul.gortmaker@windriver.com>
2016-02-14 20:32 ` [PATCH 1/5] xen: audit usages of module.h ; remove unnecessary instances Paul Gortmaker
2016-02-15 11:44   ` Stefano Stabellini
2016-02-14 20:32 ` [PATCH 2/5] drivers/xen: make [xen-]ballon explicitly non-modular Paul Gortmaker
2016-02-14 20:32 ` [PATCH 3/5] drivers/xen: make xenbus_dev_[front/back]end " Paul Gortmaker
2016-02-14 20:32 ` Paul Gortmaker [this message]
2016-02-15 11:54   ` [PATCH 4/5] drivers/xen: make sys-hypervisor.c " Stefano Stabellini
2016-02-14 20:32 ` [PATCH 5/5] drivers/xen: make platform-pci.c " Paul Gortmaker
     [not found] ` <1455481970-15239-3-git-send-email-paul.gortmaker@windriver.com>
2016-02-15 11:49   ` [PATCH 2/5] drivers/xen: make [xen-]ballon " Stefano Stabellini
     [not found] ` <1455481970-15239-4-git-send-email-paul.gortmaker@windriver.com>
2016-02-15 11:53   ` [PATCH 3/5] drivers/xen: make xenbus_dev_[front/back]end " Stefano Stabellini
     [not found] ` <1455481970-15239-6-git-send-email-paul.gortmaker@windriver.com>
2016-02-15 11:55   ` [PATCH 5/5] drivers/xen: make platform-pci.c " Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455481970-15239-5-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).