From: "Jan Beulich" <JBeulich@suse.com>
To: "Jeremy Fitzhardinge" <jeremy@goop.org>,
"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
<dan.magenheimer@oracle.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] xen/tmem: cleanup
Date: Fri, 03 Feb 2012 15:09:04 +0000 [thread overview]
Message-ID: <4F2C06A00200007800071071@nat28.tlf.novell.com> (raw)
Use 'bool' for boolean variables. Do proper section placement.
Eliminate an unnecessary export.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
---
drivers/xen/tmem.c | 21 ++++++++-------------
include/xen/tmem.h | 6 +++++-
2 files changed, 13 insertions(+), 14 deletions(-)
--- 3.3-rc2/drivers/xen/tmem.c
+++ 3.3-rc2-xen-tmem-cleanup/drivers/xen/tmem.c
@@ -9,7 +9,6 @@
#include <linux/types.h>
#include <linux/init.h>
#include <linux/pagemap.h>
-#include <linux/module.h>
#include <linux/cleancache.h>
/* temporary ifdef until include/linux/frontswap.h is upstream */
@@ -128,15 +127,13 @@ static int xen_tmem_flush_object(u32 poo
return xen_tmem_op(TMEM_FLUSH_OBJECT, pool_id, oid, 0, 0, 0, 0, 0);
}
-int tmem_enabled __read_mostly;
-EXPORT_SYMBOL(tmem_enabled);
+bool __read_mostly tmem_enabled = false;
static int __init enable_tmem(char *s)
{
- tmem_enabled = 1;
+ tmem_enabled = true;
return 1;
}
-
__setup("tmem", enable_tmem);
#ifdef CONFIG_CLEANCACHE
@@ -229,17 +226,16 @@ static int tmem_cleancache_init_shared_f
return xen_tmem_new_pool(shared_uuid, TMEM_POOL_SHARED, pagesize);
}
-static int use_cleancache = 1;
+static bool __initdata use_cleancache = true;
static int __init no_cleancache(char *s)
{
- use_cleancache = 0;
+ use_cleancache = false;
return 1;
}
-
__setup("nocleancache", no_cleancache);
-static struct cleancache_ops tmem_cleancache_ops = {
+static struct cleancache_ops __initdata tmem_cleancache_ops = {
.put_page = tmem_cleancache_put_page,
.get_page = tmem_cleancache_get_page,
.flush_page = tmem_cleancache_flush_page,
@@ -356,17 +352,16 @@ static void tmem_frontswap_init(unsigned
xen_tmem_new_pool(private, TMEM_POOL_PERSIST, PAGE_SIZE);
}
-static int __initdata use_frontswap = 1;
+static bool __initdata use_frontswap = true;
static int __init no_frontswap(char *s)
{
- use_frontswap = 0;
+ use_frontswap = false;
return 1;
}
-
__setup("nofrontswap", no_frontswap);
-static struct frontswap_ops tmem_frontswap_ops = {
+static struct frontswap_ops __initdata tmem_frontswap_ops = {
.put_page = tmem_frontswap_put_page,
.get_page = tmem_frontswap_get_page,
.flush_page = tmem_frontswap_flush_page,
--- 3.3-rc2/include/xen/tmem.h
+++ 3.3-rc2-xen-tmem-cleanup/include/xen/tmem.h
@@ -1,5 +1,9 @@
#ifndef _XEN_TMEM_H
#define _XEN_TMEM_H
+
+#include <linux/types.h>
+
/* defined in drivers/xen/tmem.c */
-extern int tmem_enabled;
+extern bool tmem_enabled;
+
#endif /* _XEN_TMEM_H */
next reply other threads:[~2012-02-03 15:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-03 15:09 Jan Beulich [this message]
2012-02-04 16:42 ` [PATCH] xen/tmem: cleanup Dan Magenheimer
2012-02-06 8:12 ` Jan Beulich
2012-02-06 16:37 ` Dan Magenheimer
2012-02-06 16:49 ` Jan Beulich
2012-02-06 17:02 ` Konrad Rzeszutek Wilk
2012-02-06 17:22 ` Dan Magenheimer
2012-02-09 20:15 ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-02-07 7:51 ` Jan Beulich
2012-02-07 10:23 ` [Xen-devel] " Vasiliy Tolstov
2012-02-09 20:40 ` Konrad Rzeszutek Wilk
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=4F2C06A00200007800071071@nat28.tlf.novell.com \
--to=jbeulich@suse.com \
--cc=dan.magenheimer@oracle.com \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xen-devel@lists.xensource.com \
/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).