From: Joe Perches <joe@perches.com>
To: Michal Simek <michal.simek@xilinx.com>,
johan@kernel.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, monstr@monstr.eu
Cc: Nava kishore Manne <nava.manne@xilinx.com>,
Jiri Slaby <jslaby@suse.com>,
linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 5/6] serial: uartps: Do not add a trailing semicolon to macro
Date: Wed, 12 Jun 2019 10:07:25 -0700 [thread overview]
Message-ID: <fc69912c14ead80f371e2136d43db4af1f4b72aa.camel@perches.com> (raw)
In-Reply-To: <5d938d34c3c4710577df898dbf4b70c74d2e6730.1560338079.git.michal.simek@xilinx.com>
On Wed, 2019-06-12 at 13:14 +0200, Michal Simek wrote:
> From: Nava kishore Manne <nava.manne@xilinx.com>
>
> This patch fixes this checkpatch warning:
> WARNING: macros should not use a trailing semicolon
> +#define to_cdns_uart(_nb) container_of(_nb, struct cdns_uart, \
> + clk_rate_change_nb);
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
[]
> @@ -199,7 +199,7 @@ struct cdns_platform_data {
> u32 quirks;
> };
> #define to_cdns_uart(_nb) container_of(_nb, struct cdns_uart, \
> - clk_rate_change_nb);
> + clk_rate_change_nb)
>
> /**
> * cdns_uart_handle_rx - Handle the received bytes along with Rx errors.
trivia:
Perhaps this is easier for humans to read with the macro
on two lines like:
#define to_cdns_uart(_nb) \
container_of(_nb, struct cdns_uart, clk_rate_change_nb)
or just ignore the 80 column limit
#define to_cdns_uart(_nb) container_of(_nb, struct cdns_uart, clk_rate_change_nb)
or because the macro is only used in one place,
just get rid of it and use container_of directly.
---
drivers/tty/serial/xilinx_uartps.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 605354fd60b1..ca5cec2b83ce 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -195,11 +195,10 @@ struct cdns_uart {
u32 quirks;
bool cts_override;
};
+
struct cdns_platform_data {
u32 quirks;
};
-#define to_cdns_uart(_nb) container_of(_nb, struct cdns_uart, \
- clk_rate_change_nb);
/**
* cdns_uart_handle_rx - Handle the received bytes along with Rx errors.
@@ -489,8 +488,9 @@ static int cdns_uart_clk_notifier_cb(struct notifier_block *nb,
int locked = 0;
struct clk_notifier_data *ndata = data;
unsigned long flags = 0;
- struct cdns_uart *cdns_uart = to_cdns_uart(nb);
+ struct cdns_uart *cdns_uart;
+ cdns_uart = container_of(nb, struct cdns_uart, clk_rate_change_nb);
port = cdns_uart->port;
if (port->suspended)
return NOTIFY_OK;
next prev parent reply other threads:[~2019-06-12 17:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 11:14 [PATCH v2 0/6] serial: uartps: Michal Simek
2019-06-12 11:14 ` [PATCH v2 1/6] serial: uartps: Use the same dynamic major number for all ports Michal Simek
2019-06-12 11:14 ` [PATCH v2 2/6] serial: uartps: Use octal permission for module_param() Michal Simek
2019-06-12 11:14 ` [PATCH v2 3/6] serial: uartps: Fix multiple line dereference Michal Simek
2019-06-12 16:56 ` Joe Perches
2019-06-12 11:14 ` [PATCH v2 4/6] serial: uartps: Fix long line over 80 chars Michal Simek
2019-06-12 11:14 ` [PATCH v2 5/6] serial: uartps: Do not add a trailing semicolon to macro Michal Simek
2019-06-12 17:07 ` Joe Perches [this message]
2019-06-12 11:14 ` [PATCH v2 6/6] serial: uartps: Remove useless return from cdns_uart_poll_put_char Michal Simek
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=fc69912c14ead80f371e2136d43db4af1f4b72aa.camel@perches.com \
--to=joe@perches.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=jslaby@suse.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=monstr@monstr.eu \
--cc=nava.manne@xilinx.com \
/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
Powered by JetHome