From: Jiri Slaby <jslaby@suse.cz>
To: Minfei Huang <mnfhuang@gmail.com>, Li Bin <huawei.libin@huawei.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
Nicholas Mc Guire <hofrat@osadl.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Seth Jennings <sjenning@redhat.com>,
Vojtech Pavlik <vojtech@suse.cz>,
"live-patching@vger.kernel.org" <live-patching@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
xiexiuqi <xiexiuqi@huawei.com>, Hanjun Guo <guohanjun@huawei.com>,
"mhuang@redhat.com" <mhuang@redhat.com>
Subject: Re: [PATCH] livepatch: match function return value type with prototype
Date: Tue, 26 May 2015 09:32:43 +0200 [thread overview]
Message-ID: <5564219B.9040406@suse.cz> (raw)
In-Reply-To: <CAKoi8F+336qjG0seS=idVy7TYJ=sQuj=WSySbZ2AX-URoWQGAA@mail.gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 05/26/2015, 06:46 AM, Minfei Huang wrote:
> On Tue, May 26, 2015 at 10:44 AM, Li Bin <huawei.libin@huawei.com>
> wrote:
>> The klp_is_module return type should be boolean.
>>
>> Signed-off-by: Li Bin <huawei.libin@huawei.com> ---
>> 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 284e269..30e9339 100644 --- a/kernel/livepatch/core.c +++
>> b/kernel/livepatch/core.c @@ -78,7 +78,7 @@ static struct klp_ops
>> *klp_find_ops(unsigned long old_addr)
>>
>> static bool klp_is_module(struct klp_object *obj) { -
>> return obj->name; + return !!obj->name; }
>
> Hi, Bin.
>
> Does compile blame the prototype before you convert it? If not, I
> think we do not need to fix it, since there are a lot of places in
> kernel where we return point value as boolean.
Yes, but the real reason is not that we use it on a lot of places, but
that it is standardized in ¶ 6.3.1.2:
When any scalar value is converted to _Bool, the result is 0 if the
value compares equal to 0; otherwise, the result is 1.
Along with the definition of scalar types:
Arithmetic types and pointer types are collectively called scalar types.
thanks,
- --
js
suse labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJVZCGXAAoJEL0lsQQGtHBJMCEP/AufUwrMFZ7KTD/pWKpjpDlu
fP8eflJ7iBxGtHXe9PGOsthY4kd1mB+kCo+54N1gks9bbnWF6P302hck5zrBHBdH
/wbo7YXhbHicUNAXZUzxfDh3nkKmR96CIeqZhMp2H1UBzmGRKzd6kVSdBwlbJ0/W
ZNcWmiIaALdr7aMEw+qEExV35kUdbJaqUcHKC9in3qQtlzCVQbZ5mCqURe+61ZTL
9u/Sbf3vB+nJPzyC/8uSVAxF616PiPdgGvxRrrRrRH82JmRaVJFjsRJ1WeMNxOFt
s4gbNByNePmTG3SisqFFKQ6VJYyeEsxkeRKbvL2mW4IlzJjiWCbp6XHcv2/IzR9g
GdIu3Kgy5R0OBXTxMbb5VLVtDRZUYnD/HiOFVLdUiqI6HQ/MtdZGujnVhWAVGIse
BD8T+hTOQyt6Yk7evlEF+REOlAU8jvBvnq3PUfRlUjWso8w0giPx1Re6rQk4k39P
TmfIVrve79n2nR/OejeCAB3xBEDtFbKBg9I+5ONm1gogxz/+3o6mwfMGS8TSdNs9
l4Kl/dhQhSW3aOmrclUoOZpcAzfTJSNCepTFq6+hKIbKibtnKs63wkLnGyL+XZSE
dEOWBC/B5YNC9VVAm20U8jAtUS5gw3n0NpXFTxOi0nb62IGY+mT+D5pPylVn31Rq
H7FDzgpZ7+lyvx+FDqpv
=UzJg
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2015-05-26 7:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2015-05-28 5:59 ` Li Bin
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=5564219B.9040406@suse.cz \
--to=jslaby@suse.cz \
--cc=guohanjun@huawei.com \
--cc=hofrat@osadl.org \
--cc=huawei.libin@huawei.com \
--cc=jkosina@suse.cz \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mhuang@redhat.com \
--cc=mnfhuang@gmail.com \
--cc=sjenning@redhat.com \
--cc=vojtech@suse.cz \
--cc=xiexiuqi@huawei.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