Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp82533imu; Tue, 8 Jan 2019 15:06:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN4eOe/GJ1F1LKs8uYH9pbLqyujWryi0uX6boCJD0shGkUC+/7umVOKGig8HnDEkIL5bb5MF X-Received: by 2002:aa7:85d7:: with SMTP id z23mr3746028pfn.205.1546988799951; Tue, 08 Jan 2019 15:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546988799; cv=none; d=google.com; s=arc-20160816; b=fUkLYKsrj//iyv9p6d66yaskmeY/TqIOtEZ3n/pCZrE8cx6eFyskIuBJJTGCQLGOk6 /n5ANRGdPvzJFmnhQeHaEQvbGZkpAagFtvU2uxjiYDwnVO0DHZxflkhd8+1zzQjwaY+f a6pLw2WudOyltYQbj0uZAf93An9yO1zlWBcxp6dSOeIev2h/O6sH4vVdxrR9KhCqrI+B xc/zcIvpTQmPVWIwG2x5n0NROT/guLdR9ydDAVNzt2ZtJ6pqWSpymH8lIER3VWtVzj9O R7DLrL2pRCwEcSbGrQiCAmA/DTFigr/sRfAnvdpNOoCJTcJn501hffKsKkuo34Uf1rAV rizw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=ba2ZySCPYWRDS+CElcC5AyvP8sQmmLMlLdx0jeYeLtY=; b=hWewJ28J7rsaMFGeite1ZSByxvLZhrJzk769pLyi8pbArrae6leiG6KLrUR98dSSUf 03I2w+nabNdWFu4yDw6EKtrDdhL/b76L0By8PfbBCgyVe2OXTEy+o8WyRb4cHK6u7/0S 4msekykT4yRJb6edcX3qVXze/WxvOM3GfPXAX2h6EhXPTLY7T+ukpifXtYk309akp2rx K8sAgSfwof0IKPzqlMzxEnC6/Vm04uyou4AWoNj/AFLoFRAMVGcJLNWwilSSvdmksEOj r2ntSfL/bCZliByoe76Txc9es+ua/dYUpHmCVQi+3C24Nt7H2fWYkgR/6vUm3mRs1AGt J7zg== 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 b6si65966585pgg.2.2019.01.08.15.06.23; Tue, 08 Jan 2019 15:06:39 -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 S1729978AbfAHWvO (ORCPT + 99 others); Tue, 8 Jan 2019 17:51:14 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:56610 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729418AbfAHWvN (ORCPT ); Tue, 8 Jan 2019 17:51:13 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id BA86822C33; Tue, 8 Jan 2019 17:51:09 -0500 (EST) Date: Wed, 9 Jan 2019 09:51:48 +1100 (AEDT) From: Finn Thain To: Michael Ellerman cc: Arnd Bergmann , Greg Kroah-Hartman , Benjamin Herrenschmidt , Paul Mackerras , Linux Kernel Mailing List , linux-m68k , linuxppc-dev Subject: Re: [PATCH v8 24/25] powerpc: Adopt nvram module for PPC64 In-Reply-To: <87h8ejts74.fsf@concordia.ellerman.id.au> Message-ID: References: <2fe2b8e6395aeacfafcbde590a50922d4e632189.1545784679.git.fthain@telegraphics.com.au> <8736q5xst1.fsf@concordia.ellerman.id.au> <87h8ejts74.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Jan 2019, Michael Ellerman wrote: > > The reason why that doesn't work boils down to introspection. (This > > was mentioned elsewhere in this email thread.) For example, we > > presently have code like this, > > > > ssize_t nvram_get_size(void) > > { > > if (ppc_md.nvram_size) > > return ppc_md.nvram_size(); > > return -1; > > } > > EXPORT_SYMBOL(nvram_get_size); > > > > This construction means we get to decide at run-time which of the NVRAM > > functions should be used. (Whereas your example makes a build-time decision.) > > Right, but we only need to make a runtime decision on powerpc (right?). It's needed in many places outside of powerpc. Otherwise the caller can't determine at run-time which ops are implemented. Hence you have to duplicate the caller for each supported configuration that you build. Already, this precludes a shared misc device implementation and belies the "generic" in drivers/char/generic_nvram.c. --