All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions
@ 2024-01-18 15:46 ` Christoph Niedermaier
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Niedermaier @ 2024-01-18 15:46 UTC (permalink / raw)
  To: linux-serial, linux-arm-kernel
  Cc: Christoph Niedermaier, Greg Kroah-Hartman, Crescent CY Hsieh,
	Jiri Slaby, Lukas Wunner, Lino Sanfilippo, Hugo Villeneuve

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 <cniedermaier@dh-electronics.com>
Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro")
Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485")
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Cc: Hugo Villeneuve <hugo@hugovil.com>
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;
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions
@ 2024-01-18 15:46 ` Christoph Niedermaier
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Niedermaier @ 2024-01-18 15:46 UTC (permalink / raw)
  To: linux-serial, linux-arm-kernel
  Cc: Christoph Niedermaier, Greg Kroah-Hartman, Crescent CY Hsieh,
	Jiri Slaby, Lukas Wunner, Lino Sanfilippo, Hugo Villeneuve

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 <cniedermaier@dh-electronics.com>
Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro")
Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485")
---
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>
Cc: Hugo Villeneuve <hugo@hugovil.com>
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;
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions
  2024-01-18 15:46 ` Christoph Niedermaier
@ 2024-01-19  6:36   ` Jiri Slaby
  -1 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2024-01-19  6:36 UTC (permalink / raw)
  To: Christoph Niedermaier, linux-serial, linux-arm-kernel
  Cc: Greg Kroah-Hartman, Crescent CY Hsieh, Lukas Wunner,
	Lino Sanfilippo, Hugo Villeneuve

On 18. 01. 24, 16:46, Christoph Niedermaier wrote:
> 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 <cniedermaier@dh-electronics.com>
> Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro")
> Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485")
> ---

This triple dash is superfluous and will likely break git am.

> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
> Cc: Jiri Slaby <jirislaby@kernel.org>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>
> Cc: Hugo Villeneuve <hugo@hugovil.com>
> To: linux-serial@vger.kernel.org
> To: linux-arm-kernel@lists.infradead.org

"To" is not supported here, IMO.

When you fix that:
Reviewed-by: Jiri Slaby <jirislaby@kernel.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;

-- 
js
suse labs


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions
@ 2024-01-19  6:36   ` Jiri Slaby
  0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2024-01-19  6:36 UTC (permalink / raw)
  To: Christoph Niedermaier, linux-serial, linux-arm-kernel
  Cc: Greg Kroah-Hartman, Crescent CY Hsieh, Lukas Wunner,
	Lino Sanfilippo, Hugo Villeneuve

On 18. 01. 24, 16:46, Christoph Niedermaier wrote:
> 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 <cniedermaier@dh-electronics.com>
> Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro")
> Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485")
> ---

This triple dash is superfluous and will likely break git am.

> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
> Cc: Jiri Slaby <jirislaby@kernel.org>
> Cc: Lukas Wunner <lukas@wunner.de>
> Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>
> Cc: Hugo Villeneuve <hugo@hugovil.com>
> To: linux-serial@vger.kernel.org
> To: linux-arm-kernel@lists.infradead.org

"To" is not supported here, IMO.

When you fix that:
Reviewed-by: Jiri Slaby <jirislaby@kernel.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;

-- 
js
suse labs


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions
  2024-01-19  6:36   ` Jiri Slaby
@ 2024-01-19 11:39     ` Christoph Niedermaier
  -1 siblings, 0 replies; 6+ messages in thread
From: Christoph Niedermaier @ 2024-01-19 11:39 UTC (permalink / raw)
  To: Jiri Slaby, linux-serial, linux-arm-kernel
  Cc: Greg Kroah-Hartman, Crescent CY Hsieh, Lukas Wunner,
	Lino Sanfilippo, Hugo Villeneuve

From: Jiri Slaby [mailto:jirislaby@kernel.org]
Sent: Friday, January 19, 2024 7:36 AM
> On 18. 01. 24, 16:46, Christoph Niedermaier wrote:
>> 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 <cniedermaier@dh-electronics.com>
>> Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro")
>> Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485")
>> ---
> 
> This triple dash is superfluous and will likely break git am.

OK.
 
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
>> Cc: Jiri Slaby <jirislaby@kernel.org>
>> Cc: Lukas Wunner <lukas@wunner.de>
>> Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>
>> Cc: Hugo Villeneuve <hugo@hugovil.com>
>> To: linux-serial@vger.kernel.org
>> To: linux-arm-kernel@lists.infradead.org
> 
> "To" is not supported here, IMO.

OK.

> When you fix that:
> Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

I will create a version 3.

[...]

Regards
Christoph
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions
@ 2024-01-19 11:39     ` Christoph Niedermaier
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Niedermaier @ 2024-01-19 11:39 UTC (permalink / raw)
  To: Jiri Slaby, linux-serial, linux-arm-kernel
  Cc: Greg Kroah-Hartman, Crescent CY Hsieh, Lukas Wunner,
	Lino Sanfilippo, Hugo Villeneuve

From: Jiri Slaby [mailto:jirislaby@kernel.org]
Sent: Friday, January 19, 2024 7:36 AM
> On 18. 01. 24, 16:46, Christoph Niedermaier wrote:
>> 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 <cniedermaier@dh-electronics.com>
>> Fixes: 76ac8e29855b ("tty: serial: Cleanup the bit shift with macro")
>> Fixes: 6056f20f27e9 ("tty: serial: Add RS422 flag to struct serial_rs485")
>> ---
> 
> This triple dash is superfluous and will likely break git am.

OK.
 
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
>> Cc: Jiri Slaby <jirislaby@kernel.org>
>> Cc: Lukas Wunner <lukas@wunner.de>
>> Cc: Lino Sanfilippo <l.sanfilippo@kunbus.com>
>> Cc: Hugo Villeneuve <hugo@hugovil.com>
>> To: linux-serial@vger.kernel.org
>> To: linux-arm-kernel@lists.infradead.org
> 
> "To" is not supported here, IMO.

OK.

> When you fix that:
> Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

I will create a version 3.

[...]

Regards
Christoph

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-19 11:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 15:46 [PATCH V2] tty: serial: Fix bit order in RS485 flag definitions Christoph Niedermaier
2024-01-18 15:46 ` Christoph Niedermaier
2024-01-19  6:36 ` Jiri Slaby
2024-01-19  6:36   ` Jiri Slaby
2024-01-19 11:39   ` Christoph Niedermaier
2024-01-19 11:39     ` Christoph Niedermaier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.