Skip to contentSkip to conversation

x86/xen/time: fix section mismatch for xen_init_time_ops()

PATCH Applied Nick Desaulniers 4 participants 14 messages Dec 24, 2017 – Jan 8, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/xen/time: fix section mismatch for xen_init_time_ops()

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

---
 arch/x86/xen/xen-ops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/xen-ops.h +1 -1
index 75011b8..3b34745 100644
@@ -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);
Signature · 1 line
2.7.4
#3 lore raw
In reply to Nick Desaulniers
Quoted 4 lines · Nick Desaulniers

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

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

-boris

Quoted 9 lines
---
 arch/x86/xen/xen-ops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/xen-ops.h +0 -0
index 75011b8..3b34745 100644

arch/x86/xen/xen-ops.h u64 xen_clocksource_read(void); · line 78

Quoted 8 lines
arch/x86/xen/xen-ops.h +1 -1
@@ -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);

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
In reply to Nick Desaulniers
Quoted 4 lines · Nick Desaulniers

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

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

-boris

Quoted 17 lines
---
 arch/x86/xen/xen-ops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/xen/xen-ops.h +1 -1
index 75011b8..3b34745 100644
@@ -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);
maintainer
#5 lore raw
Quoted 8 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

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

#6 lore raw
Quoted 11 lines · Juergen Gross
Quoted 7 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

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

#7 lore raw
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Juergen Gross
Quoted 5 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw
In reply to Andrew Cooper
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Juergen Gross
Quoted 5 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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

#9 lore raw
Quoted 17 lines · Boris Ostrovsky
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Juergen Gross
Quoted 5 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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?

Quoted 7 lines

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?

reviewer Applied
#10 lore raw
Quoted 24 lines · Nick Desaulniers
Quoted 22 lines · Boris Ostrovsky
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Juergen Gross
Quoted 5 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 5 lines
Quoted 1 line

-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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

reviewer Applied
#11 lore raw
In reply to Nick Desaulniers
Quoted 24 lines · Nick Desaulniers
Quoted 22 lines · Boris Ostrovsky
Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Juergen Gross
Quoted 5 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 5 lines
Quoted 1 line

-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

#12 lore raw
In reply to Juergen Gross
Quoted 11 lines · Juergen Gross
Quoted 7 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

maintainer
#13 lore raw
In reply to Boris Ostrovsky
Quoted 8 lines · Boris Ostrovsky
Quoted 4 lines · Nick Desaulniers

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

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

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel