public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Emese Revfy <re.emese@gmail.com>
To: benh@kernel.crashing.org, paulus@samba.org,
	torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH 12/31] Constify struct hv_ops for 2.6.32 v1
Date: Fri, 04 Dec 2009 23:26:54 +0100	[thread overview]
Message-ID: <4B198CAE.9090501@gmail.com> (raw)
In-Reply-To: <4B198670.2000406@gmail.com>

From: Emese Revfy <re.emese@gmail.com>

Constify struct hv_ops with some exceptions.

Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
 drivers/char/hvc_beat.c       |    2 +-
 drivers/char/hvc_console.c    |    6 +++---
 drivers/char/hvc_console.h    |    6 +++---
 drivers/char/hvc_iseries.c    |    2 +-
 drivers/char/hvc_iucv.c       |    2 +-
 drivers/char/hvc_rtas.c       |    2 +-
 drivers/char/hvc_udbg.c       |    2 +-
 drivers/char/hvc_vio.c        |    2 +-
 drivers/char/hvc_xen.c        |    2 +-
 drivers/char/virtio_console.c |    1 +
 10 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/char/hvc_beat.c b/drivers/char/hvc_beat.c
index 0afc8b8..6913fc3 100644
--- a/drivers/char/hvc_beat.c
+++ b/drivers/char/hvc_beat.c
@@ -84,7 +84,7 @@ static int hvc_beat_put_chars(uint32_t vtermno, const char *buf, int cnt)
 	return cnt;
 }
 
-static struct hv_ops hvc_beat_get_put_ops = {
+static const struct hv_ops hvc_beat_get_put_ops = {
 	.get_chars = hvc_beat_get_chars,
 	.put_chars = hvc_beat_put_chars,
 };
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index a632f25..e622e05 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -125,7 +125,7 @@ static struct hvc_struct *hvc_get_by_index(int index)
  * console interfaces but can still be used as a tty device.  This has to be
  * static because kmalloc will not work during early console init.
  */
-static struct hv_ops *cons_ops[MAX_NR_HVC_CONSOLES];
+static const struct hv_ops *cons_ops[MAX_NR_HVC_CONSOLES];
 static uint32_t vtermnos[MAX_NR_HVC_CONSOLES] =
 	{[0 ... MAX_NR_HVC_CONSOLES - 1] = -1};
 
@@ -247,7 +247,7 @@ static void destroy_hvc_struct(struct kref *kref)
  * vty adapters do NOT get an hvc_instantiate() callback since they
  * appear after early console init.
  */
-int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops)
+int hvc_instantiate(uint32_t vtermno, int index, const struct hv_ops *ops)
 {
 	struct hvc_struct *hp;
 
@@ -749,7 +749,7 @@ static const struct tty_operations hvc_ops = {
 };
 
 struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data,
-					struct hv_ops *ops, int outbuf_size)
+					const struct hv_ops *ops, int outbuf_size)
 {
 	struct hvc_struct *hp;
 	int i;
diff --git a/drivers/char/hvc_console.h b/drivers/char/hvc_console.h
index 10950ca..ed176c3 100644
--- a/drivers/char/hvc_console.h
+++ b/drivers/char/hvc_console.h
@@ -55,7 +55,7 @@ struct hvc_struct {
 	int outbuf_size;
 	int n_outbuf;
 	uint32_t vtermno;
-	struct hv_ops *ops;
+	const struct hv_ops *ops;
 	int irq_requested;
 	int data;
 	struct winsize ws;
@@ -76,11 +76,11 @@ struct hv_ops {
 };
 
 /* Register a vterm and a slot index for use as a console (console_init) */
-extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops);
+extern int hvc_instantiate(uint32_t vtermno, int index, const struct hv_ops *ops);
 
 /* register a vterm for hvc tty operation (module_init or hotplug add) */
 extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int data,
-				struct hv_ops *ops, int outbuf_size);
+				const struct hv_ops *ops, int outbuf_size);
 /* remove a vterm from hvc tty operation (module_exit or hotplug remove) */
 extern int hvc_remove(struct hvc_struct *hp);
 
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index 936d05b..fd02426 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -197,7 +197,7 @@ done:
 	return sent;
 }
 
-static struct hv_ops hvc_get_put_ops = {
+static const struct hv_ops hvc_get_put_ops = {
 	.get_chars = get_chars,
 	.put_chars = put_chars,
 	.notifier_add = notifier_add_irq,
diff --git a/drivers/char/hvc_iucv.c b/drivers/char/hvc_iucv.c
index b8a5d65..619f7d1 100644
--- a/drivers/char/hvc_iucv.c
+++ b/drivers/char/hvc_iucv.c
@@ -922,7 +922,7 @@ static int hvc_iucv_pm_restore_thaw(struct device *dev)
 
 
 /* HVC operations */
-static struct hv_ops hvc_iucv_ops = {
+static const struct hv_ops hvc_iucv_ops = {
 	.get_chars = hvc_iucv_get_chars,
 	.put_chars = hvc_iucv_put_chars,
 	.notifier_add = hvc_iucv_notifier_add,
diff --git a/drivers/char/hvc_rtas.c b/drivers/char/hvc_rtas.c
index 88590d0..61c4a61 100644
--- a/drivers/char/hvc_rtas.c
+++ b/drivers/char/hvc_rtas.c
@@ -71,7 +71,7 @@ static int hvc_rtas_read_console(uint32_t vtermno, char *buf, int count)
 	return i;
 }
 
-static struct hv_ops hvc_rtas_get_put_ops = {
+static const struct hv_ops hvc_rtas_get_put_ops = {
 	.get_chars = hvc_rtas_read_console,
 	.put_chars = hvc_rtas_write_console,
 };
diff --git a/drivers/char/hvc_udbg.c b/drivers/char/hvc_udbg.c
index bd63ba8..b0957e6 100644
--- a/drivers/char/hvc_udbg.c
+++ b/drivers/char/hvc_udbg.c
@@ -58,7 +58,7 @@ static int hvc_udbg_get(uint32_t vtermno, char *buf, int count)
 	return i;
 }
 
-static struct hv_ops hvc_udbg_ops = {
+static const struct hv_ops hvc_udbg_ops = {
 	.get_chars = hvc_udbg_get,
 	.put_chars = hvc_udbg_put,
 };
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index 10be343..27370e9 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -77,7 +77,7 @@ static int filtered_get_chars(uint32_t vtermno, char *buf, int count)
 	return got;
 }
 
-static struct hv_ops hvc_get_put_ops = {
+static const struct hv_ops hvc_get_put_ops = {
 	.get_chars = filtered_get_chars,
 	.put_chars = hvc_put_chars,
 	.notifier_add = notifier_add_irq,
diff --git a/drivers/char/hvc_xen.c b/drivers/char/hvc_xen.c
index a6ee32b..94f8c26 100644
--- a/drivers/char/hvc_xen.c
+++ b/drivers/char/hvc_xen.c
@@ -120,7 +120,7 @@ static int read_console(uint32_t vtermno, char *buf, int len)
 	return recv;
 }
 
-static struct hv_ops hvc_ops = {
+static const struct hv_ops hvc_ops = {
 	.get_chars = read_console,
 	.put_chars = write_console,
 	.notifier_add = notifier_add_irq,
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index a035ae3..cc50600 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -44,6 +44,7 @@ static unsigned int in_len;
 static char *in, *inbuf;
 
 /* The operations for our console. */
+/* cannot be const */
 static struct hv_ops virtio_cons;
 
 /* The hvc device */

  parent reply	other threads:[~2009-12-04 22:25 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 22:00 [PATCH 00/31] constify various _ops structures for 2.6.32 v1 Emese Revfy
2009-12-04 22:05 ` [PATCH 01/31] Constify struct acpi_dock_ops " Emese Revfy
2009-12-04 22:08 ` [PATCH 02/31] Constify struct address_space_operations " Emese Revfy
2009-12-05  0:08   ` Matthew Wilcox
2009-12-05  0:36     ` Emese Revfy
2009-12-05 14:27       ` Matthew Wilcox
2009-12-06  0:18         ` Emese Revfy
2009-12-04 22:09 ` [PATCH 03/31] Constify struct backlight_ops " Emese Revfy
2009-12-04 22:12 ` [PATCH 04/31] Constify struct block_device_operations " Emese Revfy
2009-12-04 22:14 ` [PATCH 05/31] Constify struct dma_map_ops " Emese Revfy
2009-12-05  0:59   ` Stephen Rothwell
2009-12-05  1:20     ` Stephen Rothwell
2009-12-05  2:00       ` Emese Revfy
2009-12-05  2:10         ` Stephen Rothwell
2009-12-05  2:25           ` Emese Revfy
2009-12-05  2:27             ` Stephen Rothwell
2009-12-05  2:52               ` Emese Revfy
2009-12-05  3:21                 ` Stephen Rothwell
2009-12-05 13:32                   ` Emese Revfy
2009-12-04 22:16 ` [PATCH 06/31] Constify struct e1000_mac_operations " Emese Revfy
2009-12-04 22:39   ` Waskiewicz Jr, Peter P
2009-12-05  0:03   ` Emese Revfy
2009-12-05  0:40     ` Stephen Rothwell
2009-12-05  1:18       ` Emese Revfy
2009-12-05  1:21         ` Jeff Kirsher
2009-12-06  0:37   ` [PATCH 06/31] Constify struct e1000_mac_operations for net-next-2.6 v1 Emese Revfy
2009-12-04 22:17 ` [PATCH 07/31] Constify struct e1000_nvm_operations for 2.6.32 v1 Emese Revfy
2009-12-04 22:40   ` Waskiewicz Jr, Peter P
2009-12-05  0:03   ` Emese Revfy
2009-12-06  0:38   ` [PATCH 07/31] Constify struct e1000_nvm_operations for net-next-2.6 v1 Emese Revfy
2009-12-04 22:19 ` [PATCH 08/31] Constify struct e1000_phy_operations for 2.6.32 v1 Emese Revfy
2009-12-04 22:40   ` Waskiewicz Jr, Peter P
2009-12-05  0:03   ` Emese Revfy
2009-12-06  0:38   ` [PATCH 08/31] Constify struct e1000_phy_operations for net-next-2.6 v1 Emese Revfy
2009-12-04 22:21 ` [PATCH 09/31] Constify struct extent_io_ops for 2.6.32 v1 Emese Revfy
2009-12-07 14:12   ` Chris Mason
2009-12-07 23:27     ` Emese Revfy
2009-12-04 22:22 ` [PATCH 10/31] Constify struct file_lock_operations " Emese Revfy
2009-12-04 22:25 ` [PATCH 11/31] Constify struct file_operations " Emese Revfy
2009-12-04 23:07   ` Emese Revfy
2009-12-05  0:02   ` Emese Revfy
2009-12-05  0:09     ` Greg KH
2009-12-05  2:50       ` Emese Revfy
2009-12-05  4:15         ` Greg KH
2009-12-06  1:47           ` Emese Revfy
2009-12-06 17:25             ` Greg KH
2009-12-07  0:45               ` Emese Revfy
2009-12-07 15:11                 ` Greg KH
2009-12-07 17:35                   ` Emese Revfy
2009-12-07 17:57                     ` Greg KH
2009-12-05 14:16     ` Jiri Slaby
2009-12-06  2:38       ` Emese Revfy
2009-12-06  9:23         ` Jiri Slaby
2009-12-04 22:26 ` Emese Revfy [this message]
2009-12-04 22:28 ` [PATCH 13/31] Constify struct intel_dvo_dev_ops " Emese Revfy
2009-12-04 22:29 ` [PATCH 14/31] Constify struct item_operations " Emese Revfy
2009-12-04 22:31 ` [PATCH 15/31] Constify struct iwl_ops " Emese Revfy
2009-12-04 23:05   ` Emese Revfy
2009-12-05  0:02   ` Emese Revfy
2009-12-04 22:32 ` [PATCH 16/31] Constify struct kgdb_arch " Emese Revfy
2009-12-04 22:33 ` [PATCH 17/31] Constify struct kgdb_io " Emese Revfy
2009-12-04 22:35 ` [PATCH 18/31] Constify struct kset_uevent_ops " Emese Revfy
2009-12-04 22:36 ` [PATCH 19/31] Constify struct lock_manager_operations " Emese Revfy
2009-12-04 22:37 ` [PATCH 20/31] Constify struct microcode_ops " Emese Revfy
2009-12-04 22:38 ` [PATCH 21/31] Constify struct mtrr_ops " Emese Revfy
2009-12-07 18:40   ` H. Peter Anvin
2009-12-04 22:39 ` [PATCH 22/31] Constify struct neigh_ops " Emese Revfy
2009-12-04 23:02   ` Emese Revfy
2009-12-04 23:19     ` David Miller
2009-12-05  0:02   ` Emese Revfy
2009-12-04 22:40 ` [PATCH 23/31] Constify struct nlmsvc_binding " Emese Revfy
2009-12-04 22:41 ` [PATCH 24/31] Constify struct pci_raw_ops " Emese Revfy
2009-12-04 22:42 ` [PATCH 25/31] Constify struct platform_hibernation_ops " Emese Revfy
2009-12-04 22:43 ` [PATCH 26/31] Constify struct platform_suspend_ops " Emese Revfy
2009-12-04 22:44 ` [PATCH 27/31] Constify struct snd_ac97_build_ops " Emese Revfy
2009-12-04 22:47 ` [PATCH 28/31] Constify struct super_operations " Emese Revfy
2009-12-06  1:23   ` Al Viro
2009-12-06  1:41     ` Emese Revfy
2009-12-04 22:49 ` [PATCH 29/31] Constify struct sysfs_ops " Emese Revfy
2009-12-04 23:00   ` Emese Revfy
2009-12-04 23:57   ` Stephen Hemminger
2009-12-05  0:03   ` Emese Revfy
2009-12-05 21:15     ` Jens Axboe
2009-12-06  8:58       ` Pekka Enberg
2009-12-07  9:53     ` Hans J. Koch
2009-12-07 17:46   ` Matt Domsch
2009-12-07 20:09   ` David Teigland
2009-12-04 22:50 ` [PATCH 30/31] Constify struct usb_mon_operations " Emese Revfy
2009-12-04 22:51 ` [PATCH 31/31] Constify struct wd_ops " Emese Revfy

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=4B198CAE.9090501@gmail.com \
    --to=re.emese@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=torvalds@linux-foundation.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