Received: by 10.223.185.116 with SMTP id b49csp3153219wrg; Mon, 5 Mar 2018 15:18:53 -0800 (PST) X-Google-Smtp-Source: AG47ELtAHQTfNQBEpJyskMPv0XlxWZoCfa0++81o2qjISwtduqlr+qCcgUYPqluP9fOU/4M6ki4Z X-Received: by 10.99.120.199 with SMTP id t190mr13166598pgc.72.1520291933847; Mon, 05 Mar 2018 15:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520291933; cv=none; d=google.com; s=arc-20160816; b=n/+FycnbRtWIXoesiRsr+J9L2zdQQpefpLfxA6quFDXN+VjpCSP3i1zceV+P20+7xG E93N8BTnCjfOTLspTo459z32C8tw8Bg3lC40woShYr3ixWmeySGB7HBjjSM/yPAn5FTn 6fv/nM1wbC9ckhAkWNNgEQn0CREojCqlJgFZPhgrQ9k0+mqXn/OHsBySvehekIx+hCCg sEcS+DHUC1tY8Q/2HeuCKvxkMcPyC61MwtQ57QCoQgXQJiG1ptfevECBrrZWkomElKBg 5o0HFVbKlssnHXGqU5a93Dp17evxzyOCqC4RtcZx5P9DO0QoK1Pb4NZfBJeYfeusUrz3 Um1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=ctnjVKddlVHeKbRe6w7nsgRgLYqIGUelVggkEJuBPCI=; b=0FRjFKBpB5TB2R/OUkLnuFSgMFZFdzZll3WEhr9JrU0WZfW0wCsjJKeWOaoutl5uJ2 ZdnxFyWTdLPVb4OcE24pZTFzNGBnrQcVeCSn8QBrydKitJ6asotr8PJDHe8M+W1q4gB6 fOdE2hbEJv8Ok/oRTUbTdA4wCZfiu+h4HJrdWiyz43oyjC9Bcc3agoVtC2Uc/WqVCf0s mxHEqdVZAJmGEhvtv11XciZGp2orDAYn5lz4YiMyaXJMbB2afDh1WZ6UiuUAiaYH+/Z8 nvA3s4VGr5BxW3tK/qQs6caAAX5x1eLCGKMs4jlQoZrw3hFnve88CAc5qMd5i8hQtHmk cKww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aRTpdepV; 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 j7si4998565pgf.622.2018.03.05.15.18.39; Mon, 05 Mar 2018 15:18:53 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=aRTpdepV; 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 S932767AbeCEXQ4 (ORCPT + 99 others); Mon, 5 Mar 2018 18:16:56 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:42672 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932106AbeCEXQy (ORCPT ); Mon, 5 Mar 2018 18:16:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ctnjVKddlVHeKbRe6w7nsgRgLYqIGUelVggkEJuBPCI=; b=aRTpdepVXZPTPw1NXPD+7AQ1+q jageTAKQUfw1AIfgXW7NMg+PydSfc/rM0ZtPY5v/YFo/JMvqk1qrR1TEugWapEB7bXCXaivnmT4GH CNxQB0g5X0gWolwBVR8Lkm+YooepH9wNXivFyOpngI7nz/AptE43OuhMAXSrgQDGbL7WdKdgFI7iJ tick9Hmt+QGbRqX0RuWOvi5QbVQ2nmWVEq2FQw32qvPspXD1MiteleXtseKHw5f/M0rrf7FKbbLHf p0wTEj7mYnbHGNcf/JBjlznPXUJV3dylD5ttIrjC0pTNvDeMQRy+2eL/2EAKuqpUmR3d3IGFHMwDt c2f+pNaw==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1eszLg-0006cJ-2M; Mon, 05 Mar 2018 23:16:52 +0000 Date: Mon, 5 Mar 2018 15:16:50 -0800 From: Darren Hart To: =?utf-8?B?TWljaGHFgiBLxJlwaWXFhA==?= Cc: Jonathan Woithe , Andy Shevchenko , Andy Shevchenko , Platform Driver , Linux Kernel Mailing List Subject: Re: [PATCH 1/7] platform/x86: fujitsu-laptop: Define constants for FUNC operations Message-ID: <20180305231650.GA25693@fury> References: <20180227211539.5708-1-kernel@kempniu.pl> <20180227211539.5708-2-kernel@kempniu.pl> <20180304050813.GA3129@marvin.atrad.com.au> <20180304194426.GA1428@kmp-mobile.hq.kempniu.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180304194426.GA1428@kmp-mobile.hq.kempniu.pl> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 04, 2018 at 08:44:26PM +0100, Michał Kępień wrote: > > On Wed, Feb 28, 2018 at 06:08:52PM +0200, Andy Shevchenko wrote: > > > On Tue, Feb 27, 2018 at 11:15 PM, Micha?? K??pie?? wrote: > > > > Various functions exposed by the firmware through the FUNC interface > > > > tend to use a consistent set of integers for denoting the type of > > > > operation to be performed for a specified feature. Use named constants > > > > instead of integers in each call_fext_func() invocation in order to more > > > > clearly convey the intent of each call. > > > > > > > > Note that FUNC_FLAGS is a bit peculiar: > > > > > > > +/* FUNC interface - operations */ > > > > +#define OP_GET BIT(1) > > > > +#define OP_GET_CAPS 0 > > > > +#define OP_GET_EVENTS BIT(0) > > > > +#define OP_GET_EXT BIT(2) > > > > +#define OP_SET BIT(0) > > > > +#define OP_SET_EXT (BIT(2) | BIT(0)) > > > > > > Hmm... this looks unordered a bit. > > > > It seems to be ordered alphabetically on the identifier. Andy, is it > > preferred to order defines like this based on resolved numeric order? > > Just to expand on what Jonathan wrote above: if you take a peek at the > end result of the patch series, you will notice a pattern: constants in > each section are ordered alphabetically by their name. I wanted all > sections to be consistently ordered. If you would rather have me order > things by the bit index, sure, no problem, just please note that the > order above is not accidental. Hrm. In my experience it is more typical to order by value (bit), that's a little less obvious when using the BIT()|BIT() macros though. So long as it's consistent, I think that's what matters most. -- Darren Hart VMware Open Source Technology Center