Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2065567pxj; Wed, 19 May 2021 22:27:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMpvVHpvJPSjjFQK5wSSVpyImVx6VuDmMJQq+VFJM6/vhOVuWln6tLwd5BA9xqzWSZsveu X-Received: by 2002:a17:906:3e97:: with SMTP id a23mr2910838ejj.440.1621488437661; Wed, 19 May 2021 22:27:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621488437; cv=none; d=google.com; s=arc-20160816; b=03cJWaQsioTQp5PceXP/9iEmcbs8R6jsWg9F/HQmmsk26mGFEgcwgUyhOJGLbvPLB/ lEuGJrzAFI/gjF9+2WeuMHzGjDGhsL/lReIkOgrBcCZXpaNx1nqNSblArVc4wFOccsgL KcpltBPZFHV9LlE8/8BfYMhGsVHpAQMe0YR0MDoYXt6B3MfKVQ1YiQVYVgY7Rk3VlLy/ Wxcbt0W/9a2nu05LpmJ1g9atdL2kH79Odv8RQhYtoDWTGeXFfo4RbJF6pXfbkbBeAOA0 gNuE1DAinL2Hl/qnNYLy1u7KO7q4C6gCbxESWWWt1FiJgYvLggS6IscQ1fOUNTNe8M8r VPtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=uBDTnysTP/v0yudg9DFa2zD2k+gjVi/C3z5x9N8ueoY=; b=HvFoy2uEh3GiM3S+pY1zOKXlfiYU/Xhmb/L+N4FmN0SVLVSm0zSHjlIaYg4r9PgsGZ 48Ouc2cH3qUQCzEJh9/pGCfDmSS4qS36GwhqEOLnLt0dZJe+eQ8NfZcxTx1XH17h8jyR syEAJvG1qIr0oA0F/jkkZEhEbqD7KEwvlvTX/p1cpoPvHbX6Bw8IKaRgrZW5cP24VjXz 5LoV3K7/sjUqLv2ZKs+FkMaKxla/qmffqiM/YrfJnBBHdHzWSMONUhnhSC1x3fQBnzzm kkSFgAqVbfUbAkve5YcdBsGjG6xWqMIbiY5SXBhOig+Jf/EyQ7IlgNNpnnO/TwN1SH9t txOA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq22si1329461edb.134.2021.05.19.22.26.54; Wed, 19 May 2021 22:27:17 -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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbhETF0i (ORCPT + 99 others); Thu, 20 May 2021 01:26:38 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:52079 "EHLO mail-wm1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbhETF0i (ORCPT ); Thu, 20 May 2021 01:26:38 -0400 Received: by mail-wm1-f54.google.com with SMTP id u133so8380715wmg.1; Wed, 19 May 2021 22:25:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uBDTnysTP/v0yudg9DFa2zD2k+gjVi/C3z5x9N8ueoY=; b=Yg2OoAUHOzP27GCMCTk6m7gj2f75oRAvmKRQmHReeUn7Vlu9fnoc+qlzOtaTxr1Gq2 NJNLUqYVaf/3XTcMQfHD5pS0AC9KZs7giPnmYpOL35eIAcy36CXh+O7fxD1GLtylRPg0 aoudLlP0oxJ7KpNFjX+ZvxTbYz6i8irqma9gEsIww7Ic4IpYYm1qGuj8v9mQIHpS096X SM9MnCAs+OhWyiDHkm58XRVBhngNGZ5KOBgcOHzEE37WuB5ajk/+Q6gyoAB1A2o3q1WY q4Z9uA4EFA9YDFoWNAXcGHtInmL8kPn3Cu9NJebX/Vu8aCx7D6LABQVmjDO/t/NUlqh1 QRmg== X-Gm-Message-State: AOAM533yXfAirCyf9fRIg9RNz+0HG3I9WFDfrzSNfu5Cgu9GsvlHBV9n E7ro17xBznfFRiV+4Y+VEb0= X-Received: by 2002:a1c:9d43:: with SMTP id g64mr1793957wme.181.1621488315285; Wed, 19 May 2021 22:25:15 -0700 (PDT) Received: from ?IPv6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id a11sm1663829wrx.38.2021.05.19.22.25.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 May 2021 22:25:14 -0700 (PDT) Subject: Re: [PATCH v3 2/2] serial: 8250: Use BIT(x) for UART_{CAP,BUG}_* To: Andrew Jeffery , linux-serial@vger.kernel.org Cc: gregkh@linuxfoundation.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 References: <20210520021334.497341-1-andrew@aj.id.au> <20210520021334.497341-3-andrew@aj.id.au> From: Jiri Slaby Message-ID: <20eec190-d80e-b32a-8949-e5e2918a110b@kernel.org> Date: Thu, 20 May 2021 07:25:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210520021334.497341-3-andrew@aj.id.au> Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20. 05. 21, 4:13, Andrew Jeffery wrote: > BIT(x) improves readability and safety with respect to shifts. > > Signed-off-by: Andrew Jeffery Reviewed-by: Jiri Slaby > --- > 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 > -- js suse labs