All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Niedermaier <cniedermaier@dh-electronics.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "crescentcy.hsieh@moxa.com" <crescentcy.hsieh@moxa.com>,
	"jirislaby@kernel.org" <jirislaby@kernel.org>,
	"LinoSanfilippo@gmx.de" <LinoSanfilippo@gmx.de>,
	"lukas@wunner.de" <lukas@wunner.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.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 09:29:10 +0000	[thread overview]
Message-ID: <fc17322010b049529054552bd44f63f1@dh-electronics.com> (raw)
In-Reply-To: <2024011836-glimmer-seventh-f2a7@gregkh>

From: Greg KH <gregkh@linuxfoundation.org>
Sent: Thursday, January 18, 2024 8:02 AM
> 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?

OK, I'll make a patch.

Regards
Christoph

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Niedermaier <cniedermaier@dh-electronics.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "crescentcy.hsieh@moxa.com" <crescentcy.hsieh@moxa.com>,
	"jirislaby@kernel.org" <jirislaby@kernel.org>,
	"LinoSanfilippo@gmx.de" <LinoSanfilippo@gmx.de>,
	"lukas@wunner.de" <lukas@wunner.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.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 09:29:10 +0000	[thread overview]
Message-ID: <fc17322010b049529054552bd44f63f1@dh-electronics.com> (raw)
In-Reply-To: <2024011836-glimmer-seventh-f2a7@gregkh>

From: Greg KH <gregkh@linuxfoundation.org>
Sent: Thursday, January 18, 2024 8:02 AM
> 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?

OK, I'll make a patch.

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

  parent reply	other threads:[~2024-01-18  9:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01  7:15 [PATCH v6 0/2] tty: serial: Add RS422 serial interface Crescent CY Hsieh
2023-12-01  7:15 ` [PATCH v6 1/2] tty: serial: Cleanup the bit shift with macro Crescent CY Hsieh
2024-01-16 15:58   ` Christoph Niedermaier
2024-01-16 15:58   ` Christoph Niedermaier
2024-01-17 14:56   ` Christoph Niedermaier
2024-01-17 14:56     ` Christoph Niedermaier
2024-01-18  7:01     ` Greg KH
2024-01-18  7:01       ` Greg KH
2024-01-18  8:14       ` Crescent CY Hsieh
2024-01-18  8:14         ` Crescent CY Hsieh
2024-01-18  8:44         ` Greg KH
2024-01-18  8:44           ` Greg KH
2024-01-18  9:29       ` Christoph Niedermaier [this message]
2024-01-18  9:29         ` Christoph Niedermaier
2023-12-01  7:15 ` [PATCH v6 2/2] tty: serial: Add RS422 flag to struct serial_rs485 Crescent CY Hsieh

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=fc17322010b049529054552bd44f63f1@dh-electronics.com \
    --to=cniedermaier@dh-electronics.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=crescentcy.hsieh@moxa.com \
    --cc=gregkh@linuxfoundation.org \
    --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 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.