From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-serial@vger.kernel.org>
Cc: <kernel-janitors@vger.kernel.org>, Jiri Slaby <jslaby@suse.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/9] tty/serial: at91: constify uart_ops structures
Date: Fri, 2 Sep 2016 09:55:51 +0200 [thread overview]
Message-ID: <931065fc-5304-a0d5-1cde-b02bc5dc4b21@atmel.com> (raw)
In-Reply-To: <1472752298-981-3-git-send-email-Julia.Lawall@lip6.fr>
Le 01/09/2016 à 19:51, Julia Lawall a écrit :
> 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: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks Julia.
Bye,
> ---
> drivers/tty/serial/atmel_serial.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 2eaa18d..963a72f 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -2292,7 +2292,7 @@ static void atmel_poll_put_char(struct uart_port *port, unsigned char ch)
> }
> #endif
>
> -static struct uart_ops atmel_pops = {
> +static const struct uart_ops atmel_pops = {
> .tx_empty = atmel_tx_empty,
> .set_mctrl = atmel_set_mctrl,
> .get_mctrl = atmel_get_mctrl,
>
>
--
Nicolas Ferre
next prev parent reply other threads:[~2016-09-02 7:56 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 [this message]
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
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=931065fc-5304-a0d5-1cde-b02bc5dc4b21@atmel.com \
--to=nicolas.ferre@atmel.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 \
/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
all inboxes | Powered by JetHome®