From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<kernel-janitors@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-serial@vger.kernel.org>, Jiri Slaby <jslaby@suse.com>,
<linux-snps-arc@lists.infradead.org>
Subject: Re: [PATCH 9/9] serial/arc: constify uart_ops structures
Date: Thu, 1 Sep 2016 11:49:45 -0700 [thread overview]
Message-ID: <a666292c-e4a8-d6b4-6e2a-a44d8b6b9528@synopsys.com> (raw)
In-Reply-To: <1472752298-981-10-git-send-email-Julia.Lawall@lip6.fr>
On 09/01/2016 10:51 AM, Julia Lawall wrote:
> Check for uart_ops structures that are only stored in the ops field of a
> uart_port structure. This field is declared const, so uart_ops structures
> that have this property can be declared as const also.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r disable optional_qualifier@
> identifier i;
> position p;
> @@
> static struct uart_ops i@p = { ... };
>
> @ok@
> identifier r.i;
> struct uart_port e;
> position p;
> @@
> e.ops = &i@p;
>
> @bad@
> position p != {r.p,ok.p};
> identifier r.i;
> struct uart_ops e;
> @@
> e@i@p
>
> @depends on !bad disable optional_qualifier@
> identifier r.i;
> @@
> static
> +const
> struct uart_ops i = { ... };
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Thx for making it better Julia !
-Vineet
>
> ---
> drivers/tty/serial/arc_uart.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
> index 3a1de5c..5ac06fc 100644
> --- a/drivers/tty/serial/arc_uart.c
> +++ b/drivers/tty/serial/arc_uart.c
> @@ -464,7 +464,7 @@ static int arc_serial_poll_getchar(struct uart_port *port)
> }
> #endif
>
> -static struct uart_ops arc_serial_pops = {
> +static const struct uart_ops arc_serial_pops = {
> .tx_empty = arc_serial_tx_empty,
> .set_mctrl = arc_serial_set_mctrl,
> .get_mctrl = arc_serial_get_mctrl,
>
prev parent reply other threads:[~2016-09-01 21:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 17:51 [PATCH 0/9] " Julia Lawall
2016-09-01 17:51 ` [PATCH 1/9] serial: st-asc: " Julia Lawall
2016-09-01 19:55 ` [STLinux Kernel] " Peter Griffin
2016-09-01 17:51 ` [PATCH 2/9] tty/serial: at91: " Julia Lawall
2016-09-02 7:55 ` Nicolas Ferre
2016-09-01 17:51 ` [PATCH 3/9] serial: altera: " Julia Lawall
2016-09-02 8:36 ` Tobias Klauser
2016-09-01 17:51 ` [PATCH 4/9] serial/bcm63xx_uart: " Julia Lawall
2016-09-01 17:51 ` [PATCH 5/9] tty: serial: jsm_tty: " Julia Lawall
2016-09-01 22:58 ` Gabriel Krisman Bertazi
2016-09-01 17:51 ` [PATCH 6/9] tty: serial: " Julia Lawall
2016-09-01 17:51 ` [PATCH 7/9] tty: xuartps: " Julia Lawall
2016-09-01 17:51 ` [PATCH 8/9] serial-uartlite: " Julia Lawall
2016-09-01 17:51 ` [PATCH 9/9] serial/arc: " Julia Lawall
2016-09-01 18:49 ` Vineet Gupta [this message]
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=a666292c-e4a8-d6b4-6e2a-a44d8b6b9528@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=Julia.Lawall@lip6.fr \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.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
Powered by JetHome