Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1969259pxj; Wed, 19 May 2021 19:16:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTEyUv0MOoV141cDk2CExrs+gmWizKmefKVx0Sndh0YyYwAp3k5OZomC+pXEUh2PzQydyK X-Received: by 2002:a05:6638:3395:: with SMTP id h21mr2994016jav.44.1621476975230; Wed, 19 May 2021 19:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621476975; cv=none; d=google.com; s=arc-20160816; b=YhtUTY9I4Q+PLtDZyMutTpcSuWzSsLaN02f0Wg0FITUoXMSmTa0fStQWVSS/Lqkkhm M6kQMErJdCaG/4xOAFB8DHSXE6/LH3aYxjJAKrOjT3e4mecerfWZ3oEoNSQKsV9IqQ2+ 8U5uJbTBpTnZxzaSYNRoayULNY+umn+BwvU+McTEF1QFg2g1Mzh2/xxxwJ1sKrW5inh2 EC1ZcKZLv0Nh1wTnIu8t30O+NObKA9E1gJtTha3HZoFFOHAzdyxjRyXPjPm3v/or8bab xw0NO3jzyOifxY6WhSisd+Vp+2Vkg+nno1o6FuJZozjKlidUiuTzIYL4xfUsWiitZEIo 99bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=xaOffRI6alJL3rQhNQY1BObEReB1pRx0cFG8v7tgrSo=; b=f7LijvR8+YQPQt9xTnKi4eo5BRoT4v/wS+GNW3tfZcdx6/ih1x94XBGMhUPdk9PQqC XqAAoumJWgerSnlOP11AKP401G3EKtAJc8tsS8DagQQTO++wY3A7n3yk36zEwf9Z7/bc D+3+8KcMe4T3LM9qMcp1YKbIy/1ltgU/j8sbBKt/ncAroMOPFb2KcV8lD4eYUwrLUpf8 qvwbjScFa2+2g/BuSDNOeUcpibp1IOKaWlu6n3us1wpx2wlCn9x3ICzPL1btNU+Kxr3k skcDVpJxZAWBmIdjbY82qmLDGj2oJL/FZigRGKRs8RT9tqTdEFR0GghmducbP17wYCnw hhLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=seEJKdzP; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=n5RY+O6i; 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 w17si1006433iot.47.2021.05.19.19.16.02; Wed, 19 May 2021 19:16:15 -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=seEJKdzP; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=n5RY+O6i; 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 S230325AbhETCQN (ORCPT + 99 others); Wed, 19 May 2021 22:16:13 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:42221 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230306AbhETCPu (ORCPT ); Wed, 19 May 2021 22:15:50 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 1E6525808F3; Wed, 19 May 2021 22:13:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 19 May 2021 22:13:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=xaOffRI6alJL3 rQhNQY1BObEReB1pRx0cFG8v7tgrSo=; b=seEJKdzPx3BjwzX0SXx8TYL4jg0Ph +rHEdowVgjI85qIGwzLo1UQUfH2bRp31kd0jiMVh0wgPMk3qPEub2MoZ/mlFH5uY d9VyCQg86Rt5SbVnco0RTOkvnhNiXvZth8h+eH01RrxAfjbyoEkGiD8N77DVcwxk iJH4owW8y45z7dusmgfmpNscFN66D1dVdb1Cice+Gfl/hp6ZPv2PMxgXV/x9dnFn Gl2oAzezRGrdQ6Z7kDOGFCYLtE174z9kB1X4PTUm/keE9RvRHuYRg73GZQ9P9Zvq tP6nGUz89tF2aT6leSWWL6bekLUP01xn0voU1z/Yl+j0GD0orYIScKR9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=xaOffRI6alJL3rQhNQY1BObEReB1pRx0cFG8v7tgrSo=; b=n5RY+O6i NzDq/Z/wVHnQ5/iEGNsp/hqlsWSbU6cgrhix21FmNdx5BbiNLNON8D/pFrxyBGMd e7gwciI2LdnTxdE5mioiQRuswovhCUznBg5S8Op7Z3YHiNhWAYcUEQ+xTP2y2k94 FzwTskJhFFPDGUGtNF1uvap2Y+bIbK7eEoYfaY4kXux1x6yE/UK3XkJEAXF/P6WD M+/e4NtBrKJVCxDIYn+JbJNbyqvaDXdFHk3UnMbH7q8FZc6Hgcb2Mse+BUsWXWAp Ww4yF0V2jPu8+0leYwZ5U4Ur/1X6igIA78PU3HuE+C4Q+/4OvvY+Hwb/T1DApvGE 5zZvIR7i0RCy0Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejtddgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecuggftrfgrthhtvghrnhepjefgvdevheetkeevgeegleelgfelte etjeffleffvdduudevieffgeetleevhfetnecukfhppedvtdefrdehjedrvdduhedrkeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurh gvfiesrghjrdhiugdrrghu X-ME-Proxy: Received: from mistburn.lan (203-57-215-8.dyn.iinet.net.au [203.57.215.8]) by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 May 2021 22:13:54 -0400 (EDT) From: Andrew Jeffery To: linux-serial@vger.kernel.org Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, joel@jms.id.au, 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@aspeedtech.com, miltonm@us.ibm.com Subject: [PATCH v3 2/2] serial: 8250: Use BIT(x) for UART_{CAP,BUG}_* Date: Thu, 20 May 2021 11:43:34 +0930 Message-Id: <20210520021334.497341-3-andrew@aj.id.au> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210520021334.497341-1-andrew@aj.id.au> References: <20210520021334.497341-1-andrew@aj.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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..6473361525d1 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 */ +#define UART_CAP_AFE BIT(11) /* MCR-based hw flow control */ +#define UART_CAP_UUE BIT(12) /* UART needs IER bit 6 set (Xscale) */ +#define UART_CAP_RTOIE BIT(13) /* UART needs IER bit 4 set (Xscale, Tegra) */ +#define UART_CAP_HFIFO BIT(14) /* UART has a "hidden" FIFO */ +#define UART_CAP_RPM BIT(15) /* Runtime PM is active while idle */ +#define UART_CAP_IRDA BIT(16) /* UART supports IrDA line discipline */ +#define UART_CAP_MINI BIT(17) /* Mini UART on BCM283X family lacks: * STOP PARITY EPAR SPAR WLEN5 WLEN6 */ -#define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ -#define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ -#define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */ -#define UART_BUG_THRE (1 << 3) /* UART has buggy THRE reassertion */ -#define UART_BUG_PARITY (1 << 4) /* UART mishandles parity if FIFO enabled */ -#define UART_BUG_TXRACE (1 << 5) /* UART Tx fails to set remote DR */ +#define UART_BUG_QUOT BIT(0) /* UART has buggy quot LSB */ +#define UART_BUG_TXEN BIT(1) /* UART has buggy TX IIR status */ +#define UART_BUG_NOMSR BIT(2) /* UART has buggy MSR status bits (Au1x00) */ +#define UART_BUG_THRE BIT(3) /* UART has buggy THRE reassertion */ +#define UART_BUG_PARITY BIT(4) /* UART mishandles parity if FIFO enabled */ +#define UART_BUG_TXRACE BIT(5) /* UART Tx fails to set remote DR */ #ifdef CONFIG_SERIAL_8250_SHARE_IRQ -- 2.30.2