From: Keir Fraser Date: Tue, 1 Jun 2010 10:04:08 +0000 (+0100) Subject: smp_call_function/on_selected_cpus/on_each_cpu all return void. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12042 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=63725a8c546ac77dc6a1c60f91dd70675a5fec0f;p=xen.git smp_call_function/on_selected_cpus/on_each_cpu all return void. None of them can fail, so a return code is pointless. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/ia64/linux-xen/perfmon.c b/xen/arch/ia64/linux-xen/perfmon.c index 10869bfb76..18f8be9d7f 100644 --- a/xen/arch/ia64/linux-xen/perfmon.c +++ b/xen/arch/ia64/linux-xen/perfmon.c @@ -6895,11 +6895,7 @@ pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl) } /* save the current system wide pmu states */ - ret = on_each_cpu(pfm_alt_save_pmu_state, NULL, 1); - if (ret) { - DPRINT(("on_each_cpu() failed: %d\n", ret)); - goto cleanup_reserve; - } + on_each_cpu(pfm_alt_save_pmu_state, NULL, 1); /* officially change to the alternate interrupt handler */ pfm_alt_intr_handler = hdl; @@ -6926,7 +6922,6 @@ int pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl) { int i; - int ret; if (hdl == NULL) return -EINVAL; @@ -6940,10 +6935,7 @@ pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl) pfm_alt_intr_handler = NULL; - ret = on_each_cpu(pfm_alt_restore_pmu_state, NULL, 1); - if (ret) { - DPRINT(("on_each_cpu() failed: %d\n", ret)); - } + on_each_cpu(pfm_alt_restore_pmu_state, NULL, 1); for_each_online_cpu(i) { pfm_unreserve_session(NULL, 1, i); diff --git a/xen/arch/ia64/linux-xen/smp.c b/xen/arch/ia64/linux-xen/smp.c index 523f739064..40bb8817dd 100644 --- a/xen/arch/ia64/linux-xen/smp.c +++ b/xen/arch/ia64/linux-xen/smp.c @@ -386,14 +386,14 @@ EXPORT_SYMBOL(smp_call_function_single); * You must not call this function with disabled interrupts or from a * hardware interrupt handler or from a bottom half handler. */ -int +void smp_call_function (void (*func) (void *info), void *info, int wait) { struct call_data_struct data; int cpus = num_online_cpus()-1; if (!cpus) - return 0; + return; /* Can deadlock when called with interrupts disabled */ #ifdef XEN @@ -435,12 +435,11 @@ smp_call_function (void (*func) (void *info), void *info, int wait) #if 0 //def XEN printk("smp_call_function: DONE WITH spin_unlock, returning \n"); #endif - return 0; } EXPORT_SYMBOL(smp_call_function); #ifdef XEN -int +void on_selected_cpus(const cpumask_t *selected, void (*func) (void *info), void *info, int wait) { @@ -450,7 +449,7 @@ on_selected_cpus(const cpumask_t *selected, void (*func) (void *info), ASSERT(local_irq_is_enabled()); if (!nr_cpus) - return 0; + return; data.func = func; data.info = info; @@ -470,8 +469,6 @@ on_selected_cpus(const cpumask_t *selected, void (*func) (void *info), cpu_relax(); spin_unlock(&call_lock); - - return 0; } #endif diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index b94afdc2dd..b5222795eb 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -1356,11 +1356,7 @@ long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc) log_cpus = xmalloc_array(xen_mc_logical_cpu_t, nlcpu); if (log_cpus == NULL) return x86_mcerr("do_mca cpuinfo", -ENOMEM); - - if (on_each_cpu(do_mc_get_cpu_info, log_cpus, 1)) { - xfree(log_cpus); - return x86_mcerr("do_mca cpuinfo", -EIO); - } + on_each_cpu(do_mc_get_cpu_info, log_cpus, 1); if (!is_pv_32on64_vcpu(v) ? copy_to_guest(mc_physcpuinfo.nat->info, log_cpus, nlcpu) diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c index 0483ac5f10..650835ff1f 100644 --- a/xen/arch/x86/smp.c +++ b/xen/arch/x86/smp.c @@ -274,17 +274,17 @@ static struct call_data_struct { cpumask_t selected; } call_data; -int smp_call_function( +void smp_call_function( void (*func) (void *info), void *info, int wait) { cpumask_t allbutself = cpu_online_map; cpu_clear(smp_processor_id(), allbutself); - return on_selected_cpus(&allbutself, func, info, wait); + on_selected_cpus(&allbutself, func, info, wait); } -int on_selected_cpus( +void on_selected_cpus( const cpumask_t *selected, void (*func) (void *info), void *info, @@ -323,7 +323,6 @@ int on_selected_cpus( out: spin_unlock(&call_lock); - return 0; } static void __stop_this_cpu(void) diff --git a/xen/arch/x86/x86_32/traps.c b/xen/arch/x86/x86_32/traps.c index eb6154c34f..a233c8307e 100644 --- a/xen/arch/x86/x86_32/traps.c +++ b/xen/arch/x86/x86_32/traps.c @@ -437,8 +437,8 @@ static long register_guest_callback(struct callback_register *reg) case CALLBACKTYPE_sysenter_deprecated: if ( !cpu_has_sep ) ret = -EINVAL; - else if ( on_each_cpu(do_update_sysenter, ®->address, 1) != 0 ) - ret = -EIO; + else + on_each_cpu(do_update_sysenter, ®->address, 1); break; case CALLBACKTYPE_sysenter: diff --git a/xen/include/xen/smp.h b/xen/include/xen/smp.h index 6d7dca4211..47792b53a4 100644 --- a/xen/include/xen/smp.h +++ b/xen/include/xen/smp.h @@ -28,7 +28,7 @@ extern void smp_cpus_done(unsigned int max_cpus); /* * Call a function on all other processors */ -extern int smp_call_function( +extern void smp_call_function( void (*func) (void *info), void *info, int wait); @@ -36,7 +36,7 @@ extern int smp_call_function( /* * Call a function on a selection of processors */ -extern int on_selected_cpus( +extern void on_selected_cpus( const cpumask_t *selected, void (*func) (void *info), void *info, @@ -51,12 +51,12 @@ void smp_prepare_boot_cpu(void); /* * Call a function on all processors */ -static inline int on_each_cpu( +static inline void on_each_cpu( void (*func) (void *info), void *info, int wait) { - return on_selected_cpus(&cpu_online_map, func, info, wait); + on_selected_cpus(&cpu_online_map, func, info, wait); } #define smp_processor_id() raw_smp_processor_id()