[alsa-devel] [PATCH next 00/16] 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(-)
Signed-off-by: Joe Perches joe@perches.com --- sound/core/misc.c | 5 +---- sound/core/pcm_native.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/core/misc.c b/sound/core/misc.c index 0e5e77f..2c41825 100644 --- a/sound/core/misc.c +++ b/sound/core/misc.c @@ -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; } diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index e2e7389..eb40942 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -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),
At Mon, 13 Sep 2010 21:24:02 -0700, Joe Perches wrote:
Signed-off-by: Joe Perches joe@perches.com
Applied the second chunk (as the first chunk is the revert of your previous patch).
thanks,
Takashi
sound/core/misc.c | 5 +---- sound/core/pcm_native.c | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/core/misc.c b/sound/core/misc.c index 0e5e77f..2c41825 100644 --- a/sound/core/misc.c +++ b/sound/core/misc.c @@ -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[1] = format[1];tmp[0] = '<';
tmp[2] = '>';
pfx = tmp; ret = 1; }tmp[3] = 0;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index e2e7389..eb40942 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -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), -- 1.7.3.rc1
participants (2)
-
Joe Perches
-
Takashi Iwai