Re: [PATCH] ocxl: Simplify free_spa()

2018-12-11 Thread Greg Kurz
On Tue, 11 Dec 2018 20:13:21 +1100 Andrew Donnellan wrote: > On 11/12/18 7:57 pm, Greg Kurz wrote: > > I now realize that I should have mentioned the real motivation for this > > change. I'm working on refactoring the code so that we can use ocxl in a > > KVM guest. The concept of link can be

Re: [PATCH] ocxl: Simplify free_spa()

2018-12-11 Thread Andrew Donnellan
On 11/12/18 7:57 pm, Greg Kurz wrote: I now realize that I should have mentioned the real motivation for this change. I'm working on refactoring the code so that we can use ocxl in a KVM guest. The concept of link can be shared by both powernv and pseries variants but the SPA is definitely a

Re: [PATCH] ocxl: Simplify free_spa()

2018-12-11 Thread Greg Kurz
On Tue, 11 Dec 2018 12:05:49 +1100 Andrew Donnellan wrote: > On 11/12/18 2:15 am, Greg Kurz wrote: > > The only users of free_spa() are alloc_link() and free_link(), and > > in both cases: > > > > - link->spa != NULL > > > > - free_spa(link) is immediatly followed by kfree(link) > > > > The

Re: [PATCH] ocxl: Simplify free_spa()

2018-12-10 Thread Andrew Donnellan
On 11/12/18 2:15 am, Greg Kurz wrote: The only users of free_spa() are alloc_link() and free_link(), and in both cases: - link->spa != NULL - free_spa(link) is immediatly followed by kfree(link) The check isn't needed, and it doesn't bring much to clear the link->spa pointer. Drop both.

[PATCH] ocxl: Simplify free_spa()

2018-12-10 Thread Greg Kurz
The only users of free_spa() are alloc_link() and free_link(), and in both cases: - link->spa != NULL - free_spa(link) is immediatly followed by kfree(link) The check isn't needed, and it doesn't bring much to clear the link->spa pointer. Drop both. Signed-off-by: Greg Kurz ---

Re: [PATCH] ocxl: Simplify free_spa()

2018-12-10 Thread Frederic Barrat
Le 10/12/2018 à 16:15, Greg Kurz a écrit : The only users of free_spa() are alloc_link() and free_link(), and in both cases: - link->spa != NULL - free_spa(link) is immediatly followed by kfree(link) The check isn't needed, and it doesn't bring much to clear the link->spa pointer. Drop