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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAD7FC47077 for ; Thu, 18 Jan 2024 07:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G7Ke7QRBvUkwiRlEenEyR8rb1guWorOv9wLlUWiOdM0=; b=Omzn+uFa0UWVg/ uLCoLsitHH3oJ8A3eZXTiY3vqGzJBv9kJB3RMni/sI/qY227xp+khZcTjX8IxuyfpI8Ga5M0QFi/d bfix9Q9URYZVDc7x4LPgEBFxo7Z1DM5349QhhGguIjj8DzdXs0Sh7II8vN/OwgLGCXz5GQnKNViFD emLj+hO/+M8jDTM2XfX/CYK9gswcu6kt456yj9f8B4sxYSyK/pQrI1N0b5UcRHAQAfqDx0cw5zA9R U4enjHG26/RrxBBB11XGshYi+RStETxtLjsxezC3ogwQonOBRwbG9aGxrNMmKQRtPijbFjx1fbltw ZlMTNEosZqcxSvt/e6Jg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQMPg-001qxY-2w; Thu, 18 Jan 2024 07:02:08 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rQMPe-001qwG-1i for linux-arm-kernel@lists.infradead.org; Thu, 18 Jan 2024 07:02:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id DA3BAB813D3; Thu, 18 Jan 2024 07:02:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF183C433F1; Thu, 18 Jan 2024 07:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1705561321; bh=Szngl9KR9trVcJI9mDPXjLVcKtiXPzUtSgGBv4tGig8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WG6wM0cGznp/rgxljmjbdb3RIL05aKNtBumUdVDErcJe2smWjRbiYDxFaoPs78BwM 7XEAA7LMTybpv1Mlqb2CX+qFdzM1ivWy61CNuJCvJE9GMPLnWDusTuGEm5cSMioNtO HnLXDhUddXdsHQLZ8kPRCmYeKvBsFl+byWatSTTY= Date: Thu, 18 Jan 2024 08:01:58 +0100 From: Greg KH To: Christoph Niedermaier Cc: crescentcy.hsieh@moxa.com, jirislaby@kernel.org, LinoSanfilippo@gmx.de, lukas@wunner.de, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v6 1/2] tty: serial: Cleanup the bit shift with macro Message-ID: <2024011836-glimmer-seventh-f2a7@gregkh> References: <20231201071554.258607-2-crescentcy.hsieh@moxa.com> <20240117145623.3556-1-cniedermaier@dh-electronics.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240117145623.3556-1-cniedermaier@dh-electronics.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_230206_750712_3BE794F2 X-CRM114-Status: GOOD ( 17.52 ) 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, Jan 17, 2024 at 03:56:23PM +0100, Christoph Niedermaier wrote: > Hi everyone, > > > This patch replaces the bit shift code with "_BITUL()" macro inside > > "serial_rs485" struct. > > > > Signed-off-by: Crescent CY Hsieh > > --- > > include/uapi/linux/serial.h | 17 +++++++++-------- > > 1 file changed, 9 insertions(+), 8 deletions(-) > > > > diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h > > index 53bc1af67..6c75ebdd7 100644 > > --- a/include/uapi/linux/serial.h > > +++ b/include/uapi/linux/serial.h > > @@ -11,6 +11,7 @@ > > #ifndef _UAPI_LINUX_SERIAL_H > > #define _UAPI_LINUX_SERIAL_H > > > > +#include > > #include > > > > #include > > @@ -140,14 +141,14 @@ struct serial_icounter_struct { > > */ > > struct serial_rs485 { > > __u32 flags; > > -#define SER_RS485_ENABLED (1 << 0) > > -#define SER_RS485_RTS_ON_SEND (1 << 1) > > -#define SER_RS485_RTS_AFTER_SEND (1 << 2) > > In the old definition (1 << 3) wasn't used. > > > -#define SER_RS485_RX_DURING_TX (1 << 4) > > -#define SER_RS485_TERMINATE_BUS (1 << 5) > > -#define SER_RS485_ADDRB (1 << 6) > > -#define SER_RS485_ADDR_RECV (1 << 7) > > -#define SER_RS485_ADDR_DEST (1 << 8) > > +#define SER_RS485_ENABLED _BITUL(0) > > +#define SER_RS485_RTS_ON_SEND _BITUL(1) > > +#define SER_RS485_RTS_AFTER_SEND _BITUL(2) > > +#define SER_RS485_RX_DURING_TX _BITUL(3) > > Isn't it a break if number 3 isn't skipped here as well? Ugh, yes it is, good catch! Care to send a patch to fix this up? thanks, greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel