* [PATCH next 00/16] treewide: Use static const char * const where possible
@ 2010-09-14 4:23 Joe Perches
2010-09-14 4:23 ` [PATCH next 01/16] arch/alpha: " Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2010-09-14 4:23 UTC (permalink / raw)
To: linux-kernel
Cc: devel, alsa-devel, linux-usb, linux-ia64, linux-scsi, kvm,
microblaze-uclinux, linux-alpha, linux-wireless, users, dri-devel,
netdev, linux-fsdevel, linux-watchdog
Convert the uses that should be const of
char *foo[] = {"bar", "baz"};
to
const char * const foo[] = {"bar", "baz"};
or
static const char * const foo[] = {"bar", "baz"};
Joe Perches (16):
arch/alpha: Use static const char * const where possible
arch/ia64: Use static const char * const where possible
arch/microblaze: Use static const char * const where possible
arch/x86: Use static const char * const where possible
drivers/gpu: Use static const char * const where possible
drivers/isdn: Use static const char * const where possible
drivers/net: Use static const char * const where possible
drivers/net/pcmcia: Use static const char * const where possible
drivers/net/wireless: Use static const char * const where possible
drivers/scsi: Use static const char * const where possible
drivers/staging: Use static const char * const where possible
drivers/usb: Use static const char * const where possible
drivers/watchdog: Use static const char * const where possible
fs: Use static const char * const where possible
net/irda: Use static const char * const where possible
sound: Use static const char * const where possible
arch/alpha/kernel/err_ev6.c | 12 +++++---
arch/alpha/kernel/err_marvel.c | 33 ++++++++++++------------
arch/alpha/kernel/err_titan.c | 35 ++++++++++++++-----------
arch/alpha/kernel/osf_sys.c | 4 +-
arch/ia64/kernel/palinfo.c | 2 +-
arch/microblaze/kernel/heartbeat.c | 10 +++---
arch/microblaze/kernel/timer.c | 12 ++++----
arch/x86/kernel/smpboot.c | 2 +-
arch/x86/kvm/mmu.c | 2 +-
drivers/gpu/drm/ttm/ttm_page_alloc.c | 4 ++-
drivers/isdn/pcbit/edss1.c | 2 +-
drivers/isdn/pcbit/edss1.h | 2 +-
drivers/net/3c515.c | 4 ++-
drivers/net/eth16i.c | 4 ++-
drivers/net/pcmcia/3c589_cs.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +-
drivers/scsi/bfa/rport.c | 4 ++-
drivers/scsi/pcmcia/nsp_debug.c | 2 +-
drivers/scsi/qla2xxx/qla_nx.c | 4 +-
drivers/scsi/qla4xxx/ql4_nx.c | 2 +-
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 14 +++++-----
drivers/staging/bcm/Debug.c | 5 ++-
drivers/usb/host/oxu210hp-hcd.c | 2 +-
drivers/watchdog/machzwd.c | 2 +-
fs/binfmt_flat.c | 4 ++-
include/net/irda/irlan_event.h | 2 +-
net/irda/irlan/irlan_event.c | 2 +-
sound/core/misc.c | 5 +---
sound/core/pcm_native.c | 2 +-
29 files changed, 99 insertions(+), 83 deletions(-)
--
1.7.3.rc1
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH next 01/16] arch/alpha: Use static const char * const where possible 2010-09-14 4:23 [PATCH next 00/16] treewide: Use static const char * const where possible Joe Perches @ 2010-09-14 4:23 ` Joe Perches 2010-09-14 15:37 ` Richard Henderson 2010-09-14 17:03 ` Matt Turner 0 siblings, 2 replies; 4+ messages in thread From: Joe Perches @ 2010-09-14 4:23 UTC (permalink / raw) To: linux-kernel; +Cc: Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-alpha Signed-off-by: Joe Perches <joe@perches.com> --- arch/alpha/kernel/err_ev6.c | 12 +++++++----- arch/alpha/kernel/err_marvel.c | 33 +++++++++++++++++---------------- arch/alpha/kernel/err_titan.c | 35 ++++++++++++++++++++--------------- arch/alpha/kernel/osf_sys.c | 4 ++-- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/arch/alpha/kernel/err_ev6.c b/arch/alpha/kernel/err_ev6.c index 8ca6345..253cf1a 100644 --- a/arch/alpha/kernel/err_ev6.c +++ b/arch/alpha/kernel/err_ev6.c @@ -90,11 +90,13 @@ static int ev6_parse_cbox(u64 c_addr, u64 c1_syn, u64 c2_syn, u64 c_stat, u64 c_sts, int print) { - char *sourcename[] = { "UNKNOWN", "UNKNOWN", "UNKNOWN", - "MEMORY", "BCACHE", "DCACHE", - "BCACHE PROBE", "BCACHE PROBE" }; - char *streamname[] = { "D", "I" }; - char *bitsname[] = { "SINGLE", "DOUBLE" }; + static const char * const sourcename[] = { + "UNKNOWN", "UNKNOWN", "UNKNOWN", + "MEMORY", "BCACHE", "DCACHE", + "BCACHE PROBE", "BCACHE PROBE" + }; + static const char * const streamname[] = { "D", "I" }; + static const char * const bitsname[] = { "SINGLE", "DOUBLE" }; int status = MCHK_DISPOSITION_REPORT; int source = -1, stream = -1, bits = -1; diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c index 5c905aa..648ae88 100644 --- a/arch/alpha/kernel/err_marvel.c +++ b/arch/alpha/kernel/err_marvel.c @@ -589,22 +589,23 @@ marvel_print_pox_spl_cmplt(u64 spl_cmplt) static void marvel_print_pox_trans_sum(u64 trans_sum) { - char *pcix_cmd[] = { "Interrupt Acknowledge", - "Special Cycle", - "I/O Read", - "I/O Write", - "Reserved", - "Reserved / Device ID Message", - "Memory Read", - "Memory Write", - "Reserved / Alias to Memory Read Block", - "Reserved / Alias to Memory Write Block", - "Configuration Read", - "Configuration Write", - "Memory Read Multiple / Split Completion", - "Dual Address Cycle", - "Memory Read Line / Memory Read Block", - "Memory Write and Invalidate / Memory Write Block" + static const char * const pcix_cmd[] = { + "Interrupt Acknowledge", + "Special Cycle", + "I/O Read", + "I/O Write", + "Reserved", + "Reserved / Device ID Message", + "Memory Read", + "Memory Write", + "Reserved / Alias to Memory Read Block", + "Reserved / Alias to Memory Write Block", + "Configuration Read", + "Configuration Write", + "Memory Read Multiple / Split Completion", + "Dual Address Cycle", + "Memory Read Line / Memory Read Block", + "Memory Write and Invalidate / Memory Write Block" }; #define IO7__POX_TRANSUM__PCI_ADDR__S (0) diff --git a/arch/alpha/kernel/err_titan.c b/arch/alpha/kernel/err_titan.c index f7ed97c..c3b3781 100644 --- a/arch/alpha/kernel/err_titan.c +++ b/arch/alpha/kernel/err_titan.c @@ -75,8 +75,12 @@ titan_parse_p_serror(int which, u64 serror, int print) int status = MCHK_DISPOSITION_REPORT; #ifdef CONFIG_VERBOSE_MCHECK - char *serror_src[] = {"GPCI", "APCI", "AGP HP", "AGP LP"}; - char *serror_cmd[] = {"DMA Read", "DMA RMW", "SGTE Read", "Reserved"}; + static const char * const serror_src[] = { + "GPCI", "APCI", "AGP HP", "AGP LP" + }; + static const char * const serror_cmd[] = { + "DMA Read", "DMA RMW", "SGTE Read", "Reserved" + }; #endif /* CONFIG_VERBOSE_MCHECK */ #define TITAN__PCHIP_SERROR__LOST_UECC (1UL << 0) @@ -140,14 +144,15 @@ titan_parse_p_perror(int which, int port, u64 perror, int print) int status = MCHK_DISPOSITION_REPORT; #ifdef CONFIG_VERBOSE_MCHECK - char *perror_cmd[] = { "Interrupt Acknowledge", "Special Cycle", - "I/O Read", "I/O Write", - "Reserved", "Reserved", - "Memory Read", "Memory Write", - "Reserved", "Reserved", - "Configuration Read", "Configuration Write", - "Memory Read Multiple", "Dual Address Cycle", - "Memory Read Line","Memory Write and Invalidate" + static const char * const perror_cmd[] = { + "Interrupt Acknowledge", "Special Cycle", + "I/O Read", "I/O Write", + "Reserved", "Reserved", + "Memory Read", "Memory Write", + "Reserved", "Reserved", + "Configuration Read", "Configuration Write", + "Memory Read Multiple", "Dual Address Cycle", + "Memory Read Line", "Memory Write and Invalidate" }; #endif /* CONFIG_VERBOSE_MCHECK */ @@ -273,11 +278,11 @@ titan_parse_p_agperror(int which, u64 agperror, int print) int cmd, len; unsigned long addr; - char *agperror_cmd[] = { "Read (low-priority)", "Read (high-priority)", - "Write (low-priority)", - "Write (high-priority)", - "Reserved", "Reserved", - "Flush", "Fence" + static const char * const agperror_cmd[] = { + "Read (low-priority)", "Read (high-priority)", + "Write (low-priority)", "Write (high-priority)", + "Reserved", "Reserved", + "Flush", "Fence" }; #endif /* CONFIG_VERBOSE_MCHECK */ diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 5d1e6d6..16bc1f5 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c @@ -594,7 +594,7 @@ SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss, SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) { - char *sysinfo_table[] = { + const char *sysinfo_table[] = { utsname()->sysname, utsname()->nodename, utsname()->release, @@ -606,7 +606,7 @@ SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) "dummy", /* secure RPC domain */ }; unsigned long offset; - char *res; + const char *res; long len, err = -EINVAL; offset = command-1; -- 1.7.3.rc1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH next 01/16] arch/alpha: Use static const char * const where possible 2010-09-14 4:23 ` [PATCH next 01/16] arch/alpha: " Joe Perches @ 2010-09-14 15:37 ` Richard Henderson 2010-09-14 17:03 ` Matt Turner 1 sibling, 0 replies; 4+ messages in thread From: Richard Henderson @ 2010-09-14 15:37 UTC (permalink / raw) To: Joe Perches; +Cc: linux-kernel, Ivan Kokshaysky, Matt Turner, linux-alpha On 09/13/2010 09:23 PM, Joe Perches wrote: > Signed-off-by: Joe Perches <joe@perches.com> > --- > arch/alpha/kernel/err_ev6.c | 12 +++++++----- > arch/alpha/kernel/err_marvel.c | 33 +++++++++++++++++---------------- > arch/alpha/kernel/err_titan.c | 35 ++++++++++++++++++++--------------- > arch/alpha/kernel/osf_sys.c | 4 ++-- > 4 files changed, 46 insertions(+), 38 deletions(-) Acked-by: Richard Henderson <rth@twiddle.net> r~ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH next 01/16] arch/alpha: Use static const char * const where possible 2010-09-14 4:23 ` [PATCH next 01/16] arch/alpha: " Joe Perches 2010-09-14 15:37 ` Richard Henderson @ 2010-09-14 17:03 ` Matt Turner 1 sibling, 0 replies; 4+ messages in thread From: Matt Turner @ 2010-09-14 17:03 UTC (permalink / raw) To: Joe Perches; +Cc: linux-kernel, Richard Henderson, Ivan Kokshaysky, linux-alpha On Tue, Sep 14, 2010 at 12:23 AM, Joe Perches <joe@perches.com> wrote: > Signed-off-by: Joe Perches <joe@perches.com> > --- > arch/alpha/kernel/err_ev6.c | 12 +++++++----- > arch/alpha/kernel/err_marvel.c | 33 +++++++++++++++++---------------- > arch/alpha/kernel/err_titan.c | 35 ++++++++++++++++++++--------------- > arch/alpha/kernel/osf_sys.c | 4 ++-- > 4 files changed, 46 insertions(+), 38 deletions(-) > > diff --git a/arch/alpha/kernel/err_ev6.c b/arch/alpha/kernel/err_ev6.c > index 8ca6345..253cf1a 100644 > --- a/arch/alpha/kernel/err_ev6.c > +++ b/arch/alpha/kernel/err_ev6.c > @@ -90,11 +90,13 @@ static int > ev6_parse_cbox(u64 c_addr, u64 c1_syn, u64 c2_syn, > u64 c_stat, u64 c_sts, int print) > { > - char *sourcename[] = { "UNKNOWN", "UNKNOWN", "UNKNOWN", > - "MEMORY", "BCACHE", "DCACHE", > - "BCACHE PROBE", "BCACHE PROBE" }; > - char *streamname[] = { "D", "I" }; > - char *bitsname[] = { "SINGLE", "DOUBLE" }; > + static const char * const sourcename[] = { > + "UNKNOWN", "UNKNOWN", "UNKNOWN", > + "MEMORY", "BCACHE", "DCACHE", > + "BCACHE PROBE", "BCACHE PROBE" > + }; > + static const char * const streamname[] = { "D", "I" }; > + static const char * const bitsname[] = { "SINGLE", "DOUBLE" }; > int status = MCHK_DISPOSITION_REPORT; > int source = -1, stream = -1, bits = -1; > > diff --git a/arch/alpha/kernel/err_marvel.c b/arch/alpha/kernel/err_marvel.c > index 5c905aa..648ae88 100644 > --- a/arch/alpha/kernel/err_marvel.c > +++ b/arch/alpha/kernel/err_marvel.c > @@ -589,22 +589,23 @@ marvel_print_pox_spl_cmplt(u64 spl_cmplt) > static void > marvel_print_pox_trans_sum(u64 trans_sum) > { > - char *pcix_cmd[] = { "Interrupt Acknowledge", > - "Special Cycle", > - "I/O Read", > - "I/O Write", > - "Reserved", > - "Reserved / Device ID Message", > - "Memory Read", > - "Memory Write", > - "Reserved / Alias to Memory Read Block", > - "Reserved / Alias to Memory Write Block", > - "Configuration Read", > - "Configuration Write", > - "Memory Read Multiple / Split Completion", > - "Dual Address Cycle", > - "Memory Read Line / Memory Read Block", > - "Memory Write and Invalidate / Memory Write Block" > + static const char * const pcix_cmd[] = { > + "Interrupt Acknowledge", > + "Special Cycle", > + "I/O Read", > + "I/O Write", > + "Reserved", > + "Reserved / Device ID Message", > + "Memory Read", > + "Memory Write", > + "Reserved / Alias to Memory Read Block", > + "Reserved / Alias to Memory Write Block", > + "Configuration Read", > + "Configuration Write", > + "Memory Read Multiple / Split Completion", > + "Dual Address Cycle", > + "Memory Read Line / Memory Read Block", > + "Memory Write and Invalidate / Memory Write Block" > }; > > #define IO7__POX_TRANSUM__PCI_ADDR__S (0) > diff --git a/arch/alpha/kernel/err_titan.c b/arch/alpha/kernel/err_titan.c > index f7ed97c..c3b3781 100644 > --- a/arch/alpha/kernel/err_titan.c > +++ b/arch/alpha/kernel/err_titan.c > @@ -75,8 +75,12 @@ titan_parse_p_serror(int which, u64 serror, int print) > int status = MCHK_DISPOSITION_REPORT; > > #ifdef CONFIG_VERBOSE_MCHECK > - char *serror_src[] = {"GPCI", "APCI", "AGP HP", "AGP LP"}; > - char *serror_cmd[] = {"DMA Read", "DMA RMW", "SGTE Read", "Reserved"}; > + static const char * const serror_src[] = { > + "GPCI", "APCI", "AGP HP", "AGP LP" > + }; > + static const char * const serror_cmd[] = { > + "DMA Read", "DMA RMW", "SGTE Read", "Reserved" > + }; > #endif /* CONFIG_VERBOSE_MCHECK */ > > #define TITAN__PCHIP_SERROR__LOST_UECC (1UL << 0) > @@ -140,14 +144,15 @@ titan_parse_p_perror(int which, int port, u64 perror, int print) > int status = MCHK_DISPOSITION_REPORT; > > #ifdef CONFIG_VERBOSE_MCHECK > - char *perror_cmd[] = { "Interrupt Acknowledge", "Special Cycle", > - "I/O Read", "I/O Write", > - "Reserved", "Reserved", > - "Memory Read", "Memory Write", > - "Reserved", "Reserved", > - "Configuration Read", "Configuration Write", > - "Memory Read Multiple", "Dual Address Cycle", > - "Memory Read Line","Memory Write and Invalidate" > + static const char * const perror_cmd[] = { > + "Interrupt Acknowledge", "Special Cycle", > + "I/O Read", "I/O Write", > + "Reserved", "Reserved", > + "Memory Read", "Memory Write", > + "Reserved", "Reserved", > + "Configuration Read", "Configuration Write", > + "Memory Read Multiple", "Dual Address Cycle", > + "Memory Read Line", "Memory Write and Invalidate" > }; > #endif /* CONFIG_VERBOSE_MCHECK */ > > @@ -273,11 +278,11 @@ titan_parse_p_agperror(int which, u64 agperror, int print) > int cmd, len; > unsigned long addr; > > - char *agperror_cmd[] = { "Read (low-priority)", "Read (high-priority)", > - "Write (low-priority)", > - "Write (high-priority)", > - "Reserved", "Reserved", > - "Flush", "Fence" > + static const char * const agperror_cmd[] = { > + "Read (low-priority)", "Read (high-priority)", > + "Write (low-priority)", "Write (high-priority)", > + "Reserved", "Reserved", > + "Flush", "Fence" > }; > #endif /* CONFIG_VERBOSE_MCHECK */ > > diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c > index 5d1e6d6..16bc1f5 100644 > --- a/arch/alpha/kernel/osf_sys.c > +++ b/arch/alpha/kernel/osf_sys.c > @@ -594,7 +594,7 @@ SYSCALL_DEFINE2(osf_sigstack, struct sigstack __user *, uss, > > SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) > { > - char *sysinfo_table[] = { > + const char *sysinfo_table[] = { > utsname()->sysname, > utsname()->nodename, > utsname()->release, > @@ -606,7 +606,7 @@ SYSCALL_DEFINE3(osf_sysinfo, int, command, char __user *, buf, long, count) > "dummy", /* secure RPC domain */ > }; > unsigned long offset; > - char *res; > + const char *res; > long len, err = -EINVAL; > > offset = command-1; > -- > 1.7.3.rc1 Thanks Joe. I'll vacuum this up. Matt -- To unsubscribe from this list: send the line "unsubscribe linux-alpha" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-14 17:03 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-09-14 4:23 [PATCH next 00/16] treewide: Use static const char * const where possible Joe Perches 2010-09-14 4:23 ` [PATCH next 01/16] arch/alpha: " Joe Perches 2010-09-14 15:37 ` Richard Henderson 2010-09-14 17:03 ` Matt Turner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).