Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b68e31d0 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds
Browse files

[PATCH] const struct tty_operations



As part of an SMP cleanliness pass over UML, I consted a bunch of
structures in order to not have to document their locking.  One of these
structures was a struct tty_operations.  In order to const it in UML
without introducing compiler complaints, the declaration of
tty_set_operations needs to be changed, and then all of its callers need to
be fixed.

This patch declares all struct tty_operations in the tree as const.  In all
cases, they are static and used only as input to tty_set_operations.  As an
extra check, I ran an i386 allyesconfig build which produced no extra
warnings.

53 drivers are affected.  I checked the history of a bunch of them, and in
most cases, there have been only a handful of maintenance changes in the
last six months.  serial_core.c was the busiest one that I looked at.

Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ed97bd37
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ srmcons_close(struct tty_struct *tty, struct file *filp)

static struct tty_driver *srmcons_driver;

static struct tty_operations srmcons_ops = {
static const struct tty_operations srmcons_ops = {
	.open		= srmcons_open,
	.close		= srmcons_close,
	.write		= srmcons_write,
+1 −1
Original line number Diff line number Diff line
@@ -940,7 +940,7 @@ static inline void show_serial_version(void)
	printk(KERN_INFO " no serial options enabled\n");
}

static struct tty_operations hp_ops = {
static const struct tty_operations hp_ops = {
	.open = rs_open,
	.close = rs_close,
	.write = rs_write,
+1 −1
Original line number Diff line number Diff line
@@ -1720,7 +1720,7 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp)
    return 0;
}

static struct tty_operations sicc_ops = {
static const struct tty_operations sicc_ops = {
	.open = siccuart_open,
	.close = siccuart_close,
	.write = siccuart_write,
+3 −3
Original line number Diff line number Diff line
@@ -643,8 +643,8 @@ int line_remove(struct line *lines, unsigned int num, int n)

struct tty_driver *line_register_devfs(struct lines *set,
				       struct line_driver *line_driver,
			 struct tty_operations *ops, struct line *lines,
			 int nlines)
				       const struct tty_operations *ops,
				       struct line *lines, int nlines)
{
	int i;
	struct tty_driver *driver = alloc_tty_driver(nlines);
+3 −4
Original line number Diff line number Diff line
@@ -92,9 +92,8 @@ extern int line_setup_irq(int fd, int input, int output, struct line *line,
extern void line_close_chan(struct line *line);
extern struct tty_driver * line_register_devfs(struct lines *set,
					       struct line_driver *line_driver,
				struct tty_operations *driver,
				struct line *lines,
				int nlines);
					       const struct tty_operations *driver,
					       struct line *lines, int nlines);
extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts);
extern void close_lines(struct line *lines, int nlines);

Loading