From: Helge Deller <deller@gmx.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [mm/ subdirectory] constifications
Date: Sun, 8 Oct 2006 21:29:51 +0200 [thread overview]
Message-ID: <200610082129.52005.deller@gmx.de> (raw)
In-Reply-To: <200610082120.57709.deller@gmx.de>
On Sunday 08 October 2006 21:20, Helge Deller wrote:
> [ Patch deleted ]
Sorry, last mail was the wrong patch for the mail subject.
Here is the correct one:
[mm/ directory] constify some static string arrays and their pointers
Signed-off-by: Helge Deller <deller@gmx.de>
include/linux/mmzone.h | 2 +-
mm/mempolicy.c | 4 ++--
mm/page_alloc.c | 2 +-
mm/shmem.c | 4 ++--
mm/swapfile.c | 2 +-
mm/vmstat.c | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 59855b8..1d88f9b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -282,7 +282,7 @@ struct zone {
/*
* rarely used fields:
*/
- char *name;
+ const char *name;
} ____cacheline_internodealigned_in_smp;
/*
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 25788b1..15a7999 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1705,8 +1705,8 @@ void mpol_rebind_mm(struct mm_struct *mm
* Display pages allocated per node and memory policy via /proc.
*/
-static const char *policy_types[] = { "default", "prefer", "bind",
- "interleave" };
+static const char * const policy_types[] =
+ { "default", "prefer", "bind", "interleave" };
/*
* Convert a mempolicy into a string.
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a8c003e..b706eef 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -89,7 +89,7 @@ EXPORT_SYMBOL(totalram_pages);
struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly;
EXPORT_SYMBOL(zone_table);
-static char *zone_names[MAX_NR_ZONES] = {
+static const char * const zone_names[MAX_NR_ZONES] = {
"DMA",
#ifdef CONFIG_ZONE_DMA32
"DMA32",
diff --git a/mm/shmem.c b/mm/shmem.c
index bb8ca7e..b9b69e2 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -176,7 +176,7 @@ static inline void shmem_unacct_blocks(u
static struct super_operations shmem_ops;
static const struct address_space_operations shmem_aops;
-static struct file_operations shmem_file_operations;
+static const struct file_operations shmem_file_operations;
static struct inode_operations shmem_inode_operations;
static struct inode_operations shmem_dir_inode_operations;
static struct inode_operations shmem_special_inode_operations;
@@ -2237,7 +2237,7 @@ static const struct address_space_operat
.migratepage = migrate_page,
};
-static struct file_operations shmem_file_operations = {
+static const struct file_operations shmem_file_operations = {
.mmap = shmem_mmap,
#ifdef CONFIG_TMPFS
.llseek = generic_file_llseek,
diff --git a/mm/swapfile.c b/mm/swapfile.c
index a15def6..88219d6 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1337,7 +1337,7 @@ static int swaps_open(struct inode *inod
return seq_open(file, &swaps_op);
}
-static struct file_operations proc_swaps_operations = {
+static const struct file_operations proc_swaps_operations = {
.open = swaps_open,
.read = seq_read,
.llseek = seq_lseek,
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 45b124e..be7701a 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -452,7 +452,7 @@ struct seq_operations fragmentation_op =
#define TEXTS_FOR_ZONES(xx) xx "_dma", TEXT_FOR_DMA32(xx) xx "_normal", \
TEXT_FOR_HIGHMEM(xx)
-static char *vmstat_text[] = {
+static const char * const vmstat_text[] = {
/* Zoned VM counters */
"nr_anon_pages",
"nr_mapped",
prev parent reply other threads:[~2006-10-08 19:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-08 19:20 [PATCH] [mm/ subdirectory] constifications Helge Deller
2006-10-08 19:29 ` Helge Deller [this message]
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=200610082129.52005.deller@gmx.de \
--to=deller@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.