* [PATCH 1/2] init/main.c: obsolete_checksetup can be boolean
@ 2015-11-17 3:18 Yaowei Bai
2015-11-17 3:18 ` [PATCH 2/2] init/do_mounts: initrd_load " Yaowei Bai
0 siblings, 1 reply; 2+ messages in thread
From: Yaowei Bai @ 2015-11-17 3:18 UTC (permalink / raw)
To: akpm, paulmck, bobby.prani, dhowells, mhocko, hannes, David.Woodhouse
Cc: linux-kernel
This patch makes obsolete_checksetup return bool due to this
particular function only using either one or zero as its return
value.
No functional change.
Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
init/main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/init/main.c b/init/main.c
index 9e64d70..23449b7 100644
--- a/init/main.c
+++ b/init/main.c
@@ -164,10 +164,10 @@ static const char *panic_later, *panic_param;
extern const struct obs_kernel_param __setup_start[], __setup_end[];
-static int __init obsolete_checksetup(char *line)
+static bool __init obsolete_checksetup(char *line)
{
const struct obs_kernel_param *p;
- int had_early_param = 0;
+ bool had_early_param = false;
p = __setup_start;
do {
@@ -179,13 +179,13 @@ static int __init obsolete_checksetup(char *line)
* Keep iterating, as we can have early
* params and __setups of same names 8( */
if (line[n] == '\0' || line[n] == '=')
- had_early_param = 1;
+ had_early_param = true;
} else if (!p->setup_func) {
pr_warn("Parameter %s is obsolete, ignored\n",
p->str);
- return 1;
+ return true;
} else if (p->setup_func(line + n))
- return 1;
+ return true;
}
p++;
} while (p < __setup_end);
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] init/do_mounts: initrd_load can be boolean
2015-11-17 3:18 [PATCH 1/2] init/main.c: obsolete_checksetup can be boolean Yaowei Bai
@ 2015-11-17 3:18 ` Yaowei Bai
0 siblings, 0 replies; 2+ messages in thread
From: Yaowei Bai @ 2015-11-17 3:18 UTC (permalink / raw)
To: akpm, paulmck, bobby.prani, dhowells, mhocko, hannes, David.Woodhouse
Cc: linux-kernel
This patch makes initrd_load return bool due to this particular
function only using either one or zero as its return value.
No functional change.
Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
---
init/do_mounts.h | 4 ++--
init/do_mounts_initrd.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/init/do_mounts.h b/init/do_mounts.h
index f5b978a..067af1d 100644
--- a/init/do_mounts.h
+++ b/init/do_mounts.h
@@ -57,11 +57,11 @@ static inline int rd_load_image(char *from) { return 0; }
#ifdef CONFIG_BLK_DEV_INITRD
-int __init initrd_load(void);
+bool __init initrd_load(void);
#else
-static inline int initrd_load(void) { return 0; }
+static inline bool initrd_load(void) { return false; }
#endif
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 3e0878e..a1000ca 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -116,7 +116,7 @@ static void __init handle_initrd(void)
}
}
-int __init initrd_load(void)
+bool __init initrd_load(void)
{
if (mount_initrd) {
create_dev("/dev/ram", Root_RAM0);
@@ -129,9 +129,9 @@ int __init initrd_load(void)
if (rd_load_image("/initrd.image") && ROOT_DEV != Root_RAM0) {
sys_unlink("/initrd.image");
handle_initrd();
- return 1;
+ return true;
}
}
sys_unlink("/initrd.image");
- return 0;
+ return false;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-17 3:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-17 3:18 [PATCH 1/2] init/main.c: obsolete_checksetup can be boolean Yaowei Bai
2015-11-17 3:18 ` [PATCH 2/2] init/do_mounts: initrd_load " Yaowei Bai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.