]> xenbits.xensource.com Git - xen.git/commitdiff
xen/x86: Remove the use of K&R functions
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 17 Jul 2023 07:41:22 +0000 (09:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 17 Jul 2023 07:41:22 +0000 (09:41 +0200)
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()
                     ^
                      void

The 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 identified functions.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Backport: Also deal with powernow_register_driver() and flush_all_cache().

master commit: 22b2fa4766728c3057757c00e79da5f7803fff33
master date: 2023-02-17 11:01:54 +0000

xen/arch/x86/acpi/cpufreq/powernow.c
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/time.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/vtd/x86/vtd.c

index f620bebc7e916f6b4e6b092ae644270f83d2fc5c..b17dc612ffa74ebb122602e1b1de93ba0b266431 100644 (file)
@@ -353,7 +353,7 @@ static const struct cpufreq_driver __initconstrel powernow_cpufreq_driver = {
     .update = powernow_cpufreq_update
 };
 
-unsigned int __init powernow_register_driver()
+unsigned int __init powernow_register_driver(void)
 {
     unsigned int i, ret = 0;
 
index 237b13459d4f17f6f2ea56482084dba7eaa4003b..c2a1d7280d96d1f9c7417b573e0b27c17dcfa8d7 100644 (file)
@@ -774,7 +774,7 @@ static int _vmx_cpu_up(bool bsp)
     return 0;
 }
 
-int vmx_cpu_up()
+int vmx_cpu_up(void)
 {
     return _vmx_cpu_up(false);
 }
index db0b149ec6187a2c73c68e1a7291672dba51d8b8..3fceb9a46876657705a4c6b892dc76f80f60d46a 100644 (file)
@@ -1265,7 +1265,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);
 }
index 287f63fc736f97f84b17ac83491a5905c6ba5912..7d69b1134b40a2a8c3cae16837267282fe4ee7ac 100644 (file)
@@ -515,7 +515,7 @@ int __init iommu_setup(void)
     return rc;
 }
 
-int iommu_suspend()
+int iommu_suspend(void)
 {
     if ( iommu_enabled )
         return iommu_get_ops()->suspend();
@@ -523,7 +523,7 @@ int iommu_suspend()
     return 0;
 }
 
-void iommu_resume()
+void iommu_resume(void)
 {
     if ( iommu_enabled )
         iommu_get_ops()->resume();
index 55f0faa521cbbdd5da241911e6b03194ed21fea6..2665114f70c8985f6d60812d144046936fa282ef 100644 (file)
@@ -47,7 +47,7 @@ void unmap_vtd_domain_page(const void *va)
     unmap_domain_page(va);
 }
 
-void flush_all_cache()
+void flush_all_cache(void)
 {
     wbinvd();
 }