Thread (79 messages) 79 messages, 7 authors, 2019-01-08

Re: [PATCH v8 24/25] powerpc: Adopt nvram module for PPC64

flat view

From: Arnd Bergmann <arnd@arndb.de>
Date: 2018-12-29 22:37:08
Also in: lkml

On Wed, Dec 26, 2018 at 1:43 AM Finn Thain [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+static ssize_t ppc_nvram_get_size(void)
+{
+       if (ppc_md.nvram_size)
+               return ppc_md.nvram_size();
+       return -ENODEV;
+}
quoted hunk ↗ jump to hunk
+const struct nvram_ops arch_nvram_ops = {
+       .read           = ppc_nvram_read,
+       .write          = ppc_nvram_write,
+       .get_size       = ppc_nvram_get_size,
+       .sync           = ppc_nvram_sync,
+};
Coming back to this after my comment on the m68k side, I notice that
there is now a double indirection through function pointers. Have you
considered completely removing the operations from ppc_md instead
by having multiple copies of nvram_ops?

With the current method, it does seem odd to have a single
per-architecture instance of the exported structure containing
function pointers. This doesn't give us the flexibility of having
multiple copies in the kernel the way that ppc_md does, but it adds
overhead compared to simply exporting the functions directly.

       Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help