Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10186827imu; Sun, 30 Dec 2018 15:18:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN6H+ZgQPExNkie0fMqnI4zYMIX0g62Qn16WBdosKR5zxJfLGhPXWndNqo4RGEPcsHmaat/3 X-Received: by 2002:a17:902:d01:: with SMTP id 1mr35961115plu.127.1546211909521; Sun, 30 Dec 2018 15:18:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546211909; cv=none; d=google.com; s=arc-20160816; b=x49wh8WoqsONwP9jk+IW4jJBPx2wuLFVTPSYn9dbq2VZReE8li1LgZ8nRL44+jWqsg LSv9KKXSTv+eqwFMlauwAy2K6Sp3TbM3WwsHzSY0CNp3HpQOvf4+IinO9sqdOmTF8+62 Gd+Pj1TLTIrLoWYBXXwCuwUKi0zplNNDRzBKsxW7eP/Bz0i9/MM3JhBb3crjPdPKewcL N/T4RkV0IsLsBCb7DeEq56Nz6kJVTHwExNLWDY3o7U4meLCUfQbO3j6Vrj40lQoYAKVY tL//2CChPe50dFkgFHd2vu+5USXGAMbPnwv2zntDINXWHoHcnNwDSuaGG9hqL7kOb/TY 3INw== 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=1CNPMfd42dRhmcA0gjAvS5d4zFLBI8D+bS9rA/2oDuA=; b=sNObyj/GI72gC3TYtUAvvuXdVq66/l9gdSInh9rbAms48fkmlfW5V0yuAsgRcovQN0 tnPkj3EDQJw6vL5RIDAb96+4Dm2FrjEIQlqL4qq2Uk95nQQE0c1+KTc8WbJ63265pUG/ k7USvLUUQap1P0T9CaQkSSMRBpINyHEUmFbFxbIGBrQJ+SQCPMbC7oiC43ikcYRATtZF pLUAbf899BBPraauxQrzsCci25L4ke3UkgmsVe0DImF5R7dV3CbH/UNfhqTAK2JOuGUB 0UAjeVxFY6ED5ew5Yfn/WEEVayIxhrzRcAVBI6D8GNFqvB35lBMx/pXLWVDxXOqQg3Ho 1txg== 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 t11si41787076plo.293.2018.12.30.15.17.47; Sun, 30 Dec 2018 15:18:29 -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 S1726061AbeL3XNY (ORCPT + 99 others); Sun, 30 Dec 2018 18:13:24 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:34860 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725862AbeL3XNY (ORCPT ); Sun, 30 Dec 2018 18:13:24 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id ABAD52994E; Sun, 30 Dec 2018 18:13:19 -0500 (EST) Date: Mon, 31 Dec 2018 10:13:17 +1100 (AEDT) From: Finn Thain To: Arnd Bergmann cc: Greg Kroah-Hartman , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Linux Kernel Mailing List , linux-m68k , linuxppc-dev Subject: Re: [PATCH v8 18/25] powerpc: Implement nvram sync ioctl In-Reply-To: Message-ID: References: <3ba1dd965c1097e00463eafe7c7d5fd93bbed836.1545784679.git.fthain@telegraphics.com.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 Sun, 30 Dec 2018, Finn Thain wrote: > > > diff --git a/include/linux/nvram.h b/include/linux/nvram.h > > > index b7bfaec60a43..24a57675dba1 100644 > > > --- a/include/linux/nvram.h > > > +++ b/include/linux/nvram.h > > > @@ -18,8 +18,12 @@ struct nvram_ops { > > > unsigned char (*read_byte)(int); > > > void (*write_byte)(unsigned char, int); > > > ssize_t (*get_size)(void); > > > +#ifdef CONFIG_PPC > > > + long (*sync)(void); > > > +#else > > > long (*set_checksum)(void); > > > long (*initialize)(void); > > > +#endif > > > }; > > > > Maybe just leave all entries visible here, and avoid the above #ifdef > > checks. > > > > The #ifdef isn't there just to save a few bytes, though it does do that. > It's really meant to cause a build failure when I mess up somewhere. But > I'm happy to change it if you can see a reason to do so (?) > I think the problem with these #ifdef conditionals is that they don't express the correct constraints. So, at the end of this series I'd prefer to see, struct nvram_ops { ssize_t (*read)(char *, size_t, loff_t *); ssize_t (*write)(char *, size_t, loff_t *); unsigned char (*read_byte)(int); void (*write_byte)(unsigned char, int); ssize_t (*get_size)(void); #if defined(CONFIG_PPC) long (*sync)(void); int (*get_partition)(int); #elif defined(CONFIG_X86) || defined(CONFIG_M68K) long (*set_checksum)(void); long (*initialize)(void); #endif }; Is that okay with you? --