Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9329973imu; Sat, 29 Dec 2018 16:41:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6uWVgHbxNFr32BUM9sw9Elqc4QU83wkmprTyb5VcDexp7++F2dvhAXRv1UD1rOKu+Bk/sw X-Received: by 2002:a17:902:a98c:: with SMTP id bh12mr32906224plb.31.1546130465775; Sat, 29 Dec 2018 16:41:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546130465; cv=none; d=google.com; s=arc-20160816; b=0E0oEgvUSTIi5Mn9R2e+v+2D83rv507+CdslST73PxhQr2+y088Lg5hjEoOJPEjhE5 0jqZgR3ba8GOQ3Whj/j11WfORTUTdzLdg/M275mKyWc/j9mPrPNfLR5OZOsalJqPJIhR gaSF3jG9sGiMTTRsn6p0BINS4Jp9qrqnS2YILADjJAmi0r97ihYthbVFB2f0MBTRJr7i 7bVybV4O1RgxmNpleVI9zCPctcNcJrapbH8ldhmI+zS26DTtJ1i070Zs6YcmGnr/USZt r/dEtOObNppsBxp2ws+T5Yu+gbsBPx1HPb6kCFs++cuY00EBEHxzHRi9MKtkIKnivA54 YJ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=sWodW4m2le/vPs28+pio7unZZk61wUo/y9VehQhAy9Q=; b=L3UN6lsqMRV3p6H31LZn75jdbLLIWJSN6ZhHPwrlVk4JY6JwEegP5IXM/WK354vlEH vAob13JdZrUibx2FGT1LC2LxQPDByQPJ/j7FLA4EdvdFz4CRVTpRcQQM+dLkR9Uarm5B ncqGL8/ln4WLP/Sokspi7ez1AzPsBO000Q0uqWVGYJqWyWhgELWLy3K8YMyE4SDVlWqe Xoi/A47AkN/u6DNh7jD7au8XvDKT1Ok9o3DWNaGCRRyj0QVFxYrS1UpD9y32bm1DyBpC fGu6Z2TbzwIELnynSo6oxvClItYl9DbhzOvd0E3UvtJP+TMvFyivL7rUpNs8WC63zpeZ j2lw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si40057150pgk.341.2018.12.29.16.40.50; Sat, 29 Dec 2018 16:41:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727815AbeL2WhH (ORCPT + 99 others); Sat, 29 Dec 2018 17:37:07 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42107 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbeL2WhH (ORCPT ); Sat, 29 Dec 2018 17:37:07 -0500 Received: by mail-qk1-f195.google.com with SMTP id 68so14243096qke.9 for ; Sat, 29 Dec 2018 14:37:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sWodW4m2le/vPs28+pio7unZZk61wUo/y9VehQhAy9Q=; b=qc469VgCW3oqjvLQJGShcc00Z6+icKI+/Rdx6/oqom/ciCV0orYqUq+K265uJyORp2 8Yd7pWsEO/mrOofxoRtAvwqhPRvJXHsF70BJhtP+N33s45238RncUSYF43EL6E3zjaV7 Tm2v2RSyPfj3aCvDM2ZAFJ3xjL1K5vj+qExbpsFOmPXEhR7lDxnFg3zWkIj6Nh4rgwlZ hvVnkWPedvGXy45QFTzeFn3UHUtJN7/h/JqpSJ3barNas4E3YQ3S8W/b/J+042/mvqN3 1wMQGkfoOz1Xl02s7pN/KyZhmonem6nKhTFO3/1gPyFvmQN4u5RzKgUE8zzZR0FNcUX7 locw== X-Gm-Message-State: AJcUukcHfQsBkvHhMkgGZI6JCCN1Le3g8flmRVz19bJsMavTXCgSLg3c /FKhP1qfPr+fi8ZJ1VqImQ3U4ZVtnN/mg9sAuk0= X-Received: by 2002:a37:324a:: with SMTP id y71mr30094684qky.291.1546123026112; Sat, 29 Dec 2018 14:37:06 -0800 (PST) MIME-Version: 1.0 References: <2fe2b8e6395aeacfafcbde590a50922d4e632189.1545784679.git.fthain@telegraphics.com.au> In-Reply-To: <2fe2b8e6395aeacfafcbde590a50922d4e632189.1545784679.git.fthain@telegraphics.com.au> From: Arnd Bergmann Date: Sat, 29 Dec 2018 23:36:49 +0100 Message-ID: Subject: Re: [PATCH v8 24/25] powerpc: Adopt nvram module for PPC64 To: Finn Thain Cc: Greg Kroah-Hartman , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Linux Kernel Mailing List , linux-m68k , linuxppc-dev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote: > +static ssize_t ppc_nvram_get_size(void) > +{ > + if (ppc_md.nvram_size) > + return ppc_md.nvram_size(); > + return -ENODEV; > +} > +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