From: Greg KH <gregkh@linuxfoundation.org>
To: Christoph Niedermaier <cniedermaier@dh-electronics.com>
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
Date: Thu, 18 Jan 2024 08:01:58 +0100 [thread overview]
Message-ID: <2024011836-glimmer-seventh-f2a7@gregkh> (raw)
In-Reply-To: <20240117145623.3556-1-cniedermaier@dh-electronics.com>
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 <crescentcy.hsieh@moxa.com>
> > ---
> > 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 <linux/const.h>
> > #include <linux/types.h>
> >
> > #include <linux/tty_flags.h>
> > @@ -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
next prev parent reply other threads:[~2024-01-18 7:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 15:58 [PATCH v6 1/2] tty: serial: Cleanup the bit shift with macro Christoph Niedermaier
2024-01-17 14:56 ` Christoph Niedermaier
2024-01-18 7:01 ` Greg KH [this message]
2024-01-18 8:14 ` Crescent CY Hsieh
2024-01-18 8:44 ` Greg KH
2024-01-18 9:29 ` Christoph Niedermaier
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=2024011836-glimmer-seventh-f2a7@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=LinoSanfilippo@gmx.de \
--cc=cniedermaier@dh-electronics.com \
--cc=crescentcy.hsieh@moxa.com \
--cc=jirislaby@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lukas@wunner.de \
/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