From patchwork Thu Jan 18 15:46:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 13522980 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 5CE97C4707B for ; Thu, 18 Jan 2024 15:47:38 +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:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=5pneVdAQBfpjy5NzoEY3FtHCGOqHQJMw7TznIINmvdw=; b=h1lh2UrhHvL5Ao bosTQRcvsqP+TzNCoGFpJXFOhrujL3wxLJNQiSqbToKDSnI9l6f6YUbXu2RnBljPc2qmMs0rOSkIT oSKCgAOo5pph1aacijAGFs4JGnAKG6oKFpRgp8SRAn9z1C7PDaRPu5TQ8XV/lEFZ5jWuTXsGTvChj NSInPNsSJcy7gVR8YOazQ6BrbmftqgLLFwusga80RHi8GMWoqZ9fJBvyV3EqygYe2nEwgCWmv3s7d UfFULZ2WvRosBQctWFlfX3trT6Hv//qelD1HPbExUtMpCh8WWewp8HNg3IVI4bv0YEe31JB7RudKA 7FNDWg1qYg4H0u4xCayg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQUbr-00393a-1Y; Thu, 18 Jan 2024 15:47:15 +0000 Received: from mx4.securetransport.de ([178.254.6.145]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQUbn-00393B-36 for linux-arm-kernel@lists.infradead.org; Thu, 18 Jan 2024 15:47:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1705592807; bh=upvN6szEOm7tmfaGe0dW7qQ3Hu0oZMv45sMxsy/e33E=; h=From:To:CC:Subject:Date:From; b=Y4dFegwV3mS58uQTQt2URdE1+yca1cJ5jMppf4xj/u2M+VqZFvm7D4s+wXBCG8rkB VlMHjYibRsWYZqUBlu/h5Z1Il80d79YbMoWF5EmLaoC17YNd0MxdyApOVHgd1ry6yM XHfRWcp73REWO64voasqLe4HpC95EHrPXUeUqAHVkLA14NPPMdkeJHBC7QoDloy/Cc xjr9Nbfni56RVZCO96R2XPtkvbqU9zEugoIYD0Lya4UHQ3hVhfiAglLK5aRzKdT+VE GCyEOfghEd99/Gu2woresoiHwlFLIuf9gLtfUaR06YWLESHb0PyIYaznH6PtbOvSxz UuXHHmJaKqWoQ== From: Christoph Niedermaier To: , CC: Christoph Niedermaier , Greg Kroah-Hartman , Crescent CY Hsieh , Jiri Slaby , Lukas Wunner , Lino Sanfilippo , Hugo Villeneuve Subject: [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions Date: Thu, 18 Jan 2024 16:46:24 +0100 Message-ID: <20240118154624.5340-1-cniedermaier@dh-electronics.com> X-klartext: yes MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240118_074712_168377_81E88C48 X-CRM114-Status: GOOD ( 10.61 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since the commit 93f3350c46fa ("RS485: fix inconsistencies in the meaning of some variables"), the definition for bit 3 has been removed. But with the switch to bit shift macros in commit 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro"), this gap wasn't preserved. To avoid a break in user/kernel api of the system skip bit 3 again and add a placeholder comment. Signed-off-by: Christoph Niedermaier Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro") Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485") Reviewed-by: Jiri Slaby --- Cc: Greg Kroah-Hartman Cc: Crescent CY Hsieh Cc: Jiri Slaby Cc: Lukas Wunner Cc: Lino Sanfilippo Cc: Hugo Villeneuve To: linux-serial@vger.kernel.org To: linux-arm-kernel@lists.infradead.org --- V2: - Fix typo - Add Fixes tags --- include/uapi/linux/serial.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h index 9086367db043..de9b4733607e 100644 --- a/include/uapi/linux/serial.h +++ b/include/uapi/linux/serial.h @@ -145,12 +145,13 @@ struct serial_rs485 { #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) -#define SER_RS485_TERMINATE_BUS _BITUL(4) -#define SER_RS485_ADDRB _BITUL(5) -#define SER_RS485_ADDR_RECV _BITUL(6) -#define SER_RS485_ADDR_DEST _BITUL(7) -#define SER_RS485_MODE_RS422 _BITUL(8) +/* Placeholder for bit 3: SER_RS485_RTS_BEFORE_SEND, which isn't used anymore */ +#define SER_RS485_RX_DURING_TX _BITUL(4) +#define SER_RS485_TERMINATE_BUS _BITUL(5) +#define SER_RS485_ADDRB _BITUL(6) +#define SER_RS485_ADDR_RECV _BITUL(7) +#define SER_RS485_ADDR_DEST _BITUL(8) +#define SER_RS485_MODE_RS422 _BITUL(9) __u32 delay_rts_before_send; __u32 delay_rts_after_send;