Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10662546imu; Mon, 31 Dec 2018 04:20:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN7HrBIRgKbW5R4ERxBKc3dIixmXfC1VOvvFIGDLOkwqmSjfSQk8StPLpXl3RHURsiI/vi0w X-Received: by 2002:a17:902:6f09:: with SMTP id w9mr37912400plk.309.1546258834550; Mon, 31 Dec 2018 04:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546258834; cv=none; d=google.com; s=arc-20160816; b=jPLeu41Ft+sH7b1lmRJ2Ytk9447vl61Dg4JN7nvEAr+MNBFoLg4QPdrIpFyqM77l53 ySTP8y0ToDKo/e3lr7TFMrUDj5+KcjltxztY/aSLfqQcK2FoLJZtlTlNPzTchBn3/dyS yfaCgwekNJE84r41SMMyDW0L7LZb6OJ44HsLShKnJ1j8igbDybVh5WuHRGKEIB4FwPDC Ts9y5exP5QOdRk0tXw4/LOYG1Mi3PUa6tgHbiDkZvt0uG7gjlhMafmpFQpdEZP2xHA1w 0o2WkMZItQjzWTkzVEWrZ3O5FfwqUgK/A0GgtUMPFLrhyB2/hvpzXP5Di/gM1m7JSxoT hzag== 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=/TrCEGBSRshBH4A9wwGkDALkxyybXabTiBiAMJ5ITDw=; b=iCDpbcdvtztrpPi60qwGxUU8p4GNvElyWZEM//BFcpiezKT86Az8VBK901GG/iqJff yjE85BiqynT99xmcKJYuV1uC3AqfSHQxkLebuoRzyWtiT3XT04jU0HZu0J2lemCbCbkz ezrexkDXccVdhJ3gQSf7owvSPgraxJJf4w6NL/4cZXMttI686OoPFHp3rxGO3xeUrUak 6I/350LRzLradrZuJO7kWMJ2XH4Krsx+ZE1y6NsSnbxOJ+54KvCmQ3mUzc+pE6Dzxo0f DOSzW5VLtTjpwmKqjYPj6M4NXQKS4JAlVc0XygE2SlgxwPfNPmZscuh56+46fAxmk2zr nvpg== 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 y2si91001pgl.148.2018.12.31.04.20.18; Mon, 31 Dec 2018 04:20:34 -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 S1727287AbeLaMRv (ORCPT + 99 others); Mon, 31 Dec 2018 07:17:51 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34097 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbeLaMRu (ORCPT ); Mon, 31 Dec 2018 07:17:50 -0500 Received: by mail-qt1-f196.google.com with SMTP id r14so29214120qtp.1 for ; Mon, 31 Dec 2018 04:17:49 -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=/TrCEGBSRshBH4A9wwGkDALkxyybXabTiBiAMJ5ITDw=; b=LaXE4Nc2++8byB+6yR1qprScQRv/hhWGf9KzIKBjeM/vZLnWeQwGej0KcFEE7nXoR/ M8GPkg93q/EPOZbLdrKljy3ixOixeHA4EZongf1aCo9xe3rWvkgYLL2pEYQkSOPQEPDY mq0pavBrz8zvtk3+db3uSDY5fgzyYgfY7buzt4olFpjcyvzAMCdD1wam23dMAOtsqpOZ 9sdpymJ4bhfED3CgGh0hDA/tbeIRtCl4ulXINfdT8vzZCLIYkSFStW4j+pAhphJagAtO dhKsLQtJvg1iJBJGbAOHCLK/zv8T0KrjVjbsLZKRCGxM+Jg8+wzOj/Vo5DwBQ5tkHx9Y ldcw== X-Gm-Message-State: AJcUukfVjN8q9h7BzsVMDNyEoCqLyufxKvCr/l+FzUEQ1uSRq7X6Xl4L N7AuKEycjZY+WNXcHhkRRdI1lOYKq0QpCe6lEFY= X-Received: by 2002:a0c:e202:: with SMTP id q2mr34786484qvl.180.1546258669025; Mon, 31 Dec 2018 04:17:49 -0800 (PST) MIME-Version: 1.0 References: <3ba1dd965c1097e00463eafe7c7d5fd93bbed836.1545784679.git.fthain@telegraphics.com.au> In-Reply-To: From: Arnd Bergmann Date: Mon, 31 Dec 2018 13:17:33 +0100 Message-ID: Subject: Re: [PATCH v8 18/25] powerpc: Implement nvram sync ioctl 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 Mon, Dec 31, 2018 at 12:13 AM Finn Thain wrote: > 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? My preference would be no #ifdef here, but the compile time error you mention is a good enough reason, so I'm fine with either version you pick. Arnd