linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
@ 2017-12-24  2:50 Nick Desaulniers
  2018-01-02  7:55 ` Juergen Gross
  2018-01-02 14:18 ` Boris Ostrovsky
  0 siblings, 2 replies; 8+ messages in thread
From: Nick Desaulniers @ 2017-12-24  2:50 UTC (permalink / raw)
  Cc: Nick Desaulniers, Boris Ostrovsky, Juergen Gross,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, xen-devel,
	linux-kernel

The header declares this function as __init but is defined in __ref
section.

Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
---
 arch/x86/xen/xen-ops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 75011b8..3b34745 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -72,7 +72,7 @@ u64 xen_clocksource_read(void);
 void xen_setup_cpu_clockevents(void);
 void xen_save_time_memory_area(void);
 void xen_restore_time_memory_area(void);
-void __init xen_init_time_ops(void);
+void __ref xen_init_time_ops(void);
 void __init xen_hvm_init_time_ops(void);
 
 irqreturn_t xen_debug_interrupt(int irq, void *dev_id);
-- 
2.7.4

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

* Re: [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
  2017-12-24  2:50 [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops() Nick Desaulniers
@ 2018-01-02  7:55 ` Juergen Gross
  2018-01-02 14:18 ` Boris Ostrovsky
  1 sibling, 0 replies; 8+ messages in thread
From: Juergen Gross @ 2018-01-02  7:55 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Boris Ostrovsky, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86, xen-devel, linux-kernel

On 24/12/17 03:50, Nick Desaulniers wrote:
> The header declares this function as __init but is defined in __ref
> section.
> 
> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

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

* Re: [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
  2017-12-24  2:50 [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops() Nick Desaulniers
  2018-01-02  7:55 ` Juergen Gross
@ 2018-01-02 14:18 ` Boris Ostrovsky
  2018-01-02 14:24   ` Juergen Gross
  1 sibling, 1 reply; 8+ messages in thread
From: Boris Ostrovsky @ 2018-01-02 14:18 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	xen-devel, linux-kernel

On 12/23/2017 09:50 PM, Nick Desaulniers wrote:
> The header declares this function as __init but is defined in __ref
> section.
>
> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>

AFAIK section attributes in header files are ignored by compiler anyway
so I'd remove all of them.

-boris


> ---
>  arch/x86/xen/xen-ops.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
> index 75011b8..3b34745 100644
> --- a/arch/x86/xen/xen-ops.h
> +++ b/arch/x86/xen/xen-ops.h
> @@ -72,7 +72,7 @@ u64 xen_clocksource_read(void);
>  void xen_setup_cpu_clockevents(void);
>  void xen_save_time_memory_area(void);
>  void xen_restore_time_memory_area(void);
> -void __init xen_init_time_ops(void);
> +void __ref xen_init_time_ops(void);
>  void __init xen_hvm_init_time_ops(void);
>  
>  irqreturn_t xen_debug_interrupt(int irq, void *dev_id);

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

* Re: [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
  2018-01-02 14:18 ` Boris Ostrovsky
@ 2018-01-02 14:24   ` Juergen Gross
  2018-01-02 14:32     ` [Xen-devel] " Andrew Cooper
  0 siblings, 1 reply; 8+ messages in thread
From: Juergen Gross @ 2018-01-02 14:24 UTC (permalink / raw)
  To: Boris Ostrovsky, Nick Desaulniers
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, xen-devel,
	linux-kernel

On 02/01/18 15:18, Boris Ostrovsky wrote:
> On 12/23/2017 09:50 PM, Nick Desaulniers wrote:
>> The header declares this function as __init but is defined in __ref
>> section.
>>
>> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
> 
> AFAIK section attributes in header files are ignored by compiler anyway
> so I'd remove all of them.

Hmm, I'm not sure all future compilers will ignore the section
attributes. include/linux/init.h explictily mentions where to put
the attrubute in a prototype, so I'd rather keep it.


Juergen

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

* Re: [Xen-devel] [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
  2018-01-02 14:24   ` Juergen Gross
@ 2018-01-02 14:32     ` Andrew Cooper
  2018-01-02 15:00       ` Boris Ostrovsky
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2018-01-02 14:32 UTC (permalink / raw)
  To: Juergen Gross, Boris Ostrovsky, Nick Desaulniers
  Cc: x86, linux-kernel, Ingo Molnar, H. Peter Anvin, xen-devel,
	Thomas Gleixner

On 02/01/18 14:24, Juergen Gross wrote:
> On 02/01/18 15:18, Boris Ostrovsky wrote:
>> On 12/23/2017 09:50 PM, Nick Desaulniers wrote:
>>> The header declares this function as __init but is defined in __ref
>>> section.
>>>
>>> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
>> AFAIK section attributes in header files are ignored by compiler anyway
>> so I'd remove all of them.
> Hmm, I'm not sure all future compilers will ignore the section
> attributes. include/linux/init.h explictily mentions where to put
> the attrubute in a prototype, so I'd rather keep it.

Attributes in the declaration are for static analysis tools such as sparse.

How else are you going to work out whether a section mismatch has occurred?

~Andrew

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

* Re: [Xen-devel] [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
  2018-01-02 14:32     ` [Xen-devel] " Andrew Cooper
@ 2018-01-02 15:00       ` Boris Ostrovsky
  2018-01-06 20:35         ` Nick Desaulniers
  0 siblings, 1 reply; 8+ messages in thread
From: Boris Ostrovsky @ 2018-01-02 15:00 UTC (permalink / raw)
  To: Andrew Cooper, Juergen Gross, Nick Desaulniers
  Cc: x86, linux-kernel, Ingo Molnar, H. Peter Anvin, xen-devel,
	Thomas Gleixner

On 01/02/2018 09:32 AM, Andrew Cooper wrote:
> On 02/01/18 14:24, Juergen Gross wrote:
>> On 02/01/18 15:18, Boris Ostrovsky wrote:
>>> On 12/23/2017 09:50 PM, Nick Desaulniers wrote:
>>>> The header declares this function as __init but is defined in __ref
>>>> section.
>>>>
>>>> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
>>> AFAIK section attributes in header files are ignored by compiler anyway
>>> so I'd remove all of them.
>> Hmm, I'm not sure all future compilers will ignore the section
>> attributes. include/linux/init.h explictily mentions where to put
>> the attrubute in a prototype, so I'd rather keep it.
> Attributes in the declaration are for static analysis tools such as sparse.
>
> How else are you going to work out whether a section mismatch has occurred?

Isn't this done based on definitions?

Tons of __init routines don't have the attribute specified in header
files. In fact, even in this file (arch/x86/xen/xen-ops.h) there are
some that don't have it.

-boris

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

* Re: [Xen-devel] [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
  2018-01-02 15:00       ` Boris Ostrovsky
@ 2018-01-06 20:35         ` Nick Desaulniers
  2018-01-08 14:49           ` Boris Ostrovsky
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Desaulniers @ 2018-01-06 20:35 UTC (permalink / raw)
  To: Boris Ostrovsky
  Cc: Andrew Cooper, Juergen Gross, x86, Linux Kernel Mailing List,
	Ingo Molnar, H. Peter Anvin, xen-devel, Thomas Gleixner

On Tue, Jan 2, 2018 at 7:00 AM, Boris Ostrovsky
<boris.ostrovsky@oracle.com> wrote:
> On 01/02/2018 09:32 AM, Andrew Cooper wrote:
>> On 02/01/18 14:24, Juergen Gross wrote:
>>> On 02/01/18 15:18, Boris Ostrovsky wrote:
>>>> On 12/23/2017 09:50 PM, Nick Desaulniers wrote:
>>>>> The header declares this function as __init but is defined in __ref
>>>>> section.
>>>>>
>>>>> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
>>>> AFAIK section attributes in header files are ignored by compiler anyway
>>>> so I'd remove all of them.
>>> Hmm, I'm not sure all future compilers will ignore the section
>>> attributes. include/linux/init.h explictily mentions where to put
>>> the attrubute in a prototype, so I'd rather keep it.
>> Attributes in the declaration are for static analysis tools such as sparse.
>>
>> How else are you going to work out whether a section mismatch has occurred?
>
> Isn't this done based on definitions?
>
> Tons of __init routines don't have the attribute specified in header
> files. In fact, even in this file (arch/x86/xen/xen-ops.h) there are
> some that don't have it.
>
> -boris

What are the next steps for getting this patch merged? This is the
only function for which I get a compiler warning (with Clang).  Do you
require a patch instead that changes more function attributes, or can
that be a follow up patch?

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

* Re: [Xen-devel] [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops()
  2018-01-06 20:35         ` Nick Desaulniers
@ 2018-01-08 14:49           ` Boris Ostrovsky
  0 siblings, 0 replies; 8+ messages in thread
From: Boris Ostrovsky @ 2018-01-08 14:49 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Juergen Gross, Andrew Cooper, x86, Linux Kernel Mailing List,
	Ingo Molnar, H. Peter Anvin, xen-devel, Thomas Gleixner

On 01/06/2018 03:35 PM, Nick Desaulniers wrote:
> On Tue, Jan 2, 2018 at 7:00 AM, Boris Ostrovsky
> <boris.ostrovsky@oracle.com> wrote:
>> On 01/02/2018 09:32 AM, Andrew Cooper wrote:
>>> On 02/01/18 14:24, Juergen Gross wrote:
>>>> On 02/01/18 15:18, Boris Ostrovsky wrote:
>>>>> On 12/23/2017 09:50 PM, Nick Desaulniers wrote:
>>>>>> The header declares this function as __init but is defined in __ref
>>>>>> section.
>>>>>>
>>>>>> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
>>>>> AFAIK section attributes in header files are ignored by compiler anyway
>>>>> so I'd remove all of them.
>>>> Hmm, I'm not sure all future compilers will ignore the section
>>>> attributes. include/linux/init.h explictily mentions where to put
>>>> the attrubute in a prototype, so I'd rather keep it.
>>> Attributes in the declaration are for static analysis tools such as sparse.
>>>
>>> How else are you going to work out whether a section mismatch has occurred?
>> Isn't this done based on definitions?
>>
>> Tons of __init routines don't have the attribute specified in header
>> files. In fact, even in this file (arch/x86/xen/xen-ops.h) there are
>> some that don't have it.
>>
>> -boris
> What are the next steps for getting this patch merged? This is the
> only function for which I get a compiler warning (with Clang).  Do you
> require a patch instead that changes more function attributes, or can
> that be a follow up patch?

Applied to for-linus-4.15.

-boris

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

end of thread, other threads:[~2018-01-08 14:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-24  2:50 [PATCH] x86/xen/time: fix section mismatch for xen_init_time_ops() Nick Desaulniers
2018-01-02  7:55 ` Juergen Gross
2018-01-02 14:18 ` Boris Ostrovsky
2018-01-02 14:24   ` Juergen Gross
2018-01-02 14:32     ` [Xen-devel] " Andrew Cooper
2018-01-02 15:00       ` Boris Ostrovsky
2018-01-06 20:35         ` Nick Desaulniers
2018-01-08 14:49           ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).