From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9523BC433ED for ; Wed, 19 May 2021 06:30:32 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1904361059 for ; Wed, 19 May 2021 06:30:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1904361059 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:Cc:To:From:Date:References:In-Reply-To: Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jSdbijBsatG6Tq7Y/Rvlti9/M89c55gN9xBDXfyZa1o=; b=ctMTkPX3UwTVN4JuDkcIC+u8d XvYkQD9/6OhZi0HHBKnnpLw8tZKB/rSogrsjIGa3j8dqu5VURUC51qwzom2RNalx2EvyeylZrE3nj /GH+DLajnFNESPJuC0lrW3irBVADy25Nz8BFCJzEncxg/VxbnDR2pGZOXk9oLLC/uYMkLnOQt2j3r K9hTb93NVKSGoHauJ/InzPlgT7Cb3tCdoVB61NkcYG2VhCMtPqdX50QIGL79wGoOtAO9C9ita/02a rBdqafy0YJG1yd/1AxB1Le0BK1RZuS57GdGUC6q8FaTk8n0LWGQSFKtxDVUqUsZ+Agoo3967OWW0J Au8j+yKzA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljFgu-002z1J-Dg; Wed, 19 May 2021 06:28:24 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljFgp-002z0x-Ma for linux-arm-kernel@desiato.infradead.org; Wed, 19 May 2021 06:28:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZQqIDNjegD+sDLfm5aGwnybvoXnL4d+m25V093T+MCk=; b=gvdk9KwMgBzdFu9MovajqUNry4 LUUempg68zbs0HwLju8tJhEIIEl1wbtOH4qGmJAwp8es1EP1ycmstJq2fAuiAI/AEQ4FW5Xw/F4Rr 2az9SrZYnP3JBj+zmwJuwhiw/o8/S5XLjAwDYc0o/BIHXCXx2sNc7NmBHZKaEaOb8mEya3hPRr3Sf dPXmaGmfu5iwdgsUFBrPWysdR+cjweNpfrjcvNn9QZc2PT1GokjQNFYRVVFQfnEIYMRPtfT/x1bgd oLBO2QC7SuzPtAgAt+ZK/H4+LetehhI02csPBQFCXOI9P14pd2WHXMgpwHEEb1LXNxNWdo0A+fzSZ 044CEKVw==; Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljFgm-00FBAu-O1 for linux-arm-kernel@lists.infradead.org; Wed, 19 May 2021 06:28:18 +0000 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}_* X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_232816_878149_15AD1F21 X-CRM114-Status: GOOD ( 15.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel