# Re: \[RFC PATCH 5/8\] sched: move CPU field back into thread\_info if THREAD\_INFO\_IN\_TASK=y

- From: Ard Biesheuvel \<ardb@kernel.org\>
- Date: 2021-09-14 16:10:50 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/09/1508200
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/09/1507796/t.md

```text
On Tue, 14 Sept 2021 at 17:59, Linus Torvalds
[ref] wrote:
>
> On Tue, Sep 14, 2021 at 8:53 AM Ard Biesheuvel [ref] wrote:
> >
> > task_cpu() takes a 'const struct task_struct *', whereas
> > task_thread_info() takes a 'struct task_struct *'.
>
> Oh, annoying, but that's easily fixed. Just make that
>
>    static inline struct thread_info *task_thread_info(struct
> task_struct *task) ..
>
> be a simple
>
>   #define task_thread_info(tsk) (&(tsk)->thread_info)
>
> instead. That actually then matches the !THREAD_INFO_IN_TASK case anyway.
>
> Make the commit comment be about how that fixes the type problem.
>
> Because while in many cases inline functions are superior to macros,
> it clearly isn't the case in this case.
>

Works for me.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
