Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755551AbZLNAHy (ORCPT ); Sun, 13 Dec 2009 19:07:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755064AbZLMX6S (ORCPT ); Sun, 13 Dec 2009 18:58:18 -0500 Received: from mx2.mail.elte.hu ([157.181.151.9]:34375 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755032AbZLMX6K (ORCPT ); Sun, 13 Dec 2009 18:58:10 -0500 From: re.emese@gmail.com To: linux-kernel@vger.kernel.org Cc: Emese Revfy , jason.wessel@windriver.com, akpm@linux-foundation.org, steiner@sgi.com, torvalds@linux-foundation.org Subject: [PATCH 1/1] Constify struct kgdb_io for 2.6.32-git-053fe57ac v2 Date: Mon, 14 Dec 2009 01:00:02 +0100 Message-Id: <00c88a66048b0a225fddec9a89ac2553ca7506dc.1260663000.git.re.emese@gmail.com> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: References: X-ELTE-SpamScore: 0.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=0.0 required=5.9 tests=none autolearn=no SpamAssassin version=3.2.5 _SUMMARY_ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4037 Lines: 128 From: Emese Revfy Signed-off-by: Emese Revfy --- 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 fcb6ec1..42f5558 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]; @@ -1108,7 +1108,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 2eb517e..a66317a 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 */ @@ -1661,7 +1661,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; @@ -1706,7 +1706,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); -- 1.6.5.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/