Commit 1dff399616a79b8ef5d61ad68f2ef1e1f590b465
1 parent
971f339000
Exists in
master
and in
39 other branches
hvc_console: make the ops pointer const.
This is nicer for modern R/O protection. And noone needs it non-const, so constify the callers as well. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Amit Shah <amit.shah@redhat.com> To: Christian Borntraeger <borntraeger@de.ibm.com> Cc: linuxppc-dev@ozlabs.org
Showing 10 changed files with 16 additions and 14 deletions Side-by-side Diff
drivers/char/hvc_beat.c
drivers/char/hvc_console.c
... | ... | @@ -125,7 +125,7 @@ |
125 | 125 | * console interfaces but can still be used as a tty device. This has to be |
126 | 126 | * static because kmalloc will not work during early console init. |
127 | 127 | */ |
128 | -static struct hv_ops *cons_ops[MAX_NR_HVC_CONSOLES]; | |
128 | +static const struct hv_ops *cons_ops[MAX_NR_HVC_CONSOLES]; | |
129 | 129 | static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] = |
130 | 130 | {[0 ... MAX_NR_HVC_CONSOLES - 1] = -1}; |
131 | 131 | |
... | ... | @@ -247,7 +247,7 @@ |
247 | 247 | * vty adapters do NOT get an hvc_instantiate() callback since they |
248 | 248 | * appear after early console init. |
249 | 249 | */ |
250 | -int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops) | |
250 | +int hvc_instantiate(uint32_t vtermno, int index, const struct hv_ops *ops) | |
251 | 251 | { |
252 | 252 | struct hvc_struct *hp; |
253 | 253 | |
... | ... | @@ -749,7 +749,8 @@ |
749 | 749 | }; |
750 | 750 | |
751 | 751 | struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data, |
752 | - struct hv_ops *ops, int outbuf_size) | |
752 | + const struct hv_ops *ops, | |
753 | + int outbuf_size) | |
753 | 754 | { |
754 | 755 | struct hvc_struct *hp; |
755 | 756 | int i; |
drivers/char/hvc_console.h
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | int outbuf_size; |
56 | 56 | int n_outbuf; |
57 | 57 | uint32_t vtermno; |
58 | - struct hv_ops *ops; | |
58 | + const struct hv_ops *ops; | |
59 | 59 | int irq_requested; |
60 | 60 | int data; |
61 | 61 | struct winsize ws; |
62 | 62 | |
... | ... | @@ -76,11 +76,12 @@ |
76 | 76 | }; |
77 | 77 | |
78 | 78 | /* Register a vterm and a slot index for use as a console (console_init) */ |
79 | -extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops); | |
79 | +extern int hvc_instantiate(uint32_t vtermno, int index, | |
80 | + const struct hv_ops *ops); | |
80 | 81 | |
81 | 82 | /* register a vterm for hvc tty operation (module_init or hotplug add) */ |
82 | 83 | extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int data, |
83 | - struct hv_ops *ops, int outbuf_size); | |
84 | + const struct hv_ops *ops, int outbuf_size); | |
84 | 85 | /* remove a vterm from hvc tty operation (module_exit or hotplug remove) */ |
85 | 86 | extern int hvc_remove(struct hvc_struct *hp); |
86 | 87 |
drivers/char/hvc_iseries.c
drivers/char/hvc_iucv.c
drivers/char/hvc_rtas.c
drivers/char/hvc_udbg.c
drivers/char/hvc_vio.c
drivers/char/hvc_xen.c
drivers/char/virtio_console.c