treewide: Use static const char * const where possible
Subsystems (22)
cover treewide: Use static const char * const where possible
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(-)
Signature · 1 line
1.7.3.rc1
PATCH 1/16 arch/alpha: 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 ++-- 4 files changed, 46 insertions(+), 38 deletions(-)
arch/alpha/kernel/err_ev6.c +7 -5
@@ -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 ;
arch/alpha/kernel/err_marvel.c +17 -16
@@ -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)
arch/alpha/kernel/err_titan.c +20 -15
@@ -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 */
arch/alpha/kernel/osf_sys.c +2 -2
@@ -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 ;
Signature · 1 line
1.7.3.rc1
PATCH 2/16 arch/ia64: Use static const char * const where possible
In reply to Joe Perches--- arch/ia64/kernel/palinfo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/ia64/kernel/palinfo.c +1 -1
@@ -434,7 +434,7 @@ register_info(char *page)unsigned long phys_stacked;pal_hints_u_t hints;unsigned long iregs, dregs; -char *info_type[]={ +static const char *const info_type[] = {"Implemented AR(s)" ,"AR(s) with read side-effects" ,"Implemented CR(s)" ,
Signature · 1 line
1.7.3.rc1
PATCH 4/16 arch/x86: Use static const char * const where possible
In reply to Joe Perches--- arch/x86/kernel/smpboot.c | 2 +- arch/x86/kvm/mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/smpboot.c +1 -1
@@ -498,7 +498,7 @@ static void impress_friends(void)void __inquire_remote_apic (int apicid) {unsigned i, regs[] = {APIC_ID >>4 ,APIC_LVR >>4 ,APIC_SPIV >>4 }; -char *names[] = {"ID" ,"VERSION" ,"SPIV" }; +const char *const names[] = {"ID" ,"VERSION" ,"SPIV" };int timeout;u32 status;
arch/x86/kvm/mmu.c +1 -1
@@ -56,7 +56,7 @@ enum {AUDIT_POST_PTE_WRITE }; -char *audit_point_name[] = { +const char *const audit_point_name[] = {"pre page fault" ,"post page fault" ,"pre pte write" ,
Signature · 1 line
1.7.3.rc1
PATCH 6/16 drivers/isdn: Use static const char * const where possible
In reply to Joe Perches--- drivers/isdn/pcbit/edss1.c | 2 +- drivers/isdn/pcbit/edss1.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/isdn/pcbit/edss1.c +1 -1
@@ -33,7 +33,7 @@#include "callbacks.h" -char * isdn_state_table[] = { +const char *const isdn_state_table[] = {"Closed" ,"Call initiated" ,"Overlap sending" ,
drivers/isdn/pcbit/edss1.h +1 -1
@@ -90,7 +90,7 @@ struct fsm_timer_entry {unsigned long timeout;/* in seconds */ }; -extern char * isdn_state_table[]; +extern const char *const isdn_state_table[];void pcbit_fsm_event (struct pcbit_dev *,struct pcbit_chan *,unsigned short event,struct callb_data *);
Signature · 1 line
1.7.3.rc1
PATCH 7/16 drivers/net: Use static const char * const where possible
In reply to Joe Perches--- drivers/net/3c515.c | 4 +++- drivers/net/eth16i.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/3c515.c +3 -1
@@ -662,7 +662,9 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,pr_warning (" *** Warning: this IRQ is unlikely to work! ***\n" ); { -char *ram_split[] = {"5:3" ,"3:1" ,"1:1" ,"3:5" }; +static const char *const ram_split[] = { +"5:3" ,"3:1" ,"1:1" ,"3:5" + };__u32 config;EL3WINDOW (3 ); vp->available_media =inw (ioaddr + Wn3_Options);
drivers/net/eth16i.c +3 -1
@@ -637,7 +637,9 @@ static void eth16i_initialize(struct net_device *dev, int boot)/* Set interface port type */ if (boot) { -char *porttype[] = {"BNC" ,"DIX" ,"TP" ,"AUTO" ,"FROM_EPROM" }; +static const char *const porttype[] = { +"BNC" ,"DIX" ,"TP" ,"AUTO" ,"FROM_EPROM" + };switch (dev->if_port) {
Signature · 1 line
1.7.3.rc1
PATCH 9/16 drivers/net/wireless: Use static const char * const where possible
In reply to Joe Perches--- drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00debug.c +1 -1
@@ -380,7 +380,7 @@ static ssize_t rt2x00debug_read_crypto_stats(struct file *file, loff_t *offset) {struct rt2x00debug_intf *intf = file->private_data; -char *name[] = {"WEP64" ,"WEP128" ,"TKIP" ,"AES" }; +static const char *const name[] = {"WEP64" ,"WEP128" ,"TKIP" ,"AES" };char *data;char *temp;size_t size;
Signature · 1 line
1.7.3.rc1
PATCH 10/16 drivers/scsi: Use static const char * const where possible
In reply to Joe Perches--- 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 +- 4 files changed, 7 insertions(+), 5 deletions(-)
drivers/scsi/bfa/rport.c +3 -1
@@ -2068,7 +2068,9 @@ bfa_fcs_rport_aen_post(struct bfa_fcs_rport_s *rport,wwn_t rpwwn = rport->pwwn;char lpwwn_ptr[BFA_STRING_32 ];char rpwwn_ptr[BFA_STRING_32 ]; -char *prio_str[] = {"unknown" ,"high" ,"medium" ,"low" }; +static const char *const prio_str[] = { +"unknown" ,"high" ,"medium" ,"low" + };wwn2str (lpwwn_ptr, lpwwn);wwn2str (rpwwn_ptr, rpwwn);
drivers/scsi/pcmcia/nsp_debug.c +1 -1
@@ -147,7 +147,7 @@ static void show_phase(struct scsi_cmnd *SCpnt) {int i = SCpnt->SCp.phase; -char *ph[] = { +static const char *const ph[] = {"PH_UNDETERMINED" ,"PH_ARBSTART" ,"PH_SELSTART" ,
drivers/scsi/qla2xxx/qla_nx.c +2 -2
@@ -327,8 +327,8 @@ unsigned qla82xx_crb_hub_agt[64] = { };/* Device states */ -char *qdev_state[] = { -"Unknown" , +static const char *const qdev_state[] = { +"Unknown" ,"Cold" ,"Initializing" ,"Ready" ,
drivers/scsi/qla4xxx/ql4_nx.c +1 -1
@@ -332,7 +332,7 @@ static unsigned qla4_8xxx_crb_hub_agt[64] = { };/* Device states */ -static char *qdev_state[] = { +static const char *const qdev_state[] = {"Unknown" ,"Cold" ,"Initializing" ,
Signature · 1 line
1.7.3.rc1
PATCH 14/16 fs: Use static const char * const where possible
In reply to Joe Perches--- fs/binfmt_flat.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/binfmt_flat.c +3 -1
@@ -382,7 +382,9 @@ failed:void old_reloc (unsigned long rl) {#ifdef DEBUG -char *segment[] = {"TEXT" ,"DATA" ,"BSS" ,"*UNKNOWN*" }; +static const char *const segment[] = { +"TEXT" ,"DATA" ,"BSS" ,"*UNKNOWN*" + };#endif flat_v2_reloc_t r;unsigned long *ptr;
Signature · 1 line
1.7.3.rc1
PATCH 15/16 net/irda: Use static const char * const where possible
In reply to Joe Perches--- include/net/irda/irlan_event.h | 2 +- net/irda/irlan/irlan_event.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/irda/irlan_event.h +1 -1
@@ -67,7 +67,7 @@ typedef enum {IRLAN_WATCHDOG_TIMEOUT , } IRLAN_EVENT; -extern char *irlan_state[]; +extern const char *const irlan_state[];void irlan_do_client_event (struct irlan_cb *self,IRLAN_EVENT event,struct sk_buff *skb);
net/irda/irlan/irlan_event.c +1 -1
@@ -24,7 +24,7 @@#include <net/irda/irlan_event.h> -char *irlan_state[] = { +const char *const irlan_state[] = {"IRLAN_IDLE" ,"IRLAN_QUERY" ,"IRLAN_CONN" ,
Signature · 1 line
1.7.3.rc1
PATCH 16/16 sound: Use static const char * const where possible
In reply to Joe Perches--- sound/core/misc.c | 5 +---- sound/core/pcm_native.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)
sound/core/misc.c +1 -4
@@ -64,15 +64,12 @@ static int print_snd_pfx(unsigned int level, const char *path, int line, const char *format) {const char *file =sanity_file_name (path); -char tmp[sizeof ("<0>" )]; +char tmp[] ="<0>" ;const char *pfx = level ?KERN_DEBUG :KERN_DEFAULT ;int ret =0 ;if (format[0 ] =='<' && format[2 ] =='>' ) { - tmp[0 ] ='<' ; tmp[1 ] = format[1 ]; - tmp[2 ] ='>' ; - tmp[3 ] =0 ; pfx = tmp; ret =1 ; }
sound/core/pcm_native.c +1 -1
@@ -142,7 +142,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,#ifdef RULES_DEBUG #define HW_PARAM (v) [SNDRV_PCM_HW_PARAM_##v] = #v -char *snd_pcm_hw_param_names[] = { +static const char *const snd_pcm_hw_param_names[] = {HW_PARAM (ACCESS ),HW_PARAM (FORMAT ), HW_PARAM(SUBFORMAT),
Signature · 1 line
1.7.3.rc1
PATCH 5/16 drivers/gpu: Use static const char * const where possible
In reply to Joe Perches--- drivers/gpu/drm/ttm/ttm_page_alloc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +3 -1
@@ -836,7 +836,9 @@ int ttm_page_alloc_debugfs(struct seq_file *m, void *data) {struct ttm_page_pool *p;unsigned i; -char *h[] = {"pool" ,"refills" ,"pages freed" ,"size" }; +static const char *const h[] = { +"pool" ,"refills" ,"pages freed" ,"size" + };if (!_manager) {seq_printf (m,"No pool allocator running.\n" );return 0 ;
Signature · 1 line
1.7.3.rc1
PATCH 8/16 drivers/net/pcmcia: Use static const char * const where possible
In reply to Joe Perches--- drivers/net/pcmcia/3c589_cs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/pcmcia/3c589_cs.c +1 -1
@@ -266,7 +266,7 @@ static int tc589_config(struct pcmcia_device *link)__be16 *phys_addr;int ret, i, j, multi =0 , fifo;unsigned int ioaddr; -char *ram_split[] = {"5:3" ,"3:1" ,"1:1" ,"3:5" }; +static const char *const ram_split[] = {"5:3" ,"3:1" ,"1:1" ,"3:5" };u8 *buf;size_t len;
Signature · 1 line
1.7.3.rc1
PATCH 13/16 drivers/watchdog: Use static const char * const where possible
In reply to Joe Perches--- drivers/watchdog/machzwd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/watchdog/machzwd.c +1 -1
@@ -388,7 +388,7 @@ static struct notifier_block zf_notifier = {static void __init zf_show_action (int act) { -char *str[] = {"RESET" ,"SMI" ,"NMI" ,"SCI" }; +static const char *const str[] = {"RESET" ,"SMI" ,"NMI" ,"SCI" }; printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]); }
Signature · 1 line
1.7.3.rc1
PATCH 3/16 arch/microblaze: Use static const char * const where possible
In reply to Joe Perches--- arch/microblaze/kernel/heartbeat.c | 10 +++++----- arch/microblaze/kernel/timer.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-)
arch/microblaze/kernel/heartbeat.c +5 -5
@@ -47,11 +47,11 @@ void setup_heartbeat(void)struct device_node *gpio =NULL ;int *prop;int j; -char *gpio_list[] = { -"xlnx,xps-gpio-1.00.a" , -"xlnx,opb-gpio-1.00.a" , -NULL - }; +const char *const gpio_list[] = { +"xlnx,xps-gpio-1.00.a" , +"xlnx,opb-gpio-1.00.a" , +NULL + };for (j =0 ; gpio_list[j] !=NULL ; j++) { gpio =of_find_compatible_node (NULL ,NULL , gpio_list[j]);
arch/microblaze/kernel/timer.c +6 -6
@@ -258,12 +258,12 @@ void __init time_init(void)0 };#endif -char *timer_list[] = { -"xlnx,xps-timer-1.00.a" , -"xlnx,opb-timer-1.00.b" , -"xlnx,opb-timer-1.00.a" , -NULL - }; +const char *const timer_list[] = { +"xlnx,xps-timer-1.00.a" , +"xlnx,opb-timer-1.00.b" , +"xlnx,opb-timer-1.00.a" , +NULL + };for (i =0 ; timer_list[i] !=NULL ; i++) { timer =of_find_compatible_node (NULL ,NULL , timer_list[i]);
Signature · 1 line
1.7.3.rc1
PATCH 11/16 drivers/staging: Use static const char * const where possible
In reply to Joe Perches--- drivers/staging/ath6kl/os/linux/ar6000_drv.c | 14 +++++++------- drivers/staging/bcm/Debug.c | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-)
drivers/staging/ath6kl/os/linux/ar6000_drv.c +7 -7
@@ -5079,13 +5079,13 @@ ar6000_hbChallengeResp_event(AR_SOFTC_T *ar, A_UINT32 cookie, A_UINT32 source)void ar6000_reportError_event (AR_SOFTC_T *ar,WMI_TARGET_ERROR_VAL errorVal) { -char *errString[] = { - [WMI_TARGET_PM_ERR_FAIL] "WMI_TARGET_PM_ERR_FAIL", - [WMI_TARGET_KEY_NOT_FOUND] "WMI_TARGET_KEY_NOT_FOUND", - [WMI_TARGET_DECRYPTION_ERR] "WMI_TARGET_DECRYPTION_ERR", - [WMI_TARGET_BMISS] "WMI_TARGET_BMISS", - [WMI_PSDISABLE_NODE_JOIN] "WMI_PSDISABLE_NODE_JOIN" - }; +static const char *const errString[] = { + [WMI_TARGET_PM_ERR_FAIL] "WMI_TARGET_PM_ERR_FAIL", + [WMI_TARGET_KEY_NOT_FOUND] "WMI_TARGET_KEY_NOT_FOUND", + [WMI_TARGET_DECRYPTION_ERR] "WMI_TARGET_DECRYPTION_ERR", + [WMI_TARGET_BMISS] "WMI_TARGET_BMISS", + [WMI_PSDISABLE_NODE_JOIN] "WMI_PSDISABLE_NODE_JOIN" + };A_PRINTF ("AR6000 Error on Target. Error = 0x%x\n" , errorVal);
drivers/staging/bcm/Debug.c +3 -2
@@ -1,12 +1,13 @@#include "headers.h" -char *buff_dump_base[]={"DEC" ,"HEX" ,"OCT" ,"BIN" }; -static UINT current_debug_level=BCM_SCREAM ;int bcm_print_buffer (UINT debug_level,const char *function_name,char *file_name,int line_number,unsigned char *buffer,int bufferlen,unsigned int base) { +static const char *const buff_dump_base[] = { +"DEC" ,"HEX" ,"OCT" ,"BIN" + };if (debug_level>=current_debug_level) {int i=0 ;
Signature · 1 line
1.7.3.rc1
PATCH 12/16 drivers/usb: Use static const char * const where possible
In reply to Joe Perches--- drivers/usb/host/oxu210hp-hcd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/usb/host/oxu210hp-hcd.c +1 -1
@@ -3687,7 +3687,7 @@ static void oxu_configuration(struct platform_device *pdev, void *base)static int oxu_verify_id (struct platform_device *pdev,void *base) {u32 id; -char *bo[] = { +static const char *const bo[] = {"reserved" ,"128-pin LQFP" ,"84-pin TFBGA" ,
Signature · 1 line
1.7.3.rc1
Re: [PATCH next 03/16] arch/microblaze: Use static const char * const where possible
In reply to Joe PerchesQuoted 6 lines · Joe Perches
Signed-off-by Joe Perches <[email protected]>--- arch/microblaze/kernel/heartbeat.c | 10 +++++----- arch/microblaze/kernel/timer.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-)
Applied.
Thanks,
Michal
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
Re: [PATCH next 09/16] drivers/net/wireless: Use static const char * const where possible
In reply to Joe PerchesQuoted 1 line · Joe Perches
Signed-off-by Joe Perches <[email protected]>
Quoted 21 lines
---
drivers/net/wireless/rt2x00/rt2x00debug.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/wireless/rt2x00/rt2x00debug.c +1
-2@@ -380,7 +380,7 @@ static ssize_t rt2x00debug_read_crypto_stats(struct file *file, loff_t *offset) { struct rt2x00debug_intf *intf = file->private_data; - char *name[] = { "WEP64", "WEP128", "TKIP", "AES" }; + static const char * const name[] = { "WEP64", "WEP128", "TKIP", "AES" }; char *data; char *temp; size_t size; --1.7.3.rc1
Re: [PATCH next 16/16] sound: Use static const char * const where possible
In reply to Joe PerchesAt Mon, 13 Sep 2010 21:24:02 -0700,
Quoted 2 lines · Joe Perches
Signed-off-by Joe Perches <[email protected]>
Applied the second chunk (as the first chunk is the revert of your previous patch).
thanks,
Takashi
Quoted 42 lines
--- sound/core/misc.c | 5 +---- sound/core/pcm_native.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)sound/core/misc.c +1
-4@@ -64,15 +64,12 @@ static int print_snd_pfx(unsigned int level, const char *path, int line, const char *format) {const char *file =sanity_file_name (path); -char tmp[sizeof ("<0>" )]; +char tmp[] ="<0>" ;const char *pfx = level ?KERN_DEBUG :KERN_DEFAULT ;int ret =0 ;if (format[0 ] =='<' && format[2 ] =='>' ) { - tmp[0 ] ='<' ; tmp[1 ] = format[1 ]; - tmp[2 ] ='>' ; - tmp[3 ] =0 ; pfx = tmp; ret =1 ; }sound/core/pcm_native.c +1
-1@@ -142,7 +142,7 @@ int snd_pcm_info_user(struct snd_pcm_substream *substream,#ifdef RULES_DEBUG #define HW_PARAM (v) [SNDRV_PCM_HW_PARAM_##v] = #v -char *snd_pcm_hw_param_names[] = { +static const char *const snd_pcm_hw_param_names[] = {HW_PARAM (ACCESS ),HW_PARAM (FORMAT ), HW_PARAM(SUBFORMAT),Signature · 1 line
1.7.3.rc1
Re: [PATCH next 01/16] arch/alpha: Use static const char * const where possible
In reply to Joe PerchesQuoted 7 lines · Joe Perches
Signed-off-by Joe Perches <[email protected]>--- 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(-)
r~
Matt Turner
maintainerRe: [PATCH next 01/16] arch/alpha: Use static const char * const where possible
In reply to Joe PerchesQuoted 156 lines · Joe Perches
Signed-off-by Joe Perches <[email protected]>---
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(-)arch/alpha/kernel/err_ev6.c +7
-5@@ -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;arch/alpha/kernel/err_marvel.c +0
-0@@ -589,22 +589,23 @@ marvel_print_pox_spl_cmplt(u64 spl_cmplt)static void
marvel_print_pox_trans_sum(u64trans_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)arch/alpha/kernel/err_titan.c +20
-15@@ -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 */arch/alpha/kernel/osf_sys.c +1
-1@@ -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;
Quoted 3 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html