diff options
author | Gargi Sharma <gs051095@gmail.com> | 2017-03-05 15:21:44 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-07 07:37:01 +0100 |
commit | 541e68e0c3d0be9a940632edc5181788fff11d88 (patch) | |
tree | d4c363f231ea972d47ca4d7dbef6208ef1568b36 /drivers/staging/dgnc | |
parent | 5ad7288bb988088e362859acf5bdb055a48370b1 (diff) | |
download | linux-stable-541e68e0c3d0be9a940632edc5181788fff11d88.tar.gz linux-stable-541e68e0c3d0be9a940632edc5181788fff11d88.tar.bz2 linux-stable-541e68e0c3d0be9a940632edc5181788fff11d88.zip |
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>
Diffstat (limited to 'drivers/staging/dgnc')
-rw-r--r-- | drivers/staging/dgnc/dgnc_tty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index c3b8fc54883d..cde00e3702fa 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -58,7 +58,7 @@ static const struct digi_t dgnc_digi_init = { * This defines a raw port at 9600 baud, 8 data bits, no parity, * 1 stop bit. */ -static struct ktermios default_termios = { +static const struct ktermios default_termios = { .c_iflag = (DEFAULT_IFLAGS), /* iflags */ .c_oflag = (DEFAULT_OFLAGS), /* oflags */ .c_cflag = (DEFAULT_CFLAGS), /* cflags */ |