public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] livepatch: match return value to function signature
@ 2015-05-11  5:52 Nicholas Mc Guire
  2015-05-11  8:24 ` Jiri Slaby
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Nicholas Mc Guire @ 2015-05-11  5:52 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Seth Jennings, Jiri Kosina, Vojtech Pavlik, live-patching,
	linux-kernel, Nicholas Mc Guire

klp_initialized() should return bool but is actually returning 
struct kobject * - convert it to a boolean explicitly.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

static code checking was not happy with
 ./kernel/livepatch/core.c:131 WARNING: return of wrong type
                               bool != struct kobject *

This adds !! to explicitly convert to boolean type.

Patch was compile tested with x86_64_defconfig

patch is against 4.1-rc2 (localversion-next is -next-20150508)

 kernel/livepatch/core.c     |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
index 0e7c23c..c0ae3d8 100644
--- a/kernel/livepatch/core.c
+++ b/kernel/livepatch/core.c
@@ -128,7 +128,7 @@ static bool klp_is_patch_registered(struct klp_patch *patch)
 
 static bool klp_initialized(void)
 {
-	return klp_root_kobj;
+	return !!klp_root_kobj;
 }
 
 struct klp_find_arg {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-05-28  5:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-11  5:52 [PATCH] livepatch: match return value to function signature Nicholas Mc Guire
2015-05-11  8:24 ` Jiri Slaby
2015-05-27  6:56   ` Nicholas Mc Guire
2015-05-27  7:14     ` Jiri Slaby
2015-05-27  7:21       ` Nicholas Mc Guire
2015-05-11 16:42 ` Josh Poimboeuf
2015-05-11 21:46 ` Jiri Kosina
2015-05-26  2:41   ` livepatch: match function return value type with prototype Li Bin
2015-05-26  2:44   ` [PATCH] " Li Bin
2015-05-26  4:46     ` Minfei Huang
2015-05-26  7:32       ` Jiri Slaby
2015-05-28  5:59         ` Li Bin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox