Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1722296pxj; Wed, 19 May 2021 12:19:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg5VTO8qOCMj80uCrY4U2pOcrSOsszbwRwSBoDRLPeqt+/T6ETbr8kuHvqgiqxB3ucduY4 X-Received: by 2002:a17:906:26d4:: with SMTP id u20mr762101ejc.114.1621451995985; Wed, 19 May 2021 12:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621451995; cv=none; d=google.com; s=arc-20160816; b=vE1a2cV/gRfWFh8wRp/UtayCm32JVhWSP6+rX/Or1Vueg9xBg8ngLbS5NKADIP+9Gz hxFLQF7lnLNJO/B63qWqJucGMbB9ailXaE4UoidbfYIBtM1XvwpkOX3iyfTmXJNLmhXn wUMEdFt1ZMSHN7PW+2kTQd0T8UWNkO0e8pEm2N/VnxH7NeDZFN6O7TXkk9KDxK1EXRsu hvdAuQd98yQusCICvdmRFKSEClcDmn7xKm7zFdDOP3zEFzUFq+4gpObdI0zfCg9ELS9N BR+7tj10wuVCsEWaEeMdUbpigR5ixxptCpb4F4Cf3cOaD4GwzezthNbfNfYlkTHNoGdr +AFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature:dkim-signature; bh=ZQqIDNjegD+sDLfm5aGwnybvoXnL4d+m25V093T+MCk=; b=qbQlHgmyjTvZytzxIWuJTgxOOhtKH+wT/kLCH8v+2JpzgUQazVDXjFlCBeU7EgpHJI 3653wsryNVrYHCh7k5CGQNNj8KBiRLKtBCs+c2WiOGS9MkoUHUN5Cs8RfRuaMwAAA21y CsnJGLkfD5JGG/QoLqx/8D1y9UVgkCZ7CxUJkkm92mMHCTxjluuMblmeflJLMmnQ147Y 4gn1wZLhlfWY0dc62IOr+gUukUBI6uJq3Jpx1E1WzGUU8nXsjbW/XiSMgpfHk+X+9fAR MFnFNIOGUYo1//dbyrRZDY0ytCQ7gNBWW4z2HevNtMWIJecizzddw/a/Vl0EIK94cNdT WUEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b="IAlTlTk/"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=rqUBadeI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e26si460689ejx.310.2021.05.19.12.19.31; Wed, 19 May 2021 12:19:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b="IAlTlTk/"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=rqUBadeI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235007AbhESG3l (ORCPT + 99 others); Wed, 19 May 2021 02:29:41 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:48121 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbhESG3f (ORCPT ); Wed, 19 May 2021 02:29:35 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 7F74B580D37; Wed, 19 May 2021 02:28:15 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Wed, 19 May 2021 02:28:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm2; bh=ZQqIDNjegD+sDLfm5aGwnybvoXnL4d+ m25V093T+MCk=; b=IAlTlTk/SoQiNwmA80MnW0XoVydNXktP3zTa9kv77qM7SDU Irn6xqQH0a0hMTDvR+efIIZSRPp0v6gteRp5OcuJvpRHhEPfTb7fChbCpdXiT8Xd xn1L5DDqLw2+ZcZdk6PT3IFJ27l/AYcgAixUPTD0XUNUaJFcTR7yTWvuDDLCHX/I uSFpQ3bfiBT+aLHixvDsKFByJJTVtPd4IxDe9sQuOMUjGmjoLRXYS2UwKK88+rSK TWhazV/vKiLIA/T78Ne6AY+cga1DPB4MyyMsEnjZHxe4ZseKFJ3bzq0KvvauKDr6 c7zfFHJFYOzvS3ezutmLvRs+hNf/yz2D3rt/SMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ZQqIDN jegD+sDLfm5aGwnybvoXnL4d+m25V093T+MCk=; b=rqUBadeIeBeUvBDi9c+IuK +JmxFjGQXQZChGk6T9WrzEQ7GGw2KY+nU3zwm66tcMfoKkhQyp+rX073hegad+j6 VXjiyctLWbjIhCtUEErcNxbvwZSmZ6JcCtHIyrm/XnbImmACIoycZ5dsKVFD58E4 XlsCPnNmRiKcRsJUZcRApHm+APZS8JJ5tj1Z32fGsOigUjV9UtN//sfjkvb6zqFH GR1jMlx92bTAiWtE6qPUi2D7i/5mTwtkmIoDA34AyqtmV7vI3at6+ltUxxP1jHIy ShPde321oeSZflusKhcsDCD0HftYbwaEkRsVhMGWszIyeOkarguTkhcSad8cchTQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeikedguddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedftehn ughrvgifucflvghffhgvrhihfdcuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucggtf frrghtthgvrhhnpeduffdtvdevkeffgfetffffueevgeejleeghfffjedthedthfelgfek fefhfeekieenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgr uh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1C47AA0007A; Wed, 19 May 2021 02:28:14 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-448-gae190416c7-fm-20210505.004-gae190416 Mime-Version: 1.0 Message-Id: <2bb7dfc4-a20e-4e3e-8fa5-74ff264c4e44@www.fastmail.com> In-Reply-To: <56ec152a-560b-1eed-97e2-c12e4fed171a@kernel.org> References: <20210519000704.3661773-1-andrew@aj.id.au> <20210519000704.3661773-3-andrew@aj.id.au> <56ec152a-560b-1eed-97e2-c12e4fed171a@kernel.org> Date: Wed, 19 May 2021 15:57:47 +0930 From: "Andrew Jeffery" To: "Jiri Slaby" , linux-serial@vger.kernel.org Cc: "Greg Kroah-Hartman" , "Joel Stanley" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, jenmin_yuan@aspeedtech.com, "Ryan Chen" , "Milton Miller II" Subject: Re: [PATCH v2 2/2] serial: 8250: Use BIT(x) for UART_{CAP,BUG}_* Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 May 2021, at 15:44, Jiri Slaby wrote: > On 19. 05. 21, 2:07, Andrew Jeffery wrote: > > BIT(x) improves readability and safety with respect to shifts. > > > > Signed-off-by: Andrew Jeffery > > --- > > drivers/tty/serial/8250/8250.h | 33 +++++++++++++++++---------------- > > 1 file changed, 17 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h > > index 34aa2714f3c9..4fbf1088fad8 100644 > > --- a/drivers/tty/serial/8250/8250.h > > +++ b/drivers/tty/serial/8250/8250.h > > @@ -7,6 +7,7 @@ > > * Copyright (C) 2001 Russell King. > > */ > > > > +#include > > #include > > #include > > #include > > @@ -70,25 +71,25 @@ struct serial8250_config { > > unsigned int flags; > > }; > > > > -#define UART_CAP_FIFO (1 << 8) /* UART has FIFO */ > > -#define UART_CAP_EFR (1 << 9) /* UART has EFR */ > > -#define UART_CAP_SLEEP (1 << 10) /* UART has IER sleep */ > > -#define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */ > > -#define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */ > > -#define UART_CAP_RTOIE (1 << 13) /* UART needs IER bit 4 set (Xscale, Tegra) */ > > -#define UART_CAP_HFIFO (1 << 14) /* UART has a "hidden" FIFO */ > > -#define UART_CAP_RPM (1 << 15) /* Runtime PM is active while idle */ > > -#define UART_CAP_IRDA (1 << 16) /* UART supports IrDA line discipline */ > > -#define UART_CAP_MINI (1 << 17) /* Mini UART on BCM283X family lacks: > > +#define UART_CAP_FIFO BIT(8) /* UART has FIFO */ > > +#define UART_CAP_EFR BIT(9) /* UART has EFR */ > > +#define UART_CAP_SLEEP BIT(10) /* UART has IER sleep */ > > > Perfect, except the include: BIT is not defined in bitops.h, but in > bits.h (which includes vdso/bits.h). In fact, bitops.h includes bits.h > too, but it's superfluous to include all those bitops. Maybe the recommendation in the checkpatch documentation should be fixed then? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/checkpatch.rst?h=v5.13-rc2#n473 I didn't dig through the include maze to optimise my choice. That said, I will switch to bits.h based on your feedback above. Thanks, Andrew