[PATCH v2 1/5] sched/vtime: remove confusing arch_vtime_task_switch() declaration

Alexander Gordeev posted 5 patches 2 years ago
There is a newer version of this series
[PATCH v2 1/5] sched/vtime: remove confusing arch_vtime_task_switch() declaration
Posted by Alexander Gordeev 2 years ago
Callback arch_vtime_task_switch() is only defined when
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is selected. Yet, the
function prototype forward declaration is present for
CONFIG_VIRT_CPU_ACCOUNTING_GEN variant. Remove it.

Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
 include/linux/vtime.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index 3684487d01e1..593466ceebed 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -18,7 +18,6 @@ extern void vtime_account_idle(struct task_struct *tsk);
 #endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
 
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
-extern void arch_vtime_task_switch(struct task_struct *tsk);
 extern void vtime_user_enter(struct task_struct *tsk);
 extern void vtime_user_exit(struct task_struct *tsk);
 extern void vtime_guest_enter(struct task_struct *tsk);
-- 
2.40.1
Re: [PATCH v2 1/5] sched/vtime: remove confusing arch_vtime_task_switch() declaration
Posted by Nicholas Piggin 2 years ago
On Fri Feb 9, 2024 at 6:15 AM AEST, Alexander Gordeev wrote:
> Callback arch_vtime_task_switch() is only defined when
> CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is selected. Yet, the
> function prototype forward declaration is present for
> CONFIG_VIRT_CPU_ACCOUNTING_GEN variant. Remove it.
>

And powerpc arch_vtime_task_switch is static inline too,
so this just confuses things.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

> Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
> ---
>  include/linux/vtime.h | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/vtime.h b/include/linux/vtime.h
> index 3684487d01e1..593466ceebed 100644
> --- a/include/linux/vtime.h
> +++ b/include/linux/vtime.h
> @@ -18,7 +18,6 @@ extern void vtime_account_idle(struct task_struct *tsk);
>  #endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
>  
>  #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
> -extern void arch_vtime_task_switch(struct task_struct *tsk);
>  extern void vtime_user_enter(struct task_struct *tsk);
>  extern void vtime_user_exit(struct task_struct *tsk);
>  extern void vtime_guest_enter(struct task_struct *tsk);