xen: Remove the use of K&R functions
PATCH 1/1 xen: Remove the use of K&R functions
Clang-15 (as seen in the FreeBSD 14 tests) complains:
arch/x86/time.c:1364:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] s_time_t get_s_time()
^
voidThe error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally removes K&R syntax.
Either way, fix the offending functions.
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
These are all the examples found in a default build of Xen. I'm still finding toolstack violations.
--- xen/arch/x86/time.c | 2 +- xen/drivers/passthrough/iommu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
xen/arch/x86/time.c +1 -1
@@ -1361,7 +1361,7 @@ s_time_t get_s_time_fixed(u64 at_tsc)return t->stamp.local_stime +scale_delta (delta, &t->tsc_scale); } -s_time_t get_s_time () +s_time_t get_s_time (void ) {return get_s_time_fixed (0 ); }
xen/drivers/passthrough/iommu.c +2 -2
@@ -606,7 +606,7 @@ int __init iommu_setup(void)return rc; } -int iommu_suspend () +int iommu_suspend (void ) {if ( iommu_enabled )return iommu_call (iommu_get_ops (), suspend);
@@ -614,7 +614,7 @@ int iommu_suspend()return 0 ; } -void iommu_resume () +void iommu_resume (void ) {if ( iommu_enabled )iommu_vcall (iommu_get_ops (), resume);
Signature · 1 line
2.30.2
Quoted 14 lines · Andrew Cooper
Clang-15 (as seen in the FreeBSD 14 tests) complains:
arch/x86/time.c:1364:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]s_time_tget_s_time()^ voidThe error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally removes K&R syntax.
Either way, fix the offending functions.
Quoted 8 lines
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>These are all the examples found in a default build of Xen. I'm still finding toolstack violations.
Apparently not. int cf_check vmx_cpu_up() too.
~Andrew
Quoted 21 lines · Andrew Cooper
Quoted 20 lines · Andrew Cooper
Clang-15 (as seen in the FreeBSD 14 tests) complains:
arch/x86/time.c:1364:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]s_time_tget_s_time()^ voidThe error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally removes K&R syntax.
Either way, fix the offending functions.
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>
Quoted 3 lines
Quoted 2 lines
These are all the examples found in a default build of Xen. I'm still finding toolstack violations.
Apparently not. int
cf_checkvmx_cpu_up()too.
Ok, finally got a clean Clang-15 build. I've folded this hunk into the patch:
xen/arch/x86/hvm/vmx/vmcs.c +0 -0
@@ -781,7 +781,7 @@ static int _vmx_cpu_up(bool bsp)
return 0;
}
-int cf_check vmx_cpu_up()
+int cf_check vmx_cpu_up(void)
{
return _vmx_cpu_up(false);
}
but am not intending to send a v2 given how trivial it is.
~Andrew
Jan Beulich
Reviewed-byQuoted 44 lines · Andrew Cooper
Quoted 21 lines · Andrew Cooper
Quoted 20 lines · Andrew Cooper
Clang-15 (as seen in the FreeBSD 14 tests) complains:
arch/x86/time.c:1364:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]s_time_tget_s_time()^ voidThe error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally removes K&R syntax.
Either way, fix the offending functions.
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Wei Liu <[email protected]>Quoted 3 lines
Quoted 2 lines
These are all the examples found in a default build of Xen. I'm still finding toolstack violations.
Apparently not. int
cf_checkvmx_cpu_up()too.Ok, finally got a clean Clang-15 build. I've folded this hunk into the patch:
xen/arch/x86/hvm/vmx/vmcs.c +0
-0@@ -781,7 +781,7 @@ static int _vmx_cpu_up(bool bsp) return 0; }xen/arch/x86/hvm/vmx/vmcs.c +1
-1-int cf_check vmx_cpu_up() +int cf_check vmx_cpu_up(void){
return_vmx_cpu_up(false);
}
Quoted 1 line
but am not intending to send a v2 given how trivial it is.
Sure.
Jan