Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752872AbbEKIYs (ORCPT ); Mon, 11 May 2015 04:24:48 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:36254 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752344AbbEKIYq (ORCPT ); Mon, 11 May 2015 04:24:46 -0400 Message-ID: <5550674A.4030203@suse.cz> Date: Mon, 11 May 2015 10:24:42 +0200 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Nicholas Mc Guire , Josh Poimboeuf CC: Seth Jennings , Jiri Kosina , Vojtech Pavlik , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] livepatch: match return value to function signature References: <1431323549-27343-1-git-send-email-hofrat@osadl.org> In-Reply-To: <1431323549-27343-1-git-send-email-hofrat@osadl.org> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1375 Lines: 49 On 05/11/2015, 07:52 AM, Nicholas Mc Guire wrote: > klp_initialized() should return bool but is actually returning > struct kobject * - convert it to a boolean explicitly. > > Signed-off-by: Nicholas Mc Guire Reviewed-by: Jiri Slaby Thanks. > --- > > 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 { > -- js suse labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/