lkml.org 
[lkml]   [2009]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 17/31] Constify struct kgdb_io for 2.6.32 v1
From: Emese Revfy <re.emese@gmail.com>

Constify struct kgdb_io.

Signed-off-by: Emese Revfy <re.emese@gmail.com>
---
drivers/misc/kgdbts.c | 4 ++--
drivers/serial/kgdboc.c | 4 ++--
include/linux/kgdb.h | 18 +++++++++---------
kernel/kgdb.c | 6 +++---
4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
index e4ff50b..4cc3f04 100644
--- a/drivers/misc/kgdbts.c
+++ b/drivers/misc/kgdbts.c
@@ -118,7 +118,7 @@
} while (0)
#define MAX_CONFIG_LEN 40

-static struct kgdb_io kgdbts_io_ops;
+static const struct kgdb_io kgdbts_io_ops;
static char get_buf[BUFMAX];
static int get_buf_cnt;
static char put_buf[BUFMAX];
@@ -1102,7 +1102,7 @@ static void kgdbts_post_exp_handler(void)
module_put(THIS_MODULE);
}

-static struct kgdb_io kgdbts_io_ops = {
+static const struct kgdb_io kgdbts_io_ops = {
.name = "kgdbts",
.read_char = kgdbts_get_char,
.write_char = kgdbts_put_char,
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c
index eadc1ab..2d81457 100644
--- a/drivers/serial/kgdboc.c
+++ b/drivers/serial/kgdboc.c
@@ -18,7 +18,7 @@

#define MAX_CONFIG_LEN 40

-static struct kgdb_io kgdboc_io_ops;
+static const struct kgdb_io kgdboc_io_ops;

/* -1 = init not run yet, 0 = unconfigured, 1 = configured. */
static int configured = -1;
@@ -154,7 +154,7 @@ static void kgdboc_post_exp_handler(void)
module_put(THIS_MODULE);
}

-static struct kgdb_io kgdboc_io_ops = {
+static const struct kgdb_io kgdboc_io_ops = {
.name = "kgdboc",
.read_char = kgdboc_get_char,
.write_char = kgdboc_put_char,
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index 6adcc29..ba61222 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -251,20 +251,20 @@ struct kgdb_arch {
*/
struct kgdb_io {
const char *name;
- int (*read_char) (void);
- void (*write_char) (u8);
- void (*flush) (void);
- int (*init) (void);
- void (*pre_exception) (void);
- void (*post_exception) (void);
+ int (* const read_char) (void);
+ void (* const write_char) (u8);
+ void (* const flush) (void);
+ int (* const init) (void);
+ void (* const pre_exception) (void);
+ void (* const post_exception) (void);
};

-extern struct kgdb_arch arch_kgdb_ops;
+extern struct kgdb_arch arch_kgdb_ops;

extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs);

-extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops);
-extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops);
+extern int kgdb_register_io_module(const struct kgdb_io *local_kgdb_io_ops);
+extern void kgdb_unregister_io_module(const struct kgdb_io *local_kgdb_io_ops);

extern int kgdb_hex2long(char **ptr, unsigned long *long_val);
extern int kgdb_mem2hex(char *mem, char *buf, int count);
diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index 9147a31..f9203e4 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -86,7 +86,7 @@ static int kgdb_io_module_registered;
/* Guard for recursive entry */
static int exception_level;

-static struct kgdb_io *kgdb_io_ops;
+static const struct kgdb_io *kgdb_io_ops;
static DEFINE_SPINLOCK(kgdb_registration_lock);

/* kgdb console driver is loaded */
@@ -1637,7 +1637,7 @@ static void kgdb_initial_breakpoint(void)
*
* Register it with the KGDB core.
*/
-int kgdb_register_io_module(struct kgdb_io *new_kgdb_io_ops)
+int kgdb_register_io_module(const struct kgdb_io *new_kgdb_io_ops)
{
int err;

@@ -1682,7 +1682,7 @@ EXPORT_SYMBOL_GPL(kgdb_register_io_module);
*
* Unregister it with the KGDB core.
*/
-void kgdb_unregister_io_module(struct kgdb_io *old_kgdb_io_ops)
+void kgdb_unregister_io_module(const struct kgdb_io *old_kgdb_io_ops)
{
BUG_ON(kgdb_connected);



\
 
 \ /
  Last update: 2009-12-04 23:35    [W:0.298 / U:3.108 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site