From patchwork Fri Jan 19 11:35:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Niedermaier X-Patchwork-Id: 13523720 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 888B2C4725D for ; Fri, 19 Jan 2024 11:41:27 +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=pPUjH3fJLN+ujJgMZ4T+Ugj2rZmn0fwU9uDfocUZ2rY=; b=bCsaQGboQObeCL mULL7q6hGlqsKBmol1d0Ggky+tofLEMFyTB90rdYsHrQaT5vZmQmnwhSXAjOdM4eQBtUjkQC5qUyg dAZdwFRRCItJYLrf1GFV/Rmlab71OQYf0VnPTgxv/nIwpV9FDjtVrAkZwLPRr4JS1saUUs0vFORRk 656Y1NicWzxHkMEQ7YvlsIzxzJjcytzNdJ5z9oYjNYM8ZjzV7cK+0SEu8YkNDA/D4P9SDXITm8XJc TotF2BvXTQF+Nw/e4QtkI6b1YFQLVw+d885URgzZTlFYyvNyAy9cgpqhrnZ2DitKlSfPk4r6J3sLN A5YZ8KdhZE9aIQ2P7TWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQnF8-005G7v-10; Fri, 19 Jan 2024 11:41:02 +0000 Received: from mx4.securetransport.de ([178.254.6.145]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQnF4-005G6n-2v for linux-arm-kernel@lists.infradead.org; Fri, 19 Jan 2024 11:41:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1705664436; bh=7myNZ3RCwcag+XwWnSm1WHpr+kXN5+I3yuwLlfOLSws=; h=From:To:CC:Subject:Date:From; b=ALZNMtopR2X8qc3C7Ffonr54ZyT/Yqr3iZpEbbSQ/VYuUHLt/qx/waPqO6exC0lVr Ir7DJKmfateOHbSX9DOSNoXXugnJWNEcB6q/MMNCTwcHEch1eu9o/pWVgJiJmfnQJA u7eAT1KQw5dUzpRBn1bipm7GhIBYCrXHXKQWQMVIfj4iKZBl5daMy2SKzvdvpa3Ml+ nxgMCdpqwHnu0vzE7ktMm0JnwExAaBNBbCpH33B+Fzz+8co0hLeYoOyeX4nZ/z9atA okgWW+ZB5YrWYzIZe5HIzhw13YZHvNJkZ1/GV26PmrUs8ejIvuoSQX3Id+huAk+mKK yqwVTCglMrf1Q== From: Christoph Niedermaier To: , CC: Christoph Niedermaier , "Greg Kroah-Hartman" , Crescent CY Hsieh , Jiri Slaby , Lukas Wunner , Lino Sanfilippo , Hugo Villeneuve Subject: [PATCH V3] tty: serial: Fix bit order in RS485 flag definitions Date: Fri, 19 Jan 2024 12:35:16 +0100 Message-ID: <20240119113516.2944-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-20240119_034059_091072_1948AE37 X-CRM114-Status: GOOD ( 10.55 ) 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 --- V2: - Fix typo - Add Fixes tags V3: - Add Reviewed-by tag - Remove triple dash after the last Fixes tag - Remove all "To:"s after "Cc:" --- 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;