From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
Cc: Jiri Slaby <jirislaby@kernel.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v5] tty: serial: Add RS422 flag to struct serial_rs485
Date: Thu, 23 Nov 2023 14:16:46 +0000 [thread overview]
Message-ID: <2023112346-immunity-clamshell-51c7@gregkh> (raw)
In-Reply-To: <20231121095122.15948-1-crescentcy.hsieh@moxa.com>
On Tue, Nov 21, 2023 at 05:51:22PM +0800, Crescent CY Hsieh wrote:
> --- 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 <linux/const.h>
> #include <linux/types.h>
>
> #include <linux/tty_flags.h>
> @@ -137,17 +138,19 @@ struct serial_icounter_struct {
> * * %SER_RS485_ADDRB - Enable RS485 addressing mode.
> * * %SER_RS485_ADDR_RECV - Receive address filter (enables @addr_recv). Requires %SER_RS485_ADDRB.
> * * %SER_RS485_ADDR_DEST - Destination address (enables @addr_dest). Requires %SER_RS485_ADDRB.
> + * * %SER_RS485_MODE_RS422 - Enable RS422. Requires %SER_RS485_ENABLED.
> */
> 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)
> -#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)
> +#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)
You just broke userspace by changing the flags for existing values :(
Please be much more careful in the future, do not do "cleanup" patches
along with a "add a new feature" patch, as it would have been much more
obvious as to what happened here if you had done that.
thanks,
greg k-h
next prev parent reply other threads:[~2023-11-23 17:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 9:51 [PATCH v5] tty: serial: Add RS422 flag to struct serial_rs485 Crescent CY Hsieh
2023-11-23 14:16 ` Greg Kroah-Hartman [this message]
2023-11-24 21:06 ` Lino Sanfilippo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023112346-immunity-clamshell-51c7@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=crescentcy.hsieh@moxa.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox