]> git.baikalelectronics.ru Git - kernel.git/commit
staging: dgnc: Constify ktermios structure
authorGargi Sharma <gs051095@gmail.com>
Sun, 5 Mar 2017 09:51:44 +0000 (15:21 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Mar 2017 06:37:01 +0000 (07:37 +0100)
commit9d3cabb0a765b9f87ede1f2ad56161c749b3e1f6
treed4c363f231ea972d47ca4d7dbef6208ef1568b36
parentaa39bd72d73a2b155ee7cb4e77529695c5ff26b1
staging: dgnc: Constify ktermios structure

The ktermios structure is a local default termios struct. All ports
are initially created with this termios. Since, the structure is
never modified, it can be declared as const.

Coccinelle Script:
@r disable optional_qualifier@
identifier s,i;
position p;
@@
static struct ktermios i@p = { ... };

@ok1@
identifier r.i;
expression e;
position p;
@@
e = i@p

@bad@
position p != {r.p,ok1.p};
identifier r.i;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct ktermios i = { ... };

File Size before:

text data   bss   dec    hex   filename
25469 2048   256   27773  6c7d  drivers/staging/dgnc/dgnc_tty.o

File Size after:

text data bss dec hex filename
25636 2016 256 27908 6d04 drivers/staging/dgnc/dgnc_tty.o

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c