Re: [1/2] powerpc/powernv: new function to access OPAL msglog
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-02-09 10:20:21
On Tue, 2016-02-09 at 16:29 +1100, Andrew Donnellan wrote:
On 08/02/16 22:31, Michael Ellerman wrote:quoted
Pulling the memcons out of the bin_attr here is not all that nice. This routine should really stand on its own without reference to the bin_attr. In theory I might want to disable building sysfs but still have this routine available.Yeah it's a bit ugly, though does disabling sysfs actually break it?
Probably not, it looks like bin_attribute is still defined even when sysfs is disabled. And the build would break in other places too.
I can separate it out anyway - there's no reason for the memcons to be tied to the sysfs entry.
Yeah that was more my point.
quoted
It's also a bit fishy if it's called before the bin_attr is initialised or when the memcons initialisation fails. In both cases it should be OK, because the structs in question are static and so the private pointer will be NULL, but that's a bit fragile. I think the solution is simply to create a: static struct memcons *opal_memcons; And use that in opal_msglog_copy() and so on.Will respin.
Thanks. cheers