lkml.org 
[lkml]   [2014]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 2/3] kernel: add support for live patching
On 11/21/2014, 05:40 PM, Seth Jennings wrote:
>>> --- /dev/null
>>> +++ b/arch/x86/include/asm/livepatch.h
>>> @@ -0,0 +1,37 @@
...
>>> +#ifndef _ASM_X86_LIVEPATCH_H
>>> +#define _ASM_X86_LIVEPATCH_H
>>> +
>>> +#include <linux/module.h>
>>> +
>>> +#ifdef CONFIG_LIVE_PATCHING
>>> +extern int klp_write_module_reloc(struct module *mod, unsigned long type,
>>> + unsigned long loc, unsigned long value);
>>> +
>>> +#else
>>> +static int klp_write_module_reloc(struct module *mod, unsigned long type,
>>
>> static inline?
>
> I think the practice is to let the compiler handle inline determination
> unless you are sure that the compiler isn't inlining something you think
> it should.

Although you are right, it is a correct C, gcc specs (6.39) suggests to
use 'static inline' on such functions. gcc then shall inline such functions.

And if you look around in the kernel, we use that combination almost
everywhere.

thanks,
--
js
suse labs


\
 
 \ /
  Last update: 2014-11-21 19:01    [W:0.082 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site