All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/25] treewide-next: Use static const char arrays
@ 2010-09-13 19:47 ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ralf Baechle, Benjamin Herrenschmidt, Paul Mackerras, Len Brown,
	Linus Walleij, Jean Delvare (PC drivers, core),
	Ben Dooks (embedded platforms),
	Karsten Keil, Mauro Carvalho Chehab, Jeff Kirsher,
	Jesse Brandeburg, Bruce Allan, Alex Duyck, PJ Waskiewicz,
	John Ronciak, Amit Kumar Salecha, Anirban Chakraborty,
	linux-driver

Using static const char foo[] = "bar" can save some
code and text space, so change the places where it's possible.

Also change the places that use
	char foo[] = "barX";
	...
	foo[3] = value + '0';
where X is typically changed
	char foo[sizeof("barX")];
	...
	sprintf(foo, "bar%c", value + '0');

Joe Perches (25):
  arch/mips: Use static const char arrays
  arch/powerpc: Use static const char arrays
  drivers/acpi: Use static const char arrays
  drivers/char: Use static const char arrays
  drivers/i2c: Use static const char arrays
  drivers/isdn: Use static const char arrays
  drivers/media: Use static const char arrays
  drivers/net/atl1c: Use static const char arrays
  drivers/net/atl1e: Use static const char arrays
  drivers/net/(intel): Use static const char arrays
  drivers/net/netxen: Use static const char arrays
  drivers/net/qlcnic: Use static const char arrays
  drivers/net/spider_net.c: Use static const char arrays
  drivers/net/vnxnet3: Use static const char arrays
  drivers/net/wireless/ipw2x00: Use static const char arrays
  drivers/s390/char: Use static const char arrays
  drivers/scsi: Use static const char arrays
  drivers/serial/suncore.c: Use static const char arrays
  drivers/staging: Use static const char arrays
  drivers/usb: Use static const char arrays
  drivers/video: Use static const char arrays
  net/dsa: Use static const char arrays
  net/sunrpc: Use static const char arrays
  sound: Use static const char arrays
  tools/perf/util: Use static const char arrays

 arch/mips/pnx8550/common/reset.c                   |    4 ++--
 arch/powerpc/boot/addnote.c                        |    4 ++--
 arch/powerpc/boot/cuboot-c2k.c                     |    4 ++--
 arch/powerpc/kernel/irq.c                          |    2 +-
 drivers/acpi/sleep.c                               |    4 ++--
 drivers/char/hvc_vio.c                             |    2 +-
 drivers/i2c/busses/i2c-stu300.c                    |    4 ++--
 drivers/isdn/hysdn/hycapi.c                        |    2 +-
 drivers/isdn/mISDN/dsp_cmx.c                       |    2 +-
 drivers/media/video/zoran/zoran_device.c           |    5 ++---
 drivers/net/atl1c/atl1c.h                          |    4 ++--
 drivers/net/atl1c/atl1c_main.c                     |    4 ++--
 drivers/net/atl1e/atl1e.h                          |    4 ++--
 drivers/net/atl1e/atl1e_main.c                     |    4 ++--
 drivers/net/e1000/e1000.h                          |    2 +-
 drivers/net/e1000/e1000_main.c                     |    4 ++--
 drivers/net/e1000e/e1000.h                         |    2 +-
 drivers/net/e1000e/netdev.c                        |    2 +-
 drivers/net/igb/igb.h                              |    4 ++--
 drivers/net/igb/igb_main.c                         |    4 ++--
 drivers/net/igbvf/igbvf.h                          |    2 +-
 drivers/net/igbvf/netdev.c                         |    2 +-
 drivers/net/ixgb/ixgb.h                            |    2 +-
 drivers/net/ixgb/ixgb_main.c                       |    2 +-
 drivers/net/ixgbe/ixgbe.h                          |    2 +-
 drivers/net/ixgbe/ixgbe_main.c                     |    4 ++--
 drivers/net/ixgbevf/ixgbevf.h                      |    2 +-
 drivers/net/ixgbevf/ixgbevf_main.c                 |    2 +-
 drivers/net/netxen/netxen_nic.h                    |    2 +-
 drivers/net/netxen/netxen_nic_main.c               |    2 +-
 drivers/net/qlcnic/qlcnic.h                        |    2 +-
 drivers/net/qlcnic/qlcnic_main.c                   |    2 +-
 drivers/net/spider_net.c                           |    2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c                  |    2 +-
 drivers/net/vmxnet3/vmxnet3_int.h                  |    2 +-
 drivers/net/wireless/ipw2x00/ipw2100.c             |    2 +-
 drivers/net/wireless/ipw2x00/ipw2200.c             |    2 +-
 drivers/net/wireless/ipw2x00/libipw_module.c       |    2 +-
 drivers/s390/char/vmlogrdr.c                       |    4 ++--
 drivers/scsi/bnx2i/bnx2i_hwi.c                     |    6 +++---
 drivers/scsi/lpfc/lpfc_init.c                      |    2 +-
 drivers/scsi/megaraid/megaraid_mbox.c              |    6 +++---
 drivers/serial/suncore.c                           |    4 ++--
 drivers/staging/brcm80211/util/bcmutils.c          |    2 +-
 drivers/staging/comedi/drivers/comedi_bond.c       |    2 +-
 drivers/staging/cxt1e1/ossiRelease.c               |    2 +-
 drivers/staging/go7007/go7007-driver.c             |    2 +-
 drivers/staging/msm/mdp.c                          |    2 +-
 .../staging/rtl8192e/ieee80211/ieee80211_module.c  |    2 +-
 .../staging/rtl8192u/ieee80211/ieee80211_module.c  |    2 +-
 drivers/staging/tidspbridge/rmgr/dbdcd.c           |    6 +++---
 drivers/usb/atm/ueagle-atm.c                       |   14 +++++---------
 drivers/usb/otg/langwell_otg.c                     |    2 +-
 drivers/video/sh_mipi_dsi.c                        |    4 ++--
 drivers/video/sis/sis_main.c                       |   10 +++++-----
 drivers/video/via/viafbdev.c                       |    2 +-
 net/dsa/dsa.c                                      |    2 +-
 net/dsa/dsa_priv.h                                 |    2 +-
 net/sunrpc/auth_gss/gss_krb5_mech.c                |    2 +-
 sound/core/misc.c                                  |    5 ++++-
 tools/perf/util/ui/setup.c                         |    3 ++-
 tools/perf/util/ui/util.c                          |    3 ++-
 62 files changed, 98 insertions(+), 98 deletions(-)

-- 
1.7.3.rc1

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 00/25] treewide-next: Use static const char arrays
@ 2010-09-13 19:47 ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ralf Baechle, Benjamin Herrenschmidt, Paul Mackerras, Len Brown,
	Linus Walleij, Jean Delvare (PC drivers, core),
	Ben Dooks (embedded platforms),
	Karsten Keil, Mauro Carvalho Chehab, Jeff Kirsher,
	Jesse Brandeburg, Bruce Allan, Alex Duyck, PJ Waskiewicz,
	John Ronciak, Amit Kumar Salecha, Anirban Chakraborty,
	linux-driver, Ishizaki Kou, Jens Osterkamp, Shreyas Bhatewara,
	VMware, Inc.,
	John W. Linville, Martin Schwidefsky, Heiko Carstens, linux390,
	James E.J. Bottomley, James Smart, Neela Syam Kolli,
	David S. Miller, Brett Rudley, Henry Ptasinski, Nohee Ko,
	Greg Kroah-Hartman, Thomas Winischhofer, Joseph Chan,
	Florian Tobias Schandinat, J. Bruce Fields, Neil Brown,
	Trond Myklebust, Jaroslav Kysela, Takashi Iwai, Peter Zijlstra,
	Ingo Molnar, Arnaldo Carvalho de Melo, linux-mips, linuxppc-dev,
	linux-acpi, linux-arm-kernel, linux-i2c, netdev, mjpeg-users,
	linux-media, e1000-devel, linux-wireless, linux-s390, linux-scsi,
	sparclinux, devel, linux-usb, linux-fbdev, linux-nfs, alsa-devel

Using static const char foo[] = "bar" can save some
code and text space, so change the places where it's possible.

Also change the places that use
	char foo[] = "barX";
	...
	foo[3] = value + '0';
where X is typically changed
	char foo[sizeof("barX")];
	...
	sprintf(foo, "bar%c", value + '0');

Joe Perches (25):
  arch/mips: Use static const char arrays
  arch/powerpc: Use static const char arrays
  drivers/acpi: Use static const char arrays
  drivers/char: Use static const char arrays
  drivers/i2c: Use static const char arrays
  drivers/isdn: Use static const char arrays
  drivers/media: Use static const char arrays
  drivers/net/atl1c: Use static const char arrays
  drivers/net/atl1e: Use static const char arrays
  drivers/net/(intel): Use static const char arrays
  drivers/net/netxen: Use static const char arrays
  drivers/net/qlcnic: Use static const char arrays
  drivers/net/spider_net.c: Use static const char arrays
  drivers/net/vnxnet3: Use static const char arrays
  drivers/net/wireless/ipw2x00: Use static const char arrays
  drivers/s390/char: Use static const char arrays
  drivers/scsi: Use static const char arrays
  drivers/serial/suncore.c: Use static const char arrays
  drivers/staging: Use static const char arrays
  drivers/usb: Use static const char arrays
  drivers/video: Use static const char arrays
  net/dsa: Use static const char arrays
  net/sunrpc: Use static const char arrays
  sound: Use static const char arrays
  tools/perf/util: Use static const char arrays

 arch/mips/pnx8550/common/reset.c                   |    4 ++--
 arch/powerpc/boot/addnote.c                        |    4 ++--
 arch/powerpc/boot/cuboot-c2k.c                     |    4 ++--
 arch/powerpc/kernel/irq.c                          |    2 +-
 drivers/acpi/sleep.c                               |    4 ++--
 drivers/char/hvc_vio.c                             |    2 +-
 drivers/i2c/busses/i2c-stu300.c                    |    4 ++--
 drivers/isdn/hysdn/hycapi.c                        |    2 +-
 drivers/isdn/mISDN/dsp_cmx.c                       |    2 +-
 drivers/media/video/zoran/zoran_device.c           |    5 ++---
 drivers/net/atl1c/atl1c.h                          |    4 ++--
 drivers/net/atl1c/atl1c_main.c                     |    4 ++--
 drivers/net/atl1e/atl1e.h                          |    4 ++--
 drivers/net/atl1e/atl1e_main.c                     |    4 ++--
 drivers/net/e1000/e1000.h                          |    2 +-
 drivers/net/e1000/e1000_main.c                     |    4 ++--
 drivers/net/e1000e/e1000.h                         |    2 +-
 drivers/net/e1000e/netdev.c                        |    2 +-
 drivers/net/igb/igb.h                              |    4 ++--
 drivers/net/igb/igb_main.c                         |    4 ++--
 drivers/net/igbvf/igbvf.h                          |    2 +-
 drivers/net/igbvf/netdev.c                         |    2 +-
 drivers/net/ixgb/ixgb.h                            |    2 +-
 drivers/net/ixgb/ixgb_main.c                       |    2 +-
 drivers/net/ixgbe/ixgbe.h                          |    2 +-
 drivers/net/ixgbe/ixgbe_main.c                     |    4 ++--
 drivers/net/ixgbevf/ixgbevf.h                      |    2 +-
 drivers/net/ixgbevf/ixgbevf_main.c                 |    2 +-
 drivers/net/netxen/netxen_nic.h                    |    2 +-
 drivers/net/netxen/netxen_nic_main.c               |    2 +-
 drivers/net/qlcnic/qlcnic.h                        |    2 +-
 drivers/net/qlcnic/qlcnic_main.c                   |    2 +-
 drivers/net/spider_net.c                           |    2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c                  |    2 +-
 drivers/net/vmxnet3/vmxnet3_int.h                  |    2 +-
 drivers/net/wireless/ipw2x00/ipw2100.c             |    2 +-
 drivers/net/wireless/ipw2x00/ipw2200.c             |    2 +-
 drivers/net/wireless/ipw2x00/libipw_module.c       |    2 +-
 drivers/s390/char/vmlogrdr.c                       |    4 ++--
 drivers/scsi/bnx2i/bnx2i_hwi.c                     |    6 +++---
 drivers/scsi/lpfc/lpfc_init.c                      |    2 +-
 drivers/scsi/megaraid/megaraid_mbox.c              |    6 +++---
 drivers/serial/suncore.c                           |    4 ++--
 drivers/staging/brcm80211/util/bcmutils.c          |    2 +-
 drivers/staging/comedi/drivers/comedi_bond.c       |    2 +-
 drivers/staging/cxt1e1/ossiRelease.c               |    2 +-
 drivers/staging/go7007/go7007-driver.c             |    2 +-
 drivers/staging/msm/mdp.c                          |    2 +-
 .../staging/rtl8192e/ieee80211/ieee80211_module.c  |    2 +-
 .../staging/rtl8192u/ieee80211/ieee80211_module.c  |    2 +-
 drivers/staging/tidspbridge/rmgr/dbdcd.c           |    6 +++---
 drivers/usb/atm/ueagle-atm.c                       |   14 +++++---------
 drivers/usb/otg/langwell_otg.c                     |    2 +-
 drivers/video/sh_mipi_dsi.c                        |    4 ++--
 drivers/video/sis/sis_main.c                       |   10 +++++-----
 drivers/video/via/viafbdev.c                       |    2 +-
 net/dsa/dsa.c                                      |    2 +-
 net/dsa/dsa_priv.h                                 |    2 +-
 net/sunrpc/auth_gss/gss_krb5_mech.c                |    2 +-
 sound/core/misc.c                                  |    5 ++++-
 tools/perf/util/ui/setup.c                         |    3 ++-
 tools/perf/util/ui/util.c                          |    3 ++-
 62 files changed, 98 insertions(+), 98 deletions(-)

-- 
1.7.3.rc1

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 00/25] treewide-next: Use static const char arrays
@ 2010-09-13 19:47 ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Amit Kumar Salecha, linux-fbdev, Greg Kroah-Hartman, James Smart,
	linux-mips, VMware, Inc.,
	PJ Waskiewicz, Shreyas Bhatewara, alsa-devel, Jaroslav Kysela,
	J. Bruce Fields, James E.J. Bottomley, Paul Mackerras, linux-i2c,
	Brett Rudley, sparclinux, Martin Schwidefsky, devel, linux-s390,
	linux-acpi, linux-scsi, Florian Tobias Schandinat, e1000-devel,
	Trond Myklebust, Jesse Brandeburg, Neil Brown, Jeff Kirsher,
	linux-wireless, Ingo Molnar, linux-usb, Len Brown, Alex Duyck,
	Peter Zijlstra, Henry Ptasinski, Heiko Carstens,
	Thomas Winischhofer, Mauro Carvalho Chehab,
	Arnaldo Carvalho de Melo, Jean Delvare (PC drivers, core),
	mjpeg-users, Ben Dooks (embedded platforms),
	linux-nfs, linux-arm-kernel, Neela Syam Kolli, Karsten Keil,
	Linus Walleij, netdev, Anirban Chakraborty, Bruce Allan,
	Nohee Ko, Ralf Baechle, Joseph Chan, John Ronciak, Takashi Iwai,
	linux-driver, linux390, linux-media, linuxppc-dev,
	David S. Miller

Using static const char foo[] = "bar" can save some
code and text space, so change the places where it's possible.

Also change the places that use
	char foo[] = "barX";
	...
	foo[3] = value + '0';
where X is typically changed
	char foo[sizeof("barX")];
	...
	sprintf(foo, "bar%c", value + '0');

Joe Perches (25):
  arch/mips: Use static const char arrays
  arch/powerpc: Use static const char arrays
  drivers/acpi: Use static const char arrays
  drivers/char: Use static const char arrays
  drivers/i2c: Use static const char arrays
  drivers/isdn: Use static const char arrays
  drivers/media: Use static const char arrays
  drivers/net/atl1c: Use static const char arrays
  drivers/net/atl1e: Use static const char arrays
  drivers/net/(intel): Use static const char arrays
  drivers/net/netxen: Use static const char arrays
  drivers/net/qlcnic: Use static const char arrays
  drivers/net/spider_net.c: Use static const char arrays
  drivers/net/vnxnet3: Use static const char arrays
  drivers/net/wireless/ipw2x00: Use static const char arrays
  drivers/s390/char: Use static const char arrays
  drivers/scsi: Use static const char arrays
  drivers/serial/suncore.c: Use static const char arrays
  drivers/staging: Use static const char arrays
  drivers/usb: Use static const char arrays
  drivers/video: Use static const char arrays
  net/dsa: Use static const char arrays
  net/sunrpc: Use static const char arrays
  sound: Use static const char arrays
  tools/perf/util: Use static const char arrays

 arch/mips/pnx8550/common/reset.c                   |    4 ++--
 arch/powerpc/boot/addnote.c                        |    4 ++--
 arch/powerpc/boot/cuboot-c2k.c                     |    4 ++--
 arch/powerpc/kernel/irq.c                          |    2 +-
 drivers/acpi/sleep.c                               |    4 ++--
 drivers/char/hvc_vio.c                             |    2 +-
 drivers/i2c/busses/i2c-stu300.c                    |    4 ++--
 drivers/isdn/hysdn/hycapi.c                        |    2 +-
 drivers/isdn/mISDN/dsp_cmx.c                       |    2 +-
 drivers/media/video/zoran/zoran_device.c           |    5 ++---
 drivers/net/atl1c/atl1c.h                          |    4 ++--
 drivers/net/atl1c/atl1c_main.c                     |    4 ++--
 drivers/net/atl1e/atl1e.h                          |    4 ++--
 drivers/net/atl1e/atl1e_main.c                     |    4 ++--
 drivers/net/e1000/e1000.h                          |    2 +-
 drivers/net/e1000/e1000_main.c                     |    4 ++--
 drivers/net/e1000e/e1000.h                         |    2 +-
 drivers/net/e1000e/netdev.c                        |    2 +-
 drivers/net/igb/igb.h                              |    4 ++--
 drivers/net/igb/igb_main.c                         |    4 ++--
 drivers/net/igbvf/igbvf.h                          |    2 +-
 drivers/net/igbvf/netdev.c                         |    2 +-
 drivers/net/ixgb/ixgb.h                            |    2 +-
 drivers/net/ixgb/ixgb_main.c                       |    2 +-
 drivers/net/ixgbe/ixgbe.h                          |    2 +-
 drivers/net/ixgbe/ixgbe_main.c                     |    4 ++--
 drivers/net/ixgbevf/ixgbevf.h                      |    2 +-
 drivers/net/ixgbevf/ixgbevf_main.c                 |    2 +-
 drivers/net/netxen/netxen_nic.h                    |    2 +-
 drivers/net/netxen/netxen_nic_main.c               |    2 +-
 drivers/net/qlcnic/qlcnic.h                        |    2 +-
 drivers/net/qlcnic/qlcnic_main.c                   |    2 +-
 drivers/net/spider_net.c                           |    2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c                  |    2 +-
 drivers/net/vmxnet3/vmxnet3_int.h                  |    2 +-
 drivers/net/wireless/ipw2x00/ipw2100.c             |    2 +-
 drivers/net/wireless/ipw2x00/ipw2200.c             |    2 +-
 drivers/net/wireless/ipw2x00/libipw_module.c       |    2 +-
 drivers/s390/char/vmlogrdr.c                       |    4 ++--
 drivers/scsi/bnx2i/bnx2i_hwi.c                     |    6 +++---
 drivers/scsi/lpfc/lpfc_init.c                      |    2 +-
 drivers/scsi/megaraid/megaraid_mbox.c              |    6 +++---
 drivers/serial/suncore.c                           |    4 ++--
 drivers/staging/brcm80211/util/bcmutils.c          |    2 +-
 drivers/staging/comedi/drivers/comedi_bond.c       |    2 +-
 drivers/staging/cxt1e1/ossiRelease.c               |    2 +-
 drivers/staging/go7007/go7007-driver.c             |    2 +-
 drivers/staging/msm/mdp.c                          |    2 +-
 .../staging/rtl8192e/ieee80211/ieee80211_module.c  |    2 +-
 .../staging/rtl8192u/ieee80211/ieee80211_module.c  |    2 +-
 drivers/staging/tidspbridge/rmgr/dbdcd.c           |    6 +++---
 drivers/usb/atm/ueagle-atm.c                       |   14 +++++---------
 drivers/usb/otg/langwell_otg.c                     |    2 +-
 drivers/video/sh_mipi_dsi.c                        |    4 ++--
 drivers/video/sis/sis_main.c                       |   10 +++++-----
 drivers/video/via/viafbdev.c                       |    2 +-
 net/dsa/dsa.c                                      |    2 +-
 net/dsa/dsa_priv.h                                 |    2 +-
 net/sunrpc/auth_gss/gss_krb5_mech.c                |    2 +-
 sound/core/misc.c                                  |    5 ++++-
 tools/perf/util/ui/setup.c                         |    3 ++-
 tools/perf/util/ui/util.c                          |    3 ++-
 62 files changed, 98 insertions(+), 98 deletions(-)

-- 
1.7.3.rc1

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 00/25] treewide-next: Use static const char arrays
@ 2010-09-13 19:47 ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-arm-kernel

Using static const char foo[] = "bar" can save some
code and text space, so change the places where it's possible.

Also change the places that use
	char foo[] = "barX";
	...
	foo[3] = value + '0';
where X is typically changed
	char foo[sizeof("barX")];
	...
	sprintf(foo, "bar%c", value + '0');

Joe Perches (25):
  arch/mips: Use static const char arrays
  arch/powerpc: Use static const char arrays
  drivers/acpi: Use static const char arrays
  drivers/char: Use static const char arrays
  drivers/i2c: Use static const char arrays
  drivers/isdn: Use static const char arrays
  drivers/media: Use static const char arrays
  drivers/net/atl1c: Use static const char arrays
  drivers/net/atl1e: Use static const char arrays
  drivers/net/(intel): Use static const char arrays
  drivers/net/netxen: Use static const char arrays
  drivers/net/qlcnic: Use static const char arrays
  drivers/net/spider_net.c: Use static const char arrays
  drivers/net/vnxnet3: Use static const char arrays
  drivers/net/wireless/ipw2x00: Use static const char arrays
  drivers/s390/char: Use static const char arrays
  drivers/scsi: Use static const char arrays
  drivers/serial/suncore.c: Use static const char arrays
  drivers/staging: Use static const char arrays
  drivers/usb: Use static const char arrays
  drivers/video: Use static const char arrays
  net/dsa: Use static const char arrays
  net/sunrpc: Use static const char arrays
  sound: Use static const char arrays
  tools/perf/util: Use static const char arrays

 arch/mips/pnx8550/common/reset.c                   |    4 ++--
 arch/powerpc/boot/addnote.c                        |    4 ++--
 arch/powerpc/boot/cuboot-c2k.c                     |    4 ++--
 arch/powerpc/kernel/irq.c                          |    2 +-
 drivers/acpi/sleep.c                               |    4 ++--
 drivers/char/hvc_vio.c                             |    2 +-
 drivers/i2c/busses/i2c-stu300.c                    |    4 ++--
 drivers/isdn/hysdn/hycapi.c                        |    2 +-
 drivers/isdn/mISDN/dsp_cmx.c                       |    2 +-
 drivers/media/video/zoran/zoran_device.c           |    5 ++---
 drivers/net/atl1c/atl1c.h                          |    4 ++--
 drivers/net/atl1c/atl1c_main.c                     |    4 ++--
 drivers/net/atl1e/atl1e.h                          |    4 ++--
 drivers/net/atl1e/atl1e_main.c                     |    4 ++--
 drivers/net/e1000/e1000.h                          |    2 +-
 drivers/net/e1000/e1000_main.c                     |    4 ++--
 drivers/net/e1000e/e1000.h                         |    2 +-
 drivers/net/e1000e/netdev.c                        |    2 +-
 drivers/net/igb/igb.h                              |    4 ++--
 drivers/net/igb/igb_main.c                         |    4 ++--
 drivers/net/igbvf/igbvf.h                          |    2 +-
 drivers/net/igbvf/netdev.c                         |    2 +-
 drivers/net/ixgb/ixgb.h                            |    2 +-
 drivers/net/ixgb/ixgb_main.c                       |    2 +-
 drivers/net/ixgbe/ixgbe.h                          |    2 +-
 drivers/net/ixgbe/ixgbe_main.c                     |    4 ++--
 drivers/net/ixgbevf/ixgbevf.h                      |    2 +-
 drivers/net/ixgbevf/ixgbevf_main.c                 |    2 +-
 drivers/net/netxen/netxen_nic.h                    |    2 +-
 drivers/net/netxen/netxen_nic_main.c               |    2 +-
 drivers/net/qlcnic/qlcnic.h                        |    2 +-
 drivers/net/qlcnic/qlcnic_main.c                   |    2 +-
 drivers/net/spider_net.c                           |    2 +-
 drivers/net/vmxnet3/vmxnet3_drv.c                  |    2 +-
 drivers/net/vmxnet3/vmxnet3_int.h                  |    2 +-
 drivers/net/wireless/ipw2x00/ipw2100.c             |    2 +-
 drivers/net/wireless/ipw2x00/ipw2200.c             |    2 +-
 drivers/net/wireless/ipw2x00/libipw_module.c       |    2 +-
 drivers/s390/char/vmlogrdr.c                       |    4 ++--
 drivers/scsi/bnx2i/bnx2i_hwi.c                     |    6 +++---
 drivers/scsi/lpfc/lpfc_init.c                      |    2 +-
 drivers/scsi/megaraid/megaraid_mbox.c              |    6 +++---
 drivers/serial/suncore.c                           |    4 ++--
 drivers/staging/brcm80211/util/bcmutils.c          |    2 +-
 drivers/staging/comedi/drivers/comedi_bond.c       |    2 +-
 drivers/staging/cxt1e1/ossiRelease.c               |    2 +-
 drivers/staging/go7007/go7007-driver.c             |    2 +-
 drivers/staging/msm/mdp.c                          |    2 +-
 .../staging/rtl8192e/ieee80211/ieee80211_module.c  |    2 +-
 .../staging/rtl8192u/ieee80211/ieee80211_module.c  |    2 +-
 drivers/staging/tidspbridge/rmgr/dbdcd.c           |    6 +++---
 drivers/usb/atm/ueagle-atm.c                       |   14 +++++---------
 drivers/usb/otg/langwell_otg.c                     |    2 +-
 drivers/video/sh_mipi_dsi.c                        |    4 ++--
 drivers/video/sis/sis_main.c                       |   10 +++++-----
 drivers/video/via/viafbdev.c                       |    2 +-
 net/dsa/dsa.c                                      |    2 +-
 net/dsa/dsa_priv.h                                 |    2 +-
 net/sunrpc/auth_gss/gss_krb5_mech.c                |    2 +-
 sound/core/misc.c                                  |    5 ++++-
 tools/perf/util/ui/setup.c                         |    3 ++-
 tools/perf/util/ui/util.c                          |    3 ++-
 62 files changed, 98 insertions(+), 98 deletions(-)

-- 
1.7.3.rc1

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 01/25] arch/mips: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (2 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  2010-09-18 22:54   ` Ralf Baechle
  -1 siblings, 1 reply; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ralf Baechle, linux-mips

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/mips/pnx8550/common/reset.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/pnx8550/common/reset.c b/arch/mips/pnx8550/common/reset.c
index fadd874..e0ac0b2 100644
--- a/arch/mips/pnx8550/common/reset.c
+++ b/arch/mips/pnx8550/common/reset.c
@@ -27,8 +27,8 @@
 
 void pnx8550_machine_restart(char *command)
 {
-	char head[] = "************* Machine restart *************";
-	char foot[] = "*******************************************";
+	static const char head[] = "************* Machine restart *************";
+	static const char foot[] = "*******************************************";
 
 	printk("\n\n");
 	printk("%s\n", head);
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 02/25] arch/powerpc: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
@ 2010-09-13 19:47   ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/boot/addnote.c    |    4 ++--
 arch/powerpc/boot/cuboot-c2k.c |    4 ++--
 arch/powerpc/kernel/irq.c      |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c
index b1e5611..349b553 100644
--- a/arch/powerpc/boot/addnote.c
+++ b/arch/powerpc/boot/addnote.c
@@ -20,7 +20,7 @@
 #include <string.h>
 
 /* CHRP note section */
-char arch[] = "PowerPC";
+static const char arch[] = "PowerPC";
 
 #define N_DESCR	6
 unsigned int descr[N_DESCR] = {
@@ -33,7 +33,7 @@ unsigned int descr[N_DESCR] = {
 };
 
 /* RPA note section */
-char rpaname[] = "IBM,RPA-Client-Config";
+static const char rpaname[] = "IBM,RPA-Client-Config";
 
 /*
  * Note: setting ignore_my_client_config *should* mean that OF ignores
diff --git a/arch/powerpc/boot/cuboot-c2k.c b/arch/powerpc/boot/cuboot-c2k.c
index e435949..030d7db 100644
--- a/arch/powerpc/boot/cuboot-c2k.c
+++ b/arch/powerpc/boot/cuboot-c2k.c
@@ -62,9 +62,9 @@ static void c2k_bridge_setup(u32 mem_size)
 	/* Get the cpu -> pci i/o & mem mappings from the device tree */
 	devp = NULL;
 	for (bus = 0; ; bus++) {
-		char name[] = "pci ";
+		char name[sizeof("pciX")];
 
-		name[strlen(name)-1] = bus+'0';
+		sprintf(name, "pci%c", bus + '0');
 
 		devp = find_node_by_alias(name);
 		if (devp == NULL)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 4a65386..47fbc56 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -1143,7 +1143,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
 	unsigned long flags;
 	struct irq_desc *desc;
 	const char *p;
-	char none[] = "none";
+	static const char none[] = "none";
 	int i;
 
 	seq_printf(m, "%-5s  %-7s  %-15s  %s\n", "virq", "hwirq",
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 02/25] arch/powerpc: Use static const char arrays
@ 2010-09-13 19:47   ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Mackerras, linuxppc-dev

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/powerpc/boot/addnote.c    |    4 ++--
 arch/powerpc/boot/cuboot-c2k.c |    4 ++--
 arch/powerpc/kernel/irq.c      |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c
index b1e5611..349b553 100644
--- a/arch/powerpc/boot/addnote.c
+++ b/arch/powerpc/boot/addnote.c
@@ -20,7 +20,7 @@
 #include <string.h>
 
 /* CHRP note section */
-char arch[] = "PowerPC";
+static const char arch[] = "PowerPC";
 
 #define N_DESCR	6
 unsigned int descr[N_DESCR] = {
@@ -33,7 +33,7 @@ unsigned int descr[N_DESCR] = {
 };
 
 /* RPA note section */
-char rpaname[] = "IBM,RPA-Client-Config";
+static const char rpaname[] = "IBM,RPA-Client-Config";
 
 /*
  * Note: setting ignore_my_client_config *should* mean that OF ignores
diff --git a/arch/powerpc/boot/cuboot-c2k.c b/arch/powerpc/boot/cuboot-c2k.c
index e435949..030d7db 100644
--- a/arch/powerpc/boot/cuboot-c2k.c
+++ b/arch/powerpc/boot/cuboot-c2k.c
@@ -62,9 +62,9 @@ static void c2k_bridge_setup(u32 mem_size)
 	/* Get the cpu -> pci i/o & mem mappings from the device tree */
 	devp = NULL;
 	for (bus = 0; ; bus++) {
-		char name[] = "pci ";
+		char name[sizeof("pciX")];
 
-		name[strlen(name)-1] = bus+'0';
+		sprintf(name, "pci%c", bus + '0');
 
 		devp = find_node_by_alias(name);
 		if (devp == NULL)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 4a65386..47fbc56 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -1143,7 +1143,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
 	unsigned long flags;
 	struct irq_desc *desc;
 	const char *p;
-	char none[] = "none";
+	static const char none[] = "none";
 	int i;
 
 	seq_printf(m, "%-5s  %-7s  %-15s  %s\n", "virq", "hwirq",
-- 
1.7.3.rc1

^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 03/25] drivers/acpi: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (4 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Len Brown, linux-acpi

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/acpi/sleep.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index cf82989..566b1cdd 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -567,7 +567,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
 {
 	acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
 	struct acpi_device *adev;
-	char acpi_method[] = "_SxD";
+	char acpi_method[sizeof("_SxD")];
 	unsigned long long d_min, d_max;
 
 	if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
@@ -575,7 +575,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
 		return -ENODEV;
 	}
 
-	acpi_method[2] = '0' + acpi_target_sleep_state;
+	sprintf(acpi_method, "_S%cD", '0' + acpi_target_sleep_state);
 	/*
 	 * If the sleep state is S0, we will return D3, but if the device has
 	 * _S0W, we will use the value from _S0W
-- 
1.7.3.rc1

^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 04/25] drivers/char: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (5 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  2010-09-14  2:06     ` Stephen Rothwell
  -1 siblings, 1 reply; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/char/hvc_vio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c
index 27370e9..5e2f52b 100644
--- a/drivers/char/hvc_vio.c
+++ b/drivers/char/hvc_vio.c
@@ -39,7 +39,7 @@
 
 #include "hvc_console.h"
 
-char hvc_driver_name[] = "hvc_console";
+static const char hvc_driver_name[] = "hvc_console";
 
 static struct vio_device_id hvc_driver_table[] __devinitdata = {
 	{"serial", "hvterm1"},
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 19:47   ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Linus Walleij, Jean Delvare (PC drivers, core),
	Ben Dooks (embedded platforms),
	linux-arm-kernel, linux-i2c

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/i2c/busses/i2c-stu300.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 495be45..2f7c09c 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
 	struct resource *res;
 	int bus_nr;
 	int ret = 0;
-	char clk_name[] = "I2C0";
+	char clk_name[sizeof("I2Cx")];
 
 	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
 	if (!dev) {
@@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
 	}
 
 	bus_nr = pdev->id;
-	clk_name[3] += (char)bus_nr;
+	sprintf(clk_name, "I2C%c", '0' + bus_nr);
 	dev->clk = clk_get(&pdev->dev, clk_name);
 	if (IS_ERR(dev->clk)) {
 		ret = PTR_ERR(dev->clk);
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 19:47   ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Linus Walleij, Jean Delvare (PC drivers, core),
	Ben Dooks (embedded platforms),
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/i2c/busses/i2c-stu300.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 495be45..2f7c09c 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
 	struct resource *res;
 	int bus_nr;
 	int ret = 0;
-	char clk_name[] = "I2C0";
+	char clk_name[sizeof("I2Cx")];
 
 	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
 	if (!dev) {
@@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
 	}
 
 	bus_nr = pdev->id;
-	clk_name[3] += (char)bus_nr;
+	sprintf(clk_name, "I2C%c", '0' + bus_nr);
 	dev->clk = clk_get(&pdev->dev, clk_name);
 	if (IS_ERR(dev->clk)) {
 		ret = PTR_ERR(dev->clk);
-- 
1.7.3.rc1

^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 19:47   ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/i2c/busses/i2c-stu300.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 495be45..2f7c09c 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
 	struct resource *res;
 	int bus_nr;
 	int ret = 0;
-	char clk_name[] = "I2C0";
+	char clk_name[sizeof("I2Cx")];
 
 	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
 	if (!dev) {
@@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
 	}
 
 	bus_nr = pdev->id;
-	clk_name[3] += (char)bus_nr;
+	sprintf(clk_name, "I2C%c", '0' + bus_nr);
 	dev->clk = clk_get(&pdev->dev, clk_name);
 	if (IS_ERR(dev->clk)) {
 		ret = PTR_ERR(dev->clk);
-- 
1.7.3.rc1

^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 06/25] drivers/isdn: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (7 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Karsten Keil, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/isdn/hysdn/hycapi.c  |    2 +-
 drivers/isdn/mISDN/dsp_cmx.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c
index 6299b06..5de3a93 100644
--- a/drivers/isdn/hysdn/hycapi.c
+++ b/drivers/isdn/hysdn/hycapi.c
@@ -151,7 +151,7 @@ static void
 hycapi_register_internal(struct capi_ctr *ctrl, __u16 appl,
 			 capi_register_params *rp)
 {
-	char ExtFeatureDefaults[] = "49  /0/0/0/0,*/1,*/2,*/3,*/4,*/5,*/6,*/7,*/8,*/9,*";
+	static const char ExtFeatureDefaults[] = "49  /0/0/0/0,*/1,*/2,*/3,*/4,*/5,*/6,*/7,*/8,*/9,*";
 	hycapictrl_info *cinfo = (hycapictrl_info *)(ctrl->driverdata);
 	hysdn_card *card = cinfo->card;
 	struct sk_buff *skb;
diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index 76d9e67..3d80990 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -1155,7 +1155,7 @@ int delaycount;
 static void
 showdelay(struct dsp *dsp, int samples, int delay)
 {
-	char bar[] = "--------------------------------------------------|";
+	static const char bar[] = "--------------------------------------------------|";
 	int sdelay;
 
 	delaycount += samples;
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 07/25] drivers/media: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (8 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  2010-09-13 21:50   ` Mauro Carvalho Chehab
  -1 siblings, 1 reply; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mauro Carvalho Chehab, mjpeg-users, linux-media

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/media/video/zoran/zoran_device.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/zoran/zoran_device.c b/drivers/media/video/zoran/zoran_device.c
index 6f846ab..ea8a1e9 100644
--- a/drivers/media/video/zoran/zoran_device.c
+++ b/drivers/media/video/zoran/zoran_device.c
@@ -1470,8 +1470,7 @@ zoran_irq (int             irq,
 		    (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS ||
 		     zr->codec_mode == BUZ_MODE_MOTION_COMPRESS)) {
 			if (zr36067_debug > 1 && (!zr->frame_num || zr->JPEG_error)) {
-				char sc[] = "0000";
-				char sv[5];
+				char sv[sizeof("0000")];
 				int i;
 
 				printk(KERN_INFO
@@ -1481,7 +1480,7 @@ zoran_irq (int             irq,
 				       zr->jpg_settings.field_per_buff,
 				       zr->JPEG_missed);
 
-				strcpy(sv, sc);
+				strcpy(sv, "0000");
 				for (i = 0; i < 4; i++) {
 					if (le32_to_cpu(zr->stat_com[i]) & 1)
 						sv[i] = '1';
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 08/25] drivers/net/atl1c: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (9 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/atl1c/atl1c.h      |    4 ++--
 drivers/net/atl1c/atl1c_main.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/atl1c/atl1c.h b/drivers/net/atl1c/atl1c.h
index ef4115b..05558a0 100644
--- a/drivers/net/atl1c/atl1c.h
+++ b/drivers/net/atl1c/atl1c.h
@@ -628,8 +628,8 @@ struct atl1c_adapter {
 #define AT_READ_REG_ARRAY(a, reg, offset) ( \
 		readl(((a)->hw_addr + reg) + ((offset) << 2)))
 
-extern char atl1c_driver_name[];
-extern char atl1c_driver_version[];
+extern const char atl1c_driver_name[];
+extern const char atl1c_driver_version[];
 
 extern int atl1c_up(struct atl1c_adapter *adapter);
 extern void atl1c_down(struct atl1c_adapter *adapter);
diff --git a/drivers/net/atl1c/atl1c_main.c b/drivers/net/atl1c/atl1c_main.c
index 553230e..aaac76b 100644
--- a/drivers/net/atl1c/atl1c_main.c
+++ b/drivers/net/atl1c/atl1c_main.c
@@ -22,8 +22,8 @@
 #include "atl1c.h"
 
 #define ATL1C_DRV_VERSION "1.0.1.0-NAPI"
-char atl1c_driver_name[] = "atl1c";
-char atl1c_driver_version[] = ATL1C_DRV_VERSION;
+const char atl1c_driver_name[] = "atl1c";
+const char atl1c_driver_version[] = ATL1C_DRV_VERSION;
 #define PCI_DEVICE_ID_ATTANSIC_L2C      0x1062
 #define PCI_DEVICE_ID_ATTANSIC_L1C      0x1063
 #define PCI_DEVICE_ID_ATHEROS_L2C_B	0x2060 /* AR8152 v1.1 Fast 10/100 */
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 09/25] drivers/net/atl1e: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (10 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/atl1e/atl1e.h      |    4 ++--
 drivers/net/atl1e/atl1e_main.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/atl1e/atl1e.h b/drivers/net/atl1e/atl1e.h
index 490d3b3..6c4cab3 100644
--- a/drivers/net/atl1e/atl1e.h
+++ b/drivers/net/atl1e/atl1e.h
@@ -498,8 +498,8 @@ struct atl1e_adapter {
 #define AT_READ_REG_ARRAY(a, reg, offset) ( \
 		readl(((a)->hw_addr + reg) + ((offset) << 2)))
 
-extern char atl1e_driver_name[];
-extern char atl1e_driver_version[];
+extern const char atl1e_driver_name[];
+extern const char atl1e_driver_version[];
 
 extern void atl1e_check_options(struct atl1e_adapter *adapter);
 extern int atl1e_up(struct atl1e_adapter *adapter);
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index 56ace3f..860dfd3 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -23,8 +23,8 @@
 
 #define DRV_VERSION "1.0.0.7-NAPI"
 
-char atl1e_driver_name[] = "ATL1E";
-char atl1e_driver_version[] = DRV_VERSION;
+const char atl1e_driver_name[] = "ATL1E";
+const char atl1e_driver_version[] = DRV_VERSION;
 #define PCI_DEVICE_ID_ATTANSIC_L1E      0x1026
 /*
  * atl1e_pci_tbl - PCI Device ID Table
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 10/25] drivers/net/(intel): Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
@ 2010-09-13 19:47   ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Alex Duyck,
	PJ Waskiewicz, John Ronciak, e1000-devel, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/e1000/e1000.h          |    2 +-
 drivers/net/e1000/e1000_main.c     |    4 ++--
 drivers/net/e1000e/e1000.h         |    2 +-
 drivers/net/e1000e/netdev.c        |    2 +-
 drivers/net/igb/igb.h              |    4 ++--
 drivers/net/igb/igb_main.c         |    4 ++--
 drivers/net/igbvf/igbvf.h          |    2 +-
 drivers/net/igbvf/netdev.c         |    2 +-
 drivers/net/ixgb/ixgb.h            |    2 +-
 drivers/net/ixgb/ixgb_main.c       |    2 +-
 drivers/net/ixgbe/ixgbe.h          |    2 +-
 drivers/net/ixgbe/ixgbe_main.c     |    4 ++--
 drivers/net/ixgbevf/ixgbevf.h      |    2 +-
 drivers/net/ixgbevf/ixgbevf_main.c |    2 +-
 14 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 99288b9..6a7a7cf 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -339,7 +339,7 @@ extern struct net_device *e1000_get_hw_dev(struct e1000_hw *hw);
 #define e_dev_err(format, arg...) \
 	dev_err(&adapter->pdev->dev, format, ## arg)
 
-extern char e1000_driver_name[];
+extern const char e1000_driver_name[];
 extern const char e1000_driver_version[];
 
 extern int e1000_up(struct e1000_adapter *adapter);
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 17f5867..35ea780 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -29,8 +29,8 @@
 #include "e1000.h"
 #include <net/ip6_checksum.h>
 
-char e1000_driver_name[] = "e1000";
-static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
+const char e1000_driver_name[] = "e1000";
+static const char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
 #define DRV_VERSION "7.3.21-k6-NAPI"
 const char e1000_driver_version[] = DRV_VERSION;
 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index f9a31c8..5929eb3 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -446,7 +446,7 @@ enum latency_range {
 	latency_invalid = 255
 };
 
-extern char e1000e_driver_name[];
+extern const char e1000e_driver_name[];
 extern const char e1000e_driver_version[];
 
 extern void e1000e_check_options(struct e1000_adapter *adapter);
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index c9b66f4..51c80a3 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -55,7 +55,7 @@
 #define DRV_EXTRAVERSION "-k2"
 
 #define DRV_VERSION "1.2.7" DRV_EXTRAVERSION
-char e1000e_driver_name[] = "e1000e";
+const char e1000e_driver_name[] = "e1000e";
 const char e1000e_driver_version[] = DRV_VERSION;
 
 static const struct e1000_info *e1000_info_tbl[] = {
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 44e0ff1..4f0a81e 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -337,8 +337,8 @@ enum igb_boards {
 	board_82575,
 };
 
-extern char igb_driver_name[];
-extern char igb_driver_version[];
+extern const char igb_driver_name[];
+extern const char igb_driver_version[];
 
 extern int igb_up(struct igb_adapter *);
 extern void igb_down(struct igb_adapter *);
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 3adef1e..5c5ccfc 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -51,8 +51,8 @@
 #include "igb.h"
 
 #define DRV_VERSION "2.1.0-k2"
-char igb_driver_name[] = "igb";
-char igb_driver_version[] = DRV_VERSION;
+const char igb_driver_name[] = "igb";
+const char igb_driver_version[] = DRV_VERSION;
 static const char igb_driver_string[] =
 				"Intel(R) Gigabit Ethernet Network Driver";
 static const char igb_copyright[] = "Copyright (c) 2007-2009 Intel Corporation.";
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
index debeee2..8f0b3ef 100644
--- a/drivers/net/igbvf/igbvf.h
+++ b/drivers/net/igbvf/igbvf.h
@@ -309,7 +309,7 @@ enum latency_range {
 	latency_invalid = 255
 };
 
-extern char igbvf_driver_name[];
+extern const char igbvf_driver_name[];
 extern const char igbvf_driver_version[];
 
 extern void igbvf_check_options(struct igbvf_adapter *);
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index c7fab80..a578fe5 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -46,7 +46,7 @@
 #include "igbvf.h"
 
 #define DRV_VERSION "1.0.0-k0"
-char igbvf_driver_name[] = "igbvf";
+const char igbvf_driver_name[] = "igbvf";
 const char igbvf_driver_version[] = DRV_VERSION;
 static struct pm_qos_request_list igbvf_driver_pm_qos_req;
 static const char igbvf_driver_string[] =
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index 521c0c7..ef76e5e 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -204,7 +204,7 @@ enum ixgb_state_t {
 /* Exported from other modules */
 extern void ixgb_check_options(struct ixgb_adapter *adapter);
 extern void ixgb_set_ethtool_ops(struct net_device *netdev);
-extern char ixgb_driver_name[];
+extern const char ixgb_driver_name[];
 extern const char ixgb_driver_version[];
 
 extern int ixgb_up(struct ixgb_adapter *adapter);
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index c2f6e71..bffb164 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -30,7 +30,7 @@
 
 #include "ixgb.h"
 
-char ixgb_driver_name[] = "ixgb";
+const char ixgb_driver_name[] = "ixgb";
 static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
 
 #define DRIVERNAPI "-NAPI"
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 5cebc37..f397251 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -441,7 +441,7 @@ extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
                               int tc_max);
 #endif
 
-extern char ixgbe_driver_name[];
+extern const char ixgbe_driver_name[];
 extern const char ixgbe_driver_version[];
 
 extern int ixgbe_up(struct ixgbe_adapter *adapter);
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 3aafe94..9db1c8c 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -48,8 +48,8 @@
 #include "ixgbe_dcb_82599.h"
 #include "ixgbe_sriov.h"
 
-char ixgbe_driver_name[] = "ixgbe";
-static const char ixgbe_driver_string[] =
+const char ixgbe_driver_name[] = "ixgbe";
+const char ixgbe_driver_string[] =
                               "Intel(R) 10 Gigabit PCI Express Network Driver";
 
 #define DRV_VERSION "2.0.84-k2"
diff --git a/drivers/net/ixgbevf/ixgbevf.h b/drivers/net/ixgbevf/ixgbevf.h
index f7015ef..f6c72f1 100644
--- a/drivers/net/ixgbevf/ixgbevf.h
+++ b/drivers/net/ixgbevf/ixgbevf.h
@@ -282,7 +282,7 @@ extern struct ixgbevf_info ixgbevf_vf_info;
 extern struct ixgbe_mac_operations ixgbevf_mbx_ops;
 
 /* needed by ethtool.c */
-extern char ixgbevf_driver_name[];
+extern const char ixgbevf_driver_name[];
 extern const char ixgbevf_driver_version[];
 
 extern int ixgbevf_up(struct ixgbevf_adapter *adapter);
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index bdbd26c..eedb5ec 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -47,7 +47,7 @@
 
 #include "ixgbevf.h"
 
-char ixgbevf_driver_name[] = "ixgbevf";
+const char ixgbevf_driver_name[] = "ixgbevf";
 static const char ixgbevf_driver_string[] =
 	"Intel(R) 82599 Virtual Function";
 
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 10/25] drivers/net/(intel): Use static const char arrays
@ 2010-09-13 19:47   ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: e1000-devel, netdev, Bruce Allan, Jesse Brandeburg, John Ronciak,
	Jeff Kirsher

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/e1000/e1000.h          |    2 +-
 drivers/net/e1000/e1000_main.c     |    4 ++--
 drivers/net/e1000e/e1000.h         |    2 +-
 drivers/net/e1000e/netdev.c        |    2 +-
 drivers/net/igb/igb.h              |    4 ++--
 drivers/net/igb/igb_main.c         |    4 ++--
 drivers/net/igbvf/igbvf.h          |    2 +-
 drivers/net/igbvf/netdev.c         |    2 +-
 drivers/net/ixgb/ixgb.h            |    2 +-
 drivers/net/ixgb/ixgb_main.c       |    2 +-
 drivers/net/ixgbe/ixgbe.h          |    2 +-
 drivers/net/ixgbe/ixgbe_main.c     |    4 ++--
 drivers/net/ixgbevf/ixgbevf.h      |    2 +-
 drivers/net/ixgbevf/ixgbevf_main.c |    2 +-
 14 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index 99288b9..6a7a7cf 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -339,7 +339,7 @@ extern struct net_device *e1000_get_hw_dev(struct e1000_hw *hw);
 #define e_dev_err(format, arg...) \
 	dev_err(&adapter->pdev->dev, format, ## arg)
 
-extern char e1000_driver_name[];
+extern const char e1000_driver_name[];
 extern const char e1000_driver_version[];
 
 extern int e1000_up(struct e1000_adapter *adapter);
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 17f5867..35ea780 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -29,8 +29,8 @@
 #include "e1000.h"
 #include <net/ip6_checksum.h>
 
-char e1000_driver_name[] = "e1000";
-static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
+const char e1000_driver_name[] = "e1000";
+static const char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
 #define DRV_VERSION "7.3.21-k6-NAPI"
 const char e1000_driver_version[] = DRV_VERSION;
 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index f9a31c8..5929eb3 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -446,7 +446,7 @@ enum latency_range {
 	latency_invalid = 255
 };
 
-extern char e1000e_driver_name[];
+extern const char e1000e_driver_name[];
 extern const char e1000e_driver_version[];
 
 extern void e1000e_check_options(struct e1000_adapter *adapter);
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index c9b66f4..51c80a3 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -55,7 +55,7 @@
 #define DRV_EXTRAVERSION "-k2"
 
 #define DRV_VERSION "1.2.7" DRV_EXTRAVERSION
-char e1000e_driver_name[] = "e1000e";
+const char e1000e_driver_name[] = "e1000e";
 const char e1000e_driver_version[] = DRV_VERSION;
 
 static const struct e1000_info *e1000_info_tbl[] = {
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 44e0ff1..4f0a81e 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -337,8 +337,8 @@ enum igb_boards {
 	board_82575,
 };
 
-extern char igb_driver_name[];
-extern char igb_driver_version[];
+extern const char igb_driver_name[];
+extern const char igb_driver_version[];
 
 extern int igb_up(struct igb_adapter *);
 extern void igb_down(struct igb_adapter *);
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 3adef1e..5c5ccfc 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -51,8 +51,8 @@
 #include "igb.h"
 
 #define DRV_VERSION "2.1.0-k2"
-char igb_driver_name[] = "igb";
-char igb_driver_version[] = DRV_VERSION;
+const char igb_driver_name[] = "igb";
+const char igb_driver_version[] = DRV_VERSION;
 static const char igb_driver_string[] =
 				"Intel(R) Gigabit Ethernet Network Driver";
 static const char igb_copyright[] = "Copyright (c) 2007-2009 Intel Corporation.";
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h
index debeee2..8f0b3ef 100644
--- a/drivers/net/igbvf/igbvf.h
+++ b/drivers/net/igbvf/igbvf.h
@@ -309,7 +309,7 @@ enum latency_range {
 	latency_invalid = 255
 };
 
-extern char igbvf_driver_name[];
+extern const char igbvf_driver_name[];
 extern const char igbvf_driver_version[];
 
 extern void igbvf_check_options(struct igbvf_adapter *);
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index c7fab80..a578fe5 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -46,7 +46,7 @@
 #include "igbvf.h"
 
 #define DRV_VERSION "1.0.0-k0"
-char igbvf_driver_name[] = "igbvf";
+const char igbvf_driver_name[] = "igbvf";
 const char igbvf_driver_version[] = DRV_VERSION;
 static struct pm_qos_request_list igbvf_driver_pm_qos_req;
 static const char igbvf_driver_string[] =
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index 521c0c7..ef76e5e 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -204,7 +204,7 @@ enum ixgb_state_t {
 /* Exported from other modules */
 extern void ixgb_check_options(struct ixgb_adapter *adapter);
 extern void ixgb_set_ethtool_ops(struct net_device *netdev);
-extern char ixgb_driver_name[];
+extern const char ixgb_driver_name[];
 extern const char ixgb_driver_version[];
 
 extern int ixgb_up(struct ixgb_adapter *adapter);
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index c2f6e71..bffb164 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -30,7 +30,7 @@
 
 #include "ixgb.h"
 
-char ixgb_driver_name[] = "ixgb";
+const char ixgb_driver_name[] = "ixgb";
 static char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver";
 
 #define DRIVERNAPI "-NAPI"
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 5cebc37..f397251 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -441,7 +441,7 @@ extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
                               int tc_max);
 #endif
 
-extern char ixgbe_driver_name[];
+extern const char ixgbe_driver_name[];
 extern const char ixgbe_driver_version[];
 
 extern int ixgbe_up(struct ixgbe_adapter *adapter);
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 3aafe94..9db1c8c 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -48,8 +48,8 @@
 #include "ixgbe_dcb_82599.h"
 #include "ixgbe_sriov.h"
 
-char ixgbe_driver_name[] = "ixgbe";
-static const char ixgbe_driver_string[] =
+const char ixgbe_driver_name[] = "ixgbe";
+const char ixgbe_driver_string[] =
                               "Intel(R) 10 Gigabit PCI Express Network Driver";
 
 #define DRV_VERSION "2.0.84-k2"
diff --git a/drivers/net/ixgbevf/ixgbevf.h b/drivers/net/ixgbevf/ixgbevf.h
index f7015ef..f6c72f1 100644
--- a/drivers/net/ixgbevf/ixgbevf.h
+++ b/drivers/net/ixgbevf/ixgbevf.h
@@ -282,7 +282,7 @@ extern struct ixgbevf_info ixgbevf_vf_info;
 extern struct ixgbe_mac_operations ixgbevf_mbx_ops;
 
 /* needed by ethtool.c */
-extern char ixgbevf_driver_name[];
+extern const char ixgbevf_driver_name[];
 extern const char ixgbevf_driver_version[];
 
 extern int ixgbevf_up(struct ixgbevf_adapter *adapter);
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index bdbd26c..eedb5ec 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -47,7 +47,7 @@
 
 #include "ixgbevf.h"
 
-char ixgbevf_driver_name[] = "ixgbevf";
+const char ixgbevf_driver_name[] = "ixgbevf";
 static const char ixgbevf_driver_string[] =
 	"Intel(R) 82599 Virtual Function";
 
-- 
1.7.3.rc1


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 11/25] drivers/net/netxen: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (12 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Amit Kumar Salecha, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/netxen/netxen_nic.h      |    2 +-
 drivers/net/netxen/netxen_nic_main.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 6dca357..bd272aa 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -525,7 +525,7 @@ struct uni_data_desc{
 #define NX_UNIFIED_ROMIMAGE_NAME	"phanfw.bin"
 #define NX_FLASH_ROMIMAGE_NAME		"flash"
 
-extern char netxen_nic_driver_name[];
+extern const char netxen_nic_driver_name[];
 
 /* Number of status descriptors to handle per interrupt */
 #define MAX_STATUS_HANDLE	(64)
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 73d3145..521cbfe 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -46,7 +46,7 @@ MODULE_FIRMWARE(NX_P3_CT_ROMIMAGE_NAME);
 MODULE_FIRMWARE(NX_P3_MN_ROMIMAGE_NAME);
 MODULE_FIRMWARE(NX_UNIFIED_ROMIMAGE_NAME);
 
-char netxen_nic_driver_name[] = "netxen_nic";
+const char netxen_nic_driver_name[] = "netxen_nic";
 static char netxen_nic_driver_string[] = "QLogic/NetXen Network Driver v"
     NETXEN_NIC_LINUX_VERSIONID;
 
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 12/25] drivers/net/qlcnic: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (13 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Amit Kumar Salecha, Anirban Chakraborty, linux-driver, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/qlcnic/qlcnic.h      |    2 +-
 drivers/net/qlcnic/qlcnic_main.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index cc8385a..7effdad 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -345,7 +345,7 @@ struct uni_data_desc{
 #define QLCNIC_UNIFIED_ROMIMAGE_NAME	"phanfw.bin"
 #define QLCNIC_FLASH_ROMIMAGE_NAME	"flash"
 
-extern char qlcnic_driver_name[];
+extern const char qlcnic_driver_name[];
 
 /* Number of status descriptors to handle per interrupt */
 #define MAX_STATUS_HANDLE	(64)
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 5fd2abd..ad40171 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -41,7 +41,7 @@ MODULE_LICENSE("GPL");
 MODULE_VERSION(QLCNIC_LINUX_VERSIONID);
 MODULE_FIRMWARE(QLCNIC_UNIFIED_ROMIMAGE_NAME);
 
-char qlcnic_driver_name[] = "qlcnic";
+const char qlcnic_driver_name[] = "qlcnic";
 static const char qlcnic_driver_string[] = "QLogic 1/10 GbE "
 	"Converged/Intelligent Ethernet Driver v" QLCNIC_LINUX_VERSIONID;
 
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 13/25] drivers/net/spider_net.c: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (14 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ishizaki Kou, Jens Osterkamp, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/spider_net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index cb6bcca..ece8d75 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -70,7 +70,7 @@ MODULE_PARM_DESC(rx_descriptors, "number of descriptors used " \
 MODULE_PARM_DESC(tx_descriptors, "number of descriptors used " \
 		 "in tx chain");
 
-char spider_net_driver_name[] = "spidernet";
+const char spider_net_driver_name[] = "spidernet";
 
 static DEFINE_PCI_DEVICE_TABLE(spider_net_pci_tbl) = {
 	{ PCI_VENDOR_ID_TOSHIBA_2, PCI_DEVICE_ID_TOSHIBA_SPIDER_NET,
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 14/25] drivers/net/vnxnet3: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (15 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  2010-09-13 19:50   ` [Pv-drivers] " Bhavesh Davda
  2010-09-13 20:07   ` Shreyas Bhatewara
  -1 siblings, 2 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Shreyas Bhatewara, VMware, Inc., netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
 drivers/net/vmxnet3/vmxnet3_int.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 198ce92..dfc0014 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -28,7 +28,7 @@
 
 #include "vmxnet3_int.h"
 
-char vmxnet3_driver_name[] = "vmxnet3";
+const char vmxnet3_driver_name[] = "vmxnet3";
 #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"
 
 /*
diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h
index 2121c73..201fcf7 100644
--- a/drivers/net/vmxnet3/vmxnet3_int.h
+++ b/drivers/net/vmxnet3/vmxnet3_int.h
@@ -384,5 +384,5 @@ vmxnet3_create_queues(struct vmxnet3_adapter *adapter,
 extern void vmxnet3_set_ethtool_ops(struct net_device *netdev);
 extern struct net_device_stats *vmxnet3_get_stats(struct net_device *netdev);
 
-extern char vmxnet3_driver_name[];
+extern const char vmxnet3_driver_name[];
 #endif
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 15/25] drivers/net/wireless/ipw2x00: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (16 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  2010-09-14 18:41   ` John W. Linville
  -1 siblings, 1 reply; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: John W. Linville, linux-wireless, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/wireless/ipw2x00/ipw2100.c       |    2 +-
 drivers/net/wireless/ipw2x00/ipw2200.c       |    2 +-
 drivers/net/wireless/ipw2x00/libipw_module.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 61915f3..f64103c 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -4261,7 +4261,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr,
 {
 	struct ipw2100_priv *priv = dev_get_drvdata(d);
 	struct net_device *dev = priv->net_dev;
-	char buffer[] = "00000000";
+	char buffer[sizeof("00000000")];
 	unsigned long len =
 	    (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1;
 	unsigned long val;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 0f25083..75e83c9 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -1486,7 +1486,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr,
 {
 	struct ipw_priv *priv = dev_get_drvdata(d);
 	struct net_device *dev = priv->net_dev;
-	char buffer[] = "00000000";
+	char buffer[sizeof("00000000")];
 	unsigned long len =
 	    (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1;
 	unsigned long val;
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index 32dee2c..d0c8a67 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -261,7 +261,7 @@ static int debug_level_proc_open(struct inode *inode, struct file *file)
 static ssize_t debug_level_proc_write(struct file *file,
 		const char __user *buffer, size_t count, loff_t *pos)
 {
-	char buf[] = "0x00000000\n";
+	char buf[sizeof("0x00000000\n")];
 	size_t len = min(sizeof(buf) - 1, count);
 	unsigned long val;
 
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 16/25] drivers/s390/char: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (17 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Martin Schwidefsky, Heiko Carstens, linux390, linux-s390

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/s390/char/vmlogrdr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index e40a1b8..afd863c 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -214,7 +214,7 @@ static void vmlogrdr_iucv_message_pending(struct iucv_path *path,
 
 static int vmlogrdr_get_recording_class_AB(void)
 {
-	char cp_command[]="QUERY COMMAND RECORDING ";
+	static const char cp_command[] = "QUERY COMMAND RECORDING ";
 	char cp_response[80];
 	char *tail;
 	int len,i;
@@ -637,7 +637,7 @@ static ssize_t vmlogrdr_recording_status_show(struct device_driver *driver,
 					      char *buf)
 {
 
-	char cp_command[] = "QUERY RECORDING ";
+	static const char cp_command[] = "QUERY RECORDING ";
 	int len;
 
 	cpcmd(cp_command, buf, 4096, NULL);
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 17/25] drivers/scsi: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (18 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: James E.J. Bottomley, James Smart, Neela Syam Kolli, linux-scsi

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/scsi/bnx2i/bnx2i_hwi.c        |    6 +++---
 drivers/scsi/lpfc/lpfc_init.c         |    2 +-
 drivers/scsi/megaraid/megaraid_mbox.c |    6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index 90cef71..bd01994 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -1919,10 +1919,10 @@ static void bnx2i_process_iscsi_error(struct bnx2i_hba *hba,
 {
 	struct bnx2i_conn *bnx2i_conn;
 	u32 iscsi_cid;
-	char warn_notice[] = "iscsi_warning";
-	char error_notice[] = "iscsi_error";
+	static const char warn_notice[] = "iscsi_warning";
+	static const char error_notice[] = "iscsi_error";
 	char additional_notice[64];
-	char *message;
+	const char *message;
 	int need_recovery;
 	u64 err_mask64;
 
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index da9ba06..7e61349 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -281,7 +281,7 @@ lpfc_dump_wakeup_param_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq)
 	uint32_t prog_id_word;
 	char dist = ' ';
 	/* character array used for decoding dist type. */
-	char dist_char[] = "nabx";
+	static const char dist_char[] = "nabx";
 
 	if (pmboxq->u.mb.mbxStatus != MBX_SUCCESS) {
 		mempool_free(pmboxq, phba->mbox_mem_pool);
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index a7810a1..7eddde3 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -1536,9 +1536,9 @@ megaraid_mbox_build_cmd(adapter_t *adapter, struct scsi_cmnd *scp, int *busy)
 	mbox64_t		*mbox64;
 	mbox_t			*mbox;
 	scb_t			*scb;
-	char			skip[] = "skipping";
-	char			scan[] = "scanning";
-	char			*ss;
+	static const char	skip[] = "skipping";
+	static const char	scan[] = "scanning";
+	const char		*ss;
 
 
 	/*
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
@ 2010-09-13 19:47   ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: David S. Miller, sparclinux

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/serial/suncore.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index 6381a02..f2a5b54 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -84,8 +84,8 @@ EXPORT_SYMBOL(sunserial_console_match);
 
 void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
 {
+	char mode_prop[sizeof("ttyX-mode")];
 	const char *mode, *s;
-	char mode_prop[] = "ttyX-mode";
 	int baud, bits, stop, cflag;
 	char parity;
 
@@ -106,7 +106,7 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
 		if (of_console_options)
 			c = *of_console_options;
 
-		mode_prop[3] = c;
+		sprintf(mode_prop, "tty%c-mode", c);
 
 		dp = of_find_node_by_path("/options");
 		mode = of_get_property(dp, mode_prop, NULL);
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays
@ 2010-09-13 19:47   ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: David S. Miller, sparclinux

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/serial/suncore.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
index 6381a02..f2a5b54 100644
--- a/drivers/serial/suncore.c
+++ b/drivers/serial/suncore.c
@@ -84,8 +84,8 @@ EXPORT_SYMBOL(sunserial_console_match);
 
 void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
 {
+	char mode_prop[sizeof("ttyX-mode")];
 	const char *mode, *s;
-	char mode_prop[] = "ttyX-mode";
 	int baud, bits, stop, cflag;
 	char parity;
 
@@ -106,7 +106,7 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
 		if (of_console_options)
 			c = *of_console_options;
 
-		mode_prop[3] = c;
+		sprintf(mode_prop, "tty%c-mode", c);
 
 		dp = of_find_node_by_path("/options");
 		mode = of_get_property(dp, mode_prop, NULL);
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 19/25] drivers/staging: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (20 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Brett Rudley, Henry Ptasinski, Nohee Ko, Greg Kroah-Hartman,
	linux-wireless, devel

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/brcm80211/util/bcmutils.c          |    2 +-
 drivers/staging/comedi/drivers/comedi_bond.c       |    2 +-
 drivers/staging/cxt1e1/ossiRelease.c               |    2 +-
 drivers/staging/go7007/go7007-driver.c             |    2 +-
 drivers/staging/msm/mdp.c                          |    2 +-
 .../staging/rtl8192e/ieee80211/ieee80211_module.c  |    2 +-
 .../staging/rtl8192u/ieee80211/ieee80211_module.c  |    2 +-
 drivers/staging/tidspbridge/rmgr/dbdcd.c           |    6 +++---
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c
index 364f837..77ae71b 100644
--- a/drivers/staging/brcm80211/util/bcmutils.c
+++ b/drivers/staging/brcm80211/util/bcmutils.c
@@ -905,7 +905,7 @@ static int findmatch(char *string, char *name)
  */
 uint getgpiopin(char *vars, char *pin_name, uint def_pin)
 {
-	char name[] = "gpioXXXX";
+	char name[sizeof("gpioXXXX")];
 	char *val;
 	uint pin;
 
diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c
index cfcbd9b..dd8b932 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -374,7 +374,7 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it)
 	/* Loop through all comedi devices specified on the command-line,
 	   building our device list */
 	for (i = 0; i < COMEDI_NDEVCONFOPTS && (!i || it->options[i]); ++i) {
-		char file[] = "/dev/comediXXXXXX";
+		char file[sizeof("/dev/comediXXXXXX")];
 		int minor = it->options[i];
 		struct comedi_device *d;
 		int sdev = -1, nchans, tmp;
diff --git a/drivers/staging/cxt1e1/ossiRelease.c b/drivers/staging/cxt1e1/ossiRelease.c
index a560298..b80d101 100644
--- a/drivers/staging/cxt1e1/ossiRelease.c
+++ b/drivers/staging/cxt1e1/ossiRelease.c
@@ -34,6 +34,6 @@
  */
 
 
-char pmcc4_OSSI_release[] = "$Release: PMCC4_3_1B,  Copyright (c) 2008 One Stop Systems$";
+static const char pmcc4_OSSI_release[] = "$Release: PMCC4_3_1B,  Copyright (c) 2008 One Stop Systems$";
 
 /***  End-of-File  ***/
diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c
index 372a7c6..32757f5 100644
--- a/drivers/staging/go7007/go7007-driver.c
+++ b/drivers/staging/go7007/go7007-driver.c
@@ -92,7 +92,7 @@ EXPORT_SYMBOL(go7007_read_addr);
 static int go7007_load_encoder(struct go7007 *go)
 {
 	const struct firmware *fw_entry;
-	char fw_name[] = "go7007fw.bin";
+	static const char fw_name[] = "go7007fw.bin";
 	void *bounce;
 	int fw_len, rv = 0;
 	u16 intr_val, intr_data;
diff --git a/drivers/staging/msm/mdp.c b/drivers/staging/msm/mdp.c
index 58cb404..e5b7add 100644
--- a/drivers/staging/msm/mdp.c
+++ b/drivers/staging/msm/mdp.c
@@ -704,7 +704,7 @@ static void mdp_drv_init(void)
 #ifdef MSM_FB_ENABLE_DBGFS
 	{
 		struct dentry *root;
-		char sub_name[] = "mdp";
+		static const char sub_name[] = "mdp";
 
 		root = msm_fb_get_debugfs_root();
 		if (root != NULL) {
diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
index 08bfdb1..72bfcca 100644
--- a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
@@ -253,7 +253,7 @@ static int show_debug_level(char *page, char **start, off_t offset,
 static int store_debug_level(struct file *file, const char *buffer,
 			unsigned long count, void *data)
 {
-	char buf[] = "0x00000000";
+	char buf[sizeof("0x00000000")];
 	unsigned long len = min(sizeof(buf) - 1, (u32)count);
 	char *p = (char *)buf;
 	unsigned long val;
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index 7455264..56c271d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -256,7 +256,7 @@ static int show_debug_level(char *page, char **start, off_t offset,
 static int store_debug_level(struct file *file, const char *buffer,
 			     unsigned long count, void *data)
 {
-	char buf[] = "0x00000000";
+	char buf[sizeof("0x00000000")];
 	unsigned long len = min_t(unsigned long, sizeof(buf) - 1, count);
 	char *p = (char *)buf;
 	unsigned long val;
diff --git a/drivers/staging/tidspbridge/rmgr/dbdcd.c b/drivers/staging/tidspbridge/rmgr/dbdcd.c
index 3581a55..1526a17 100644
--- a/drivers/staging/tidspbridge/rmgr/dbdcd.c
+++ b/drivers/staging/tidspbridge/rmgr/dbdcd.c
@@ -548,7 +548,7 @@ int dcd_get_objects(struct dcd_manager *hdcd_mgr,
 	struct cod_libraryobj *lib = NULL;
 	u32 ul_addr = 0;	/* Used by cod_get_section */
 	u32 ul_len = 0;		/* Used by cod_get_section */
-	char seps[] = ":, ";
+	static const char seps[] = ":, ";
 	char *token = NULL;
 	struct dsp_uuid dsp_uuid_obj;
 	s32 object_type;
@@ -1050,7 +1050,7 @@ static int get_attrs_from_buf(char *psz_buf, u32 ul_buf_size,
 				     struct dcd_genericobj *gen_obj)
 {
 	int status = 0;
-	char seps[] = ", ";
+	static const char seps[] = ", ";
 	char *psz_cur;
 	char *token;
 	s32 token_len = 0;
@@ -1419,7 +1419,7 @@ static int get_dep_lib_info(struct dcd_manager *hdcd_mgr,
 	u32 ul_addr = 0;	/* Used by cod_get_section */
 	u32 ul_len = 0;		/* Used by cod_get_section */
 	u32 dw_data_size = COD_MAXPATHLENGTH;
-	char seps[] = ", ";
+	static const char seps[] = ", ";
 	char *token = NULL;
 	bool get_uuids = (dep_lib_uuids != NULL);
 	u16 dep_libs = 0;
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 20/25] drivers/usb: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (21 preceding siblings ...)
  (?)
@ 2010-09-13 19:47 ` Joe Perches
  2010-09-13 20:38   ` Greg KH
  -1 siblings, 1 reply; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, linux-usb

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/usb/atm/ueagle-atm.c   |   14 +++++---------
 drivers/usb/otg/langwell_otg.c |    2 +-
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index ea071a5..00d2516 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -1574,20 +1574,16 @@ static int uea_stat_e4(struct uea_softc *sc)
 
 static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver)
 {
-	char file_arr[] = "CMVxy.bin";
+	char file_arr[sizeof("CMVxy.bin")];
 	char *file;
 
 	kparam_block_sysfs_write(cmv_file);
 	/* set proper name corresponding modem version and line type */
 	if (cmv_file[sc->modem_index] == NULL) {
-		if (UEA_CHIP_VERSION(sc) == ADI930)
-			file_arr[3] = '9';
-		else if (UEA_CHIP_VERSION(sc) == EAGLE_IV)
-			file_arr[3] = '4';
-		else
-			file_arr[3] = 'e';
-
-		file_arr[4] = IS_ISDN(sc) ? 'i' : 'p';
+		sprintf(file_arr, "CMV%c%c.bin",
+			(UEA_CHIP_VERSION(sc) == ADI930) ? '9' :
+			(UEA_CHIP_VERSION(sc) == EAGLE_IV) ? '4' : 'e',
+			IS_ISDN(sc) ? 'i' : 'p');
 		file = file_arr;
 	} else
 		file = cmv_file[sc->modem_index];
diff --git a/drivers/usb/otg/langwell_otg.c b/drivers/usb/otg/langwell_otg.c
index 8791880..ce01172 100644
--- a/drivers/usb/otg/langwell_otg.c
+++ b/drivers/usb/otg/langwell_otg.c
@@ -2035,7 +2035,7 @@ static int langwell_otg_probe(struct pci_dev *pdev,
 	int			retval;
 	u32			val32;
 	struct langwell_otg	*lnw;
-	char			qname[] = "langwell_otg_queue";
+	static const char	qname[] = "langwell_otg_queue";
 
 	retval = 0;
 	dev_dbg(&pdev->dev, "\notg controller is detected.\n");
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 21/25] drivers/video: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
@ 2010-09-13 19:47   ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Winischhofer, Joseph Chan, Florian Tobias Schandinat, linux-fbdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/video/sh_mipi_dsi.c  |    4 ++--
 drivers/video/sis/sis_main.c |   10 +++++-----
 drivers/video/via/viafbdev.c |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
index 5699ce0..4a8501b 100644
--- a/drivers/video/sh_mipi_dsi.c
+++ b/drivers/video/sh_mipi_dsi.c
@@ -319,7 +319,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	unsigned long rate, f_current;
 	int idx = pdev->id, ret;
-	char dsip_clk[] = "dsi.p_clk";
+	char dsip_clk[sizeof("dsiXp_clk")];
 
 	if (!res || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
 		return -ENODEV;
@@ -370,7 +370,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
 
 	dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
 
-	sprintf(dsip_clk, "dsi%1.1dp_clk", idx);
+	sprintf(dsip_clk, "dsi%cp_clk", idx + '0');
 	mipi->dsip_clk = clk_get(&pdev->dev, dsip_clk);
 	if (IS_ERR(mipi->dsip_clk)) {
 		ret = PTR_ERR(mipi->dsip_clk);
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 559bf17..4be65d1 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -2387,8 +2387,8 @@ SiS_Sense30x(struct sis_video_info *ivideo)
     u16 cvbs=0, cvbs_c=0;
     u16 vga2=0, vga2_c=0;
     int myflag, result;
-    char stdstr[] = "sisfb: Detected";
-    char tvstr[]  = "TV connected to";
+    static const char stdstr[] = "sisfb: Detected";
+    static const char tvstr[] = "TV connected to";
 
     if(ivideo->vbflags2 & VB2_301) {
        svhs = 0x00b9; cvbs = 0x00b3; vga2 = 0x00d1;
@@ -2525,7 +2525,7 @@ SiS_SenseCh(struct sis_video_info *ivideo)
 {
 #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
     u8 temp1, temp2;
-    char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
+    static const char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
 #endif
 #ifdef CONFIG_FB_SIS_300
     unsigned char test[3];
@@ -2648,8 +2648,8 @@ SiS_SenseCh(struct sis_video_info *ivideo)
 static void __devinit
 sisfb_get_VB_type(struct sis_video_info *ivideo)
 {
-	char stdstr[]    = "sisfb: Detected";
-	char bridgestr[] = "video bridge";
+	static const char stdstr[] = "sisfb: Detected";
+	static const char bridgestr[] = "video bridge";
 	u8 vb_chipid;
 	u8 reg;
 
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 5a947b0..394ef48 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -367,7 +367,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
 	} u;
 	u32 state_info = 0;
 	u32 *viafb_gamma_table;
-	char driver_name[] = "viafb";
+	static const char driver_name[] = "viafb";
 
 	u32 __user *argp = (u32 __user *) arg;
 	u32 gpu32;
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 21/25] drivers/video: Use static const char arrays
@ 2010-09-13 19:47   ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: Thomas Winischhofer, Joseph Chan, Florian Tobias Schandinat, linux-fbdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/video/sh_mipi_dsi.c  |    4 ++--
 drivers/video/sis/sis_main.c |   10 +++++-----
 drivers/video/via/viafbdev.c |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
index 5699ce0..4a8501b 100644
--- a/drivers/video/sh_mipi_dsi.c
+++ b/drivers/video/sh_mipi_dsi.c
@@ -319,7 +319,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	unsigned long rate, f_current;
 	int idx = pdev->id, ret;
-	char dsip_clk[] = "dsi.p_clk";
+	char dsip_clk[sizeof("dsiXp_clk")];
 
 	if (!res || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
 		return -ENODEV;
@@ -370,7 +370,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
 
 	dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
 
-	sprintf(dsip_clk, "dsi%1.1dp_clk", idx);
+	sprintf(dsip_clk, "dsi%cp_clk", idx + '0');
 	mipi->dsip_clk = clk_get(&pdev->dev, dsip_clk);
 	if (IS_ERR(mipi->dsip_clk)) {
 		ret = PTR_ERR(mipi->dsip_clk);
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 559bf17..4be65d1 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -2387,8 +2387,8 @@ SiS_Sense30x(struct sis_video_info *ivideo)
     u16 cvbs=0, cvbs_c=0;
     u16 vga2=0, vga2_c=0;
     int myflag, result;
-    char stdstr[] = "sisfb: Detected";
-    char tvstr[]  = "TV connected to";
+    static const char stdstr[] = "sisfb: Detected";
+    static const char tvstr[] = "TV connected to";
 
     if(ivideo->vbflags2 & VB2_301) {
        svhs = 0x00b9; cvbs = 0x00b3; vga2 = 0x00d1;
@@ -2525,7 +2525,7 @@ SiS_SenseCh(struct sis_video_info *ivideo)
 {
 #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
     u8 temp1, temp2;
-    char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
+    static const char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
 #endif
 #ifdef CONFIG_FB_SIS_300
     unsigned char test[3];
@@ -2648,8 +2648,8 @@ SiS_SenseCh(struct sis_video_info *ivideo)
 static void __devinit
 sisfb_get_VB_type(struct sis_video_info *ivideo)
 {
-	char stdstr[]    = "sisfb: Detected";
-	char bridgestr[] = "video bridge";
+	static const char stdstr[] = "sisfb: Detected";
+	static const char bridgestr[] = "video bridge";
 	u8 vb_chipid;
 	u8 reg;
 
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 5a947b0..394ef48 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -367,7 +367,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
 	} u;
 	u32 state_info = 0;
 	u32 *viafb_gamma_table;
-	char driver_name[] = "viafb";
+	static const char driver_name[] = "viafb";
 
 	u32 __user *argp = (u32 __user *) arg;
 	u32 gpu32;
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 22/25] net/dsa: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (23 preceding siblings ...)
  (?)
@ 2010-09-13 19:48 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: David S. Miller, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/dsa/dsa.c      |    2 +-
 net/dsa/dsa_priv.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 6112a12..cca6a10 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -15,7 +15,7 @@
 #include <net/dsa.h>
 #include "dsa_priv.h"
 
-char dsa_driver_version[] = "0.1";
+const char dsa_driver_version[] = "0.1";
 
 
 /* switch driver registration ***********************************************/
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index 4b0ea05..634c22d 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -158,7 +158,7 @@ struct dsa_switch_driver {
 };
 
 /* dsa.c */
-extern char dsa_driver_version[];
+extern const char dsa_driver_version[];
 void register_switch_driver(struct dsa_switch_driver *type);
 void unregister_switch_driver(struct dsa_switch_driver *type);
 
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 23/25] net/sunrpc: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (24 preceding siblings ...)
  (?)
@ 2010-09-13 19:48 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: J. Bruce Fields, Neil Brown, Trond Myklebust, David S. Miller,
	linux-nfs, netdev

Signed-off-by: Joe Perches <joe@perches.com>
---
 net/sunrpc/auth_gss/gss_krb5_mech.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 0326446..8a4d083 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -422,7 +422,7 @@ static int
 context_derive_keys_rc4(struct krb5_ctx *ctx)
 {
 	struct crypto_hash *hmac;
-	char sigkeyconstant[] = "signaturekey";
+	static const char sigkeyconstant[] = "signaturekey";
 	int slen = strlen(sigkeyconstant) + 1;	/* include null terminator */
 	struct hash_desc desc;
 	struct scatterlist sg[1];
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 24/25] sound: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (25 preceding siblings ...)
  (?)
@ 2010-09-13 19:48 ` Joe Perches
  2010-09-13 20:30     ` Takashi Iwai
  -1 siblings, 1 reply; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel

Signed-off-by: Joe Perches <joe@perches.com>
---
 sound/core/misc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/sound/core/misc.c b/sound/core/misc.c
index 2c41825..0e5e77f 100644
--- a/sound/core/misc.c
+++ b/sound/core/misc.c
@@ -64,12 +64,15 @@ 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[] = "<0>";
+	char tmp[sizeof("<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;
 	}
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* [PATCH 25/25] tools/perf/util: Use static const char arrays
  2010-09-13 19:47 ` Joe Perches
                   ` (26 preceding siblings ...)
  (?)
@ 2010-09-13 19:48 ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 19:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo

Signed-off-by: Joe Perches <joe@perches.com>
---
 tools/perf/util/ui/setup.c |    3 ++-
 tools/perf/util/ui/util.c  |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/ui/setup.c b/tools/perf/util/ui/setup.c
index 6620850..9ff3ead 100644
--- a/tools/perf/util/ui/setup.c
+++ b/tools/perf/util/ui/setup.c
@@ -34,7 +34,8 @@ void exit_browser(bool wait_for_ok)
 {
 	if (use_browser > 0) {
 		if (wait_for_ok) {
-			char title[] = "Fatal Error", ok[] = "Ok";
+			static const char title[] = "Fatal Error";
+			static const char ok[] = "Ok";
 			newtWinMessage(title, ok, ui_helpline__last_msg);
 		}
 		newtFinished();
diff --git a/tools/perf/util/ui/util.c b/tools/perf/util/ui/util.c
index 9706d9d..fe2742e 100644
--- a/tools/perf/util/ui/util.c
+++ b/tools/perf/util/ui/util.c
@@ -107,6 +107,7 @@ out_destroy_form:
 bool ui__dialog_yesno(const char *msg)
 {
 	/* newtWinChoice should really be accepting const char pointers... */
-	char yes[] = "Yes", no[] = "No";
+	static const char yes[] = "Yes";
+	static const char no[] = "No";
 	return newtWinChoice(NULL, yes, no, (char *)msg) == 1;
 }
-- 
1.7.3.rc1


^ permalink raw reply related	[flat|nested] 88+ messages in thread

* RE: [Pv-drivers] [PATCH 14/25] drivers/net/vnxnet3: Use static const char arrays
  2010-09-13 19:47 ` [PATCH 14/25] drivers/net/vnxnet3: " Joe Perches
@ 2010-09-13 19:50   ` Bhavesh Davda
  2010-09-13 20:07   ` Shreyas Bhatewara
  1 sibling, 0 replies; 88+ messages in thread
From: Bhavesh Davda @ 2010-09-13 19:50 UTC (permalink / raw)
  To: Joe Perches, linux-kernel; +Cc: VMware, Inc., netdev

Thanks.

Signed-off-by: Bhavesh Davda <bhavesh@vmware.com>

> -----Original Message-----
> From: pv-drivers-bounces@vmware.com [mailto:pv-drivers-
> bounces@vmware.com] On Behalf Of Joe Perches
> Sent: Monday, September 13, 2010 12:48 PM
> To: linux-kernel@vger.kernel.org
> Cc: VMware, Inc.; netdev@vger.kernel.org
> Subject: [Pv-drivers] [PATCH 14/25] drivers/net/vnxnet3: Use static
> const char arrays
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
>  drivers/net/vmxnet3/vmxnet3_int.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c
> b/drivers/net/vmxnet3/vmxnet3_drv.c
> index 198ce92..dfc0014 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -28,7 +28,7 @@
> 
>  #include "vmxnet3_int.h"
> 
> -char vmxnet3_driver_name[] = "vmxnet3";
> +const char vmxnet3_driver_name[] = "vmxnet3";
>  #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"
> 
>  /*
> diff --git a/drivers/net/vmxnet3/vmxnet3_int.h
> b/drivers/net/vmxnet3/vmxnet3_int.h
> index 2121c73..201fcf7 100644
> --- a/drivers/net/vmxnet3/vmxnet3_int.h
> +++ b/drivers/net/vmxnet3/vmxnet3_int.h
> @@ -384,5 +384,5 @@ vmxnet3_create_queues(struct vmxnet3_adapter
> *adapter,
>  extern void vmxnet3_set_ethtool_ops(struct net_device *netdev);
>  extern struct net_device_stats *vmxnet3_get_stats(struct net_device
> *netdev);
> 
> -extern char vmxnet3_driver_name[];
> +extern const char vmxnet3_driver_name[];
>  #endif
> --
> 1.7.3.rc1
> 
> _______________________________________________
> Pv-drivers mailing list
> Pv-drivers@vmware.com
> http://mailman2.vmware.com/mailman/listinfo/pv-drivers

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 19:56     ` Russell King - ARM Linux
  0 siblings, 0 replies; 88+ messages in thread
From: Russell King - ARM Linux @ 2010-09-13 19:56 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Jean Delvare (PC drivers, core),
	linux-i2c, Linus Walleij, Ben Dooks (embedded platforms),
	linux-arm-kernel

On Mon, Sep 13, 2010 at 12:47:43PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);

If people would implement the clk API correctly (matching by struct device
rather than giving every clock a name and trying to use the const char *
as the sole matching token), stuff like this would not be necessary.
The second argument to clk_get() is supposed to be a _consumer_ name
(iow, something to determine which clock for the struct device you want)
rather than a producer name.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 19:56     ` Russell King - ARM Linux
  0 siblings, 0 replies; 88+ messages in thread
From: Russell King - ARM Linux @ 2010-09-13 19:56 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jean Delvare (PC drivers,
	core),
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Linus Walleij,
	Ben Dooks (embedded platforms),
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, Sep 13, 2010 at 12:47:43PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);

If people would implement the clk API correctly (matching by struct device
rather than giving every clock a name and trying to use the const char *
as the sole matching token), stuff like this would not be necessary.
The second argument to clk_get() is supposed to be a _consumer_ name
(iow, something to determine which clock for the struct device you want)
rather than a producer name.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 19:56     ` Russell King - ARM Linux
  0 siblings, 0 replies; 88+ messages in thread
From: Russell King - ARM Linux @ 2010-09-13 19:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 13, 2010 at 12:47:43PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);

If people would implement the clk API correctly (matching by struct device
rather than giving every clock a name and trying to use the const char *
as the sole matching token), stuff like this would not be necessary.
The second argument to clk_get() is supposed to be a _consumer_ name
(iow, something to determine which clock for the struct device you want)
rather than a producer name.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* RE: [PATCH 14/25] drivers/net/vnxnet3: Use static const char arrays
  2010-09-13 19:47 ` [PATCH 14/25] drivers/net/vnxnet3: " Joe Perches
  2010-09-13 19:50   ` [Pv-drivers] " Bhavesh Davda
@ 2010-09-13 20:07   ` Shreyas Bhatewara
  1 sibling, 0 replies; 88+ messages in thread
From: Shreyas Bhatewara @ 2010-09-13 20:07 UTC (permalink / raw)
  To: Joe Perches, linux-kernel; +Cc: VMware, Inc., netdev

Thanks Joe.

Acked-by: Shreyas Bhatewara <sbhatewara@vmware.com>

> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Monday, September 13, 2010 12:48 PM
> To: linux-kernel@vger.kernel.org
> Cc: Shreyas Bhatewara; VMware, Inc.; netdev@vger.kernel.org
> Subject: [PATCH 14/25] drivers/net/vnxnet3: Use static const char
> arrays
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
>  drivers/net/vmxnet3/vmxnet3_int.h |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c
> b/drivers/net/vmxnet3/vmxnet3_drv.c
> index 198ce92..dfc0014 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -28,7 +28,7 @@
> 
>  #include "vmxnet3_int.h"
> 
> -char vmxnet3_driver_name[] = "vmxnet3";
> +const char vmxnet3_driver_name[] = "vmxnet3";
>  #define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver"
> 
>  /*
> diff --git a/drivers/net/vmxnet3/vmxnet3_int.h
> b/drivers/net/vmxnet3/vmxnet3_int.h
> index 2121c73..201fcf7 100644
> --- a/drivers/net/vmxnet3/vmxnet3_int.h
> +++ b/drivers/net/vmxnet3/vmxnet3_int.h
> @@ -384,5 +384,5 @@ vmxnet3_create_queues(struct vmxnet3_adapter
> *adapter,
>  extern void vmxnet3_set_ethtool_ops(struct net_device *netdev);
>  extern struct net_device_stats *vmxnet3_get_stats(struct net_device
> *netdev);
> 
> -extern char vmxnet3_driver_name[];
> +extern const char vmxnet3_driver_name[];
>  #endif
> --
> 1.7.3.rc1


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 20:08     ` Jonathan Cameron
  0 siblings, 0 replies; 88+ messages in thread
From: Jonathan Cameron @ 2010-09-13 20:08 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Jean Delvare (PC drivers, core),
	linux-i2c, Linus Walleij, Ben Dooks (embedded platforms),
	linux-arm-kernel

 Commit message is  somewhat inaccurate...

On 09/13/10 20:47, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
I'm guessing that there are never more than a couple of these.
Why is this method a better bet than just putting %d?
>  	dev->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 20:08     ` Jonathan Cameron
  0 siblings, 0 replies; 88+ messages in thread
From: Jonathan Cameron @ 2010-09-13 20:08 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jean Delvare (PC drivers,
	core),
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Linus Walleij,
	Ben Dooks (embedded platforms),
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

 Commit message is  somewhat inaccurate...

On 09/13/10 20:47, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
I'm guessing that there are never more than a couple of these.
Why is this method a better bet than just putting %d?
>  	dev->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 20:08     ` Jonathan Cameron
  0 siblings, 0 replies; 88+ messages in thread
From: Jonathan Cameron @ 2010-09-13 20:08 UTC (permalink / raw)
  To: linux-arm-kernel

 Commit message is  somewhat inaccurate...

On 09/13/10 20:47, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
I'm guessing that there are never more than a couple of these.
Why is this method a better bet than just putting %d?
>  	dev->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 20:16       ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 20:16 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-kernel, Jean Delvare (PC drivers, core),
	linux-i2c, Linus Walleij, Ben Dooks (embedded platforms),
	linux-arm-kernel

On Mon, 2010-09-13 at 21:08 +0100, Jonathan Cameron wrote:
> Commit message is  somewhat inaccurate...

Yeah, sorry 'bout that.
That's what I get for using a script.
I did write an intro with more complete description.

> > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> > @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	bus_nr = pdev->id;
> > -	clk_name[3] += (char)bus_nr;
> > +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> I'm guessing that there are never more than a couple of these.
> Why is this method a better bet than just putting %d?

It tries to standardize the style use and it avoids possible
future checkpatch warnings of:
	char foo[] = "bar"
char array could possibly be static const.

There was another use with "%1.1d" somewhere.

The end result is the same, so I don't really care much
if this sort of change is applied or not.  The possible
checkpatch message could just be considered noise but
Mike Frysinger seemed to prefer it, so I thought I could
try to accommodate him.

cheers, Joe


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 20:16       ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 20:16 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jean Delvare (PC drivers,
	core),
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Linus Walleij,
	Ben Dooks (embedded platforms),
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Mon, 2010-09-13 at 21:08 +0100, Jonathan Cameron wrote:
> Commit message is  somewhat inaccurate...

Yeah, sorry 'bout that.
That's what I get for using a script.
I did write an intro with more complete description.

> > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> > @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	bus_nr = pdev->id;
> > -	clk_name[3] += (char)bus_nr;
> > +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> I'm guessing that there are never more than a couple of these.
> Why is this method a better bet than just putting %d?

It tries to standardize the style use and it avoids possible
future checkpatch warnings of:
	char foo[] = "bar"
char array could possibly be static const.

There was another use with "%1.1d" somewhere.

The end result is the same, so I don't really care much
if this sort of change is applied or not.  The possible
checkpatch message could just be considered noise but
Mike Frysinger seemed to prefer it, so I thought I could
try to accommodate him.

cheers, Joe

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-13 20:16       ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2010-09-13 at 21:08 +0100, Jonathan Cameron wrote:
> Commit message is  somewhat inaccurate...

Yeah, sorry 'bout that.
That's what I get for using a script.
I did write an intro with more complete description.

> > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> > @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	bus_nr = pdev->id;
> > -	clk_name[3] += (char)bus_nr;
> > +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> I'm guessing that there are never more than a couple of these.
> Why is this method a better bet than just putting %d?

It tries to standardize the style use and it avoids possible
future checkpatch warnings of:
	char foo[] = "bar"
char array could possibly be static const.

There was another use with "%1.1d" somewhere.

The end result is the same, so I don't really care much
if this sort of change is applied or not.  The possible
checkpatch message could just be considered noise but
Mike Frysinger seemed to prefer it, so I thought I could
try to accommodate him.

cheers, Joe

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays
  2010-09-13 20:36     ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char Alan Cox
@ 2010-09-13 20:22       ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 20:22 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, David S. Miller, sparclinux

On Mon, 2010-09-13 at 21:36 +0100, Alan Cox wrote:
> On Mon, 13 Sep 2010 12:47:56 -0700
> Joe Perches <joe@perches.com> wrote:
> > diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
> > @@ -106,7 +106,7 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
> >  		if (of_console_options)
> >  			c = *of_console_options;
> >  
> > -		mode_prop[3] = c;
> > +		sprintf(mode_prop, "tty%c-mode", c);
> Whats the point of all this. It's trivial code being replaced by
> something complicated, harder to understand and much slower ?

There are many cases of char foo[] = "bar" that
should be actually be [static] const char foo[] etc.
The patch set was done to change those cases.

This case isn't actually any sort of saving.

As I just wrote in 5/25 to Jonathan Cameron:

It tries to standardize the style use and it avoids possible
future checkpatch warnings of:
	char foo[] = "bar"
char array could possibly be static const.

There was another use with "%1.1d" somewhere.

The end result is the same, so I don't really care much
if this sort of change is applied or not.  The possible
checkpatch message could just be considered noise but
Mike Frysinger seemed to prefer it, so I thought I could
try to accommodate him.

cheers, Joe


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char
@ 2010-09-13 20:22       ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 20:22 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, David S. Miller, sparclinux

On Mon, 2010-09-13 at 21:36 +0100, Alan Cox wrote:
> On Mon, 13 Sep 2010 12:47:56 -0700
> Joe Perches <joe@perches.com> wrote:
> > diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
> > @@ -106,7 +106,7 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
> >  		if (of_console_options)
> >  			c = *of_console_options;
> >  
> > -		mode_prop[3] = c;
> > +		sprintf(mode_prop, "tty%c-mode", c);
> Whats the point of all this. It's trivial code being replaced by
> something complicated, harder to understand and much slower ?

There are many cases of char foo[] = "bar" that
should be actually be [static] const char foo[] etc.
The patch set was done to change those cases.

This case isn't actually any sort of saving.

As I just wrote in 5/25 to Jonathan Cameron:

It tries to standardize the style use and it avoids possible
future checkpatch warnings of:
	char foo[] = "bar"
char array could possibly be static const.

There was another use with "%1.1d" somewhere.

The end result is the same, so I don't really care much
if this sort of change is applied or not.  The possible
checkpatch message could just be considered noise but
Mike Frysinger seemed to prefer it, so I thought I could
try to accommodate him.

cheers, Joe


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 24/25] sound: Use static const char arrays
  2010-09-13 19:48 ` [PATCH 24/25] sound: " Joe Perches
@ 2010-09-13 20:30     ` Takashi Iwai
  0 siblings, 0 replies; 88+ messages in thread
From: Takashi Iwai @ 2010-09-13 20:30 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, Jaroslav Kysela, alsa-devel

At Mon, 13 Sep 2010 12:48:02 -0700,
Joe Perches wrote:
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  sound/core/misc.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/core/misc.c b/sound/core/misc.c
> index 2c41825..0e5e77f 100644
> --- a/sound/core/misc.c
> +++ b/sound/core/misc.c
> @@ -64,12 +64,15 @@ 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[] = "<0>";
> +	char tmp[sizeof("<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;
>  	}

Would this case save something really...?


thanks,

Takashi

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 24/25] sound: Use static const char arrays
@ 2010-09-13 20:30     ` Takashi Iwai
  0 siblings, 0 replies; 88+ messages in thread
From: Takashi Iwai @ 2010-09-13 20:30 UTC (permalink / raw)
  To: Joe Perches; +Cc: alsa-devel, linux-kernel

At Mon, 13 Sep 2010 12:48:02 -0700,
Joe Perches wrote:
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  sound/core/misc.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/core/misc.c b/sound/core/misc.c
> index 2c41825..0e5e77f 100644
> --- a/sound/core/misc.c
> +++ b/sound/core/misc.c
> @@ -64,12 +64,15 @@ 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[] = "<0>";
> +	char tmp[sizeof("<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;
>  	}

Would this case save something really...?


thanks,

Takashi

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays
  2010-09-13 19:47   ` Joe Perches
@ 2010-09-13 20:36     ` Alan Cox
  -1 siblings, 0 replies; 88+ messages in thread
From: Alan Cox @ 2010-09-13 20:36 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, David S. Miller, sparclinux

On Mon, 13 Sep 2010 12:47:56 -0700
Joe Perches <joe@perches.com> wrote:

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/serial/suncore.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
> index 6381a02..f2a5b54 100644
> --- a/drivers/serial/suncore.c
> +++ b/drivers/serial/suncore.c
> @@ -84,8 +84,8 @@ EXPORT_SYMBOL(sunserial_console_match);
>  
>  void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
>  {
> +	char mode_prop[sizeof("ttyX-mode")];
>  	const char *mode, *s;
> -	char mode_prop[] = "ttyX-mode";
>  	int baud, bits, stop, cflag;
>  	char parity;
>  
> @@ -106,7 +106,7 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
>  		if (of_console_options)
>  			c = *of_console_options;
>  
> -		mode_prop[3] = c;
> +		sprintf(mode_prop, "tty%c-mode", c);

Whats the point of all this. It's trivial code being replaced by
something complicated, harder to understand and much slower ?

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char
@ 2010-09-13 20:36     ` Alan Cox
  0 siblings, 0 replies; 88+ messages in thread
From: Alan Cox @ 2010-09-13 20:36 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, David S. Miller, sparclinux

On Mon, 13 Sep 2010 12:47:56 -0700
Joe Perches <joe@perches.com> wrote:

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/serial/suncore.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
> index 6381a02..f2a5b54 100644
> --- a/drivers/serial/suncore.c
> +++ b/drivers/serial/suncore.c
> @@ -84,8 +84,8 @@ EXPORT_SYMBOL(sunserial_console_match);
>  
>  void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
>  {
> +	char mode_prop[sizeof("ttyX-mode")];
>  	const char *mode, *s;
> -	char mode_prop[] = "ttyX-mode";
>  	int baud, bits, stop, cflag;
>  	char parity;
>  
> @@ -106,7 +106,7 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
>  		if (of_console_options)
>  			c = *of_console_options;
>  
> -		mode_prop[3] = c;
> +		sprintf(mode_prop, "tty%c-mode", c);

Whats the point of all this. It's trivial code being replaced by
something complicated, harder to understand and much slower ?

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 20/25] drivers/usb: Use static const char arrays
  2010-09-13 19:47 ` [PATCH 20/25] drivers/usb: " Joe Perches
@ 2010-09-13 20:38   ` Greg KH
  0 siblings, 0 replies; 88+ messages in thread
From: Greg KH @ 2010-09-13 20:38 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, linux-usb

On Mon, Sep 13, 2010 at 12:47:58PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/usb/atm/ueagle-atm.c   |   14 +++++---------
>  drivers/usb/otg/langwell_otg.c |    2 +-
>  2 files changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
> index ea071a5..00d2516 100644
> --- a/drivers/usb/atm/ueagle-atm.c
> +++ b/drivers/usb/atm/ueagle-atm.c
> @@ -1574,20 +1574,16 @@ static int uea_stat_e4(struct uea_softc *sc)
>  
>  static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver)
>  {
> -	char file_arr[] = "CMVxy.bin";
> +	char file_arr[sizeof("CMVxy.bin")];
>  	char *file;
>  
>  	kparam_block_sysfs_write(cmv_file);
>  	/* set proper name corresponding modem version and line type */
>  	if (cmv_file[sc->modem_index] == NULL) {
> -		if (UEA_CHIP_VERSION(sc) == ADI930)
> -			file_arr[3] = '9';
> -		else if (UEA_CHIP_VERSION(sc) == EAGLE_IV)
> -			file_arr[3] = '4';
> -		else
> -			file_arr[3] = 'e';
> -
> -		file_arr[4] = IS_ISDN(sc) ? 'i' : 'p';
> +		sprintf(file_arr, "CMV%c%c.bin",
> +			(UEA_CHIP_VERSION(sc) == ADI930) ? '9' :
> +			(UEA_CHIP_VERSION(sc) == EAGLE_IV) ? '4' : 'e',
> +			IS_ISDN(sc) ? 'i' : 'p');

I despise : ? logic wherever possible, so no, I will not take this
patch, sorry.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 24/25] sound: Use static const char arrays
  2010-09-13 20:30     ` Takashi Iwai
  (?)
@ 2010-09-13 20:47     ` Joe Perches
  2010-09-13 21:33         ` Takashi Iwai
  -1 siblings, 1 reply; 88+ messages in thread
From: Joe Perches @ 2010-09-13 20:47 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: linux-kernel, Jaroslav Kysela, alsa-devel

On Mon, 2010-09-13 at 22:30 +0200, Takashi Iwai wrote:
> At Mon, 13 Sep 2010 12:48:02 -0700,
> Joe Perches wrote:
> > diff --git a/sound/core/misc.c b/sound/core/misc.c
> > -	char tmp[] = "<0>";
> > +	char tmp[sizeof("<0>")];
> Would this case save something really...?

Not really.  It's the same x86 code size with different opcodes.
It's just a stupid checkpatch future warning avoidance change.
Ignore it at your pleasure.

cheers, Joe


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays
  2010-09-13 20:22       ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char Joe Perches
@ 2010-09-13 21:11         ` Nick Bowler
  -1 siblings, 0 replies; 88+ messages in thread
From: Nick Bowler @ 2010-09-13 21:11 UTC (permalink / raw)
  To: Joe Perches; +Cc: Alan Cox, linux-kernel, David S. Miller, sparclinux

On 2010-09-13 13:22 -0700, Joe Perches wrote:
> It tries to standardize the style use and it avoids possible
> future checkpatch warnings of:
> 	char foo[] = "bar"
> char array could possibly be static const.

Whoa, back up a second here.  I've seen patches to avoid questionable
checkpatch warnings before, but I think this is the first time I've seen
a patch to avoid *hypothetical checkpatch warnings that don't even
exist*!

-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char
@ 2010-09-13 21:11         ` Nick Bowler
  0 siblings, 0 replies; 88+ messages in thread
From: Nick Bowler @ 2010-09-13 21:11 UTC (permalink / raw)
  To: Joe Perches; +Cc: Alan Cox, linux-kernel, David S. Miller, sparclinux

On 2010-09-13 13:22 -0700, Joe Perches wrote:
> It tries to standardize the style use and it avoids possible
> future checkpatch warnings of:
> 	char foo[] = "bar"
> char array could possibly be static const.

Whoa, back up a second here.  I've seen patches to avoid questionable
checkpatch warnings before, but I think this is the first time I've seen
a patch to avoid *hypothetical checkpatch warnings that don't even
exist*!

-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays
  2010-09-13 21:11         ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char Nick Bowler
@ 2010-09-13 21:17           ` Joe Perches
  -1 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 21:17 UTC (permalink / raw)
  To: Nick Bowler; +Cc: Alan Cox, linux-kernel, David S. Miller, sparclinux

On Mon, 2010-09-13 at 17:11 -0400, Nick Bowler wrote:
> On 2010-09-13 13:22 -0700, Joe Perches wrote:
> > It tries to standardize the style use and it avoids possible
> > future checkpatch warnings of:
> > 	char foo[] = "bar"
> > char array could possibly be static const.
> Whoa, back up a second here.  I've seen patches to avoid questionable
> checkpatch warnings before, but I think this is the first time I've seen
> a patch to avoid *hypothetical checkpatch warnings that don't even
> exist*!

Pretty cool huh?  cheers, Joe


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char
@ 2010-09-13 21:17           ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 21:17 UTC (permalink / raw)
  To: Nick Bowler; +Cc: Alan Cox, linux-kernel, David S. Miller, sparclinux

On Mon, 2010-09-13 at 17:11 -0400, Nick Bowler wrote:
> On 2010-09-13 13:22 -0700, Joe Perches wrote:
> > It tries to standardize the style use and it avoids possible
> > future checkpatch warnings of:
> > 	char foo[] = "bar"
> > char array could possibly be static const.
> Whoa, back up a second here.  I've seen patches to avoid questionable
> checkpatch warnings before, but I think this is the first time I've seen
> a patch to avoid *hypothetical checkpatch warnings that don't even
> exist*!

Pretty cool huh?  cheers, Joe


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 24/25] sound: Use static const char arrays
  2010-09-13 20:47     ` Joe Perches
@ 2010-09-13 21:33         ` Takashi Iwai
  0 siblings, 0 replies; 88+ messages in thread
From: Takashi Iwai @ 2010-09-13 21:33 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, Jaroslav Kysela, alsa-devel

At Mon, 13 Sep 2010 13:47:45 -0700,
Joe Perches wrote:
> 
> On Mon, 2010-09-13 at 22:30 +0200, Takashi Iwai wrote:
> > At Mon, 13 Sep 2010 12:48:02 -0700,
> > Joe Perches wrote:
> > > diff --git a/sound/core/misc.c b/sound/core/misc.c
> > > -	char tmp[] = "<0>";
> > > +	char tmp[sizeof("<0>")];
> > Would this case save something really...?
> 
> Not really.  It's the same x86 code size with different opcodes.
> It's just a stupid checkpatch future warning avoidance change.
> Ignore it at your pleasure.

OK, then let's postpone.
The current code is indeed not sexy, but the patch won't improve
the readability much, too ;)


thanks,

Takashi


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 24/25] sound: Use static const char arrays
@ 2010-09-13 21:33         ` Takashi Iwai
  0 siblings, 0 replies; 88+ messages in thread
From: Takashi Iwai @ 2010-09-13 21:33 UTC (permalink / raw)
  To: Joe Perches; +Cc: alsa-devel, linux-kernel

At Mon, 13 Sep 2010 13:47:45 -0700,
Joe Perches wrote:
> 
> On Mon, 2010-09-13 at 22:30 +0200, Takashi Iwai wrote:
> > At Mon, 13 Sep 2010 12:48:02 -0700,
> > Joe Perches wrote:
> > > diff --git a/sound/core/misc.c b/sound/core/misc.c
> > > -	char tmp[] = "<0>";
> > > +	char tmp[sizeof("<0>")];
> > Would this case save something really...?
> 
> Not really.  It's the same x86 code size with different opcodes.
> It's just a stupid checkpatch future warning avoidance change.
> Ignore it at your pleasure.

OK, then let's postpone.
The current code is indeed not sexy, but the patch won't improve
the readability much, too ;)


thanks,

Takashi

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 07/25] drivers/media: Use static const char arrays
  2010-09-13 19:47 ` [PATCH 07/25] drivers/media: " Joe Perches
@ 2010-09-13 21:50   ` Mauro Carvalho Chehab
  2010-09-13 22:07     ` [PATCH 07/25] drivers/media/video/zoran: Don't use initialized char array Joe Perches
  0 siblings, 1 reply; 88+ messages in thread
From: Mauro Carvalho Chehab @ 2010-09-13 21:50 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, mjpeg-users, linux-media

Em 13-09-2010 16:47, Joe Perches escreveu:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/media/video/zoran/zoran_device.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/video/zoran/zoran_device.c b/drivers/media/video/zoran/zoran_device.c
> index 6f846ab..ea8a1e9 100644
> --- a/drivers/media/video/zoran/zoran_device.c
> +++ b/drivers/media/video/zoran/zoran_device.c
> @@ -1470,8 +1470,7 @@ zoran_irq (int             irq,
>  		    (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS ||
>  		     zr->codec_mode == BUZ_MODE_MOTION_COMPRESS)) {
>  			if (zr36067_debug > 1 && (!zr->frame_num || zr->JPEG_error)) {
> -				char sc[] = "0000";
> -				char sv[5];
> +				char sv[sizeof("0000")];
>  				int i;
>  
>  				printk(KERN_INFO
> @@ -1481,7 +1480,7 @@ zoran_irq (int             irq,
>  				       zr->jpg_settings.field_per_buff,
>  				       zr->JPEG_missed);
>  
> -				strcpy(sv, sc);
> +				strcpy(sv, "0000");
>  				for (i = 0; i < 4; i++) {
>  					if (le32_to_cpu(zr->stat_com[i]) & 1)
>  						sv[i] = '1';

This looks ugly to me, as someone may change the string at strcpy and not change at sizeof.
Could you please try to work on a better alternative?

The cleaner way seems to be to rewrite it as:

#define BUZ_MODE_STAT	4

char sv[BUZ_MODE_STAT + 1];
...
for (i = 0; i < BUZ_MODE_STAT; i++)
	sv[i] = (le32_to_cpu(zr->stat_com[i]) & 1)? '1' : '0';



Cheers,
Mauro

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 07/25] drivers/media/video/zoran: Don't use initialized char array
  2010-09-13 21:50   ` Mauro Carvalho Chehab
@ 2010-09-13 22:07     ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-13 22:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-kernel, mjpeg-users, linux-media

Just fill the array as necessary and terminate with 0

Signed-off-by: Joe Perches <joe@perches.com>
---
diff --git a/drivers/media/video/zoran/zoran_device.c b/drivers/media/video/zoran/zoran_device.c
index 6f846ab..b02007e 100644
--- a/drivers/media/video/zoran/zoran_device.c
+++ b/drivers/media/video/zoran/zoran_device.c
@@ -1470,8 +1470,7 @@ zoran_irq (int             irq,
 		    (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS ||
 		     zr->codec_mode == BUZ_MODE_MOTION_COMPRESS)) {
 			if (zr36067_debug > 1 && (!zr->frame_num || zr->JPEG_error)) {
-				char sc[] = "0000";
-				char sv[5];
+				char sv[BUZ_NUM_STAT_COM + 1];
 				int i;
 
 				printk(KERN_INFO
@@ -1481,12 +1480,9 @@ zoran_irq (int             irq,
 				       zr->jpg_settings.field_per_buff,
 				       zr->JPEG_missed);
 
-				strcpy(sv, sc);
-				for (i = 0; i < 4; i++) {
-					if (le32_to_cpu(zr->stat_com[i]) & 1)
-						sv[i] = '1';
-				}
-				sv[4] = 0;
+				for (i = 0; i < BUZ_NUM_STAT_COM; i++)
+					sv[i] = le32_to_cpu(zr->stat_com[i]) & 1 ? '1' : '0';
+				sv[BUZ_NUM_STAT_COM] = 0;
 				printk(KERN_INFO
 				       "%s: stat_com=%s queue_state=%ld/%ld/%ld/%ld\n",
 				       ZR_DEVNAME(zr), sv,



^ permalink raw reply related	[flat|nested] 88+ messages in thread

* Re: [PATCH 02/25] arch/powerpc: Use static const char arrays
  2010-09-13 19:47   ` Joe Perches
@ 2010-09-14  2:02     ` Stephen Rothwell
  -1 siblings, 0 replies; 88+ messages in thread
From: Stephen Rothwell @ 2010-09-14  2:02 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, Paul Mackerras, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

Hi Joe,

On Mon, 13 Sep 2010 12:47:40 -0700 Joe Perches <joe@perches.com> wrote:
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/powerpc/boot/addnote.c    |    4 ++--
>  arch/powerpc/boot/cuboot-c2k.c |    4 ++--
>  arch/powerpc/kernel/irq.c      |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)

I am also unsure that the transformation to cuboot-c2k.c adds anything.
Other than that

Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 02/25] arch/powerpc: Use static const char arrays
@ 2010-09-14  2:02     ` Stephen Rothwell
  0 siblings, 0 replies; 88+ messages in thread
From: Stephen Rothwell @ 2010-09-14  2:02 UTC (permalink / raw)
  To: Joe Perches; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

Hi Joe,

On Mon, 13 Sep 2010 12:47:40 -0700 Joe Perches <joe@perches.com> wrote:
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  arch/powerpc/boot/addnote.c    |    4 ++--
>  arch/powerpc/boot/cuboot-c2k.c |    4 ++--
>  arch/powerpc/kernel/irq.c      |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)

I am also unsure that the transformation to cuboot-c2k.c adds anything.
Other than that

Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 02/25] arch/powerpc: Use static const char arrays
  2010-09-13 19:47   ` Joe Perches
@ 2010-09-14  2:04     ` Stephen Rothwell
  -1 siblings, 0 replies; 88+ messages in thread
From: Stephen Rothwell @ 2010-09-14  2:04 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Paul Mackerras, linuxppc-dev, Benjamin Herrenschmidt

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

BTW, Ben Herrenschmidt is the current PowerPC maintainer.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 02/25] arch/powerpc: Use static const char arrays
@ 2010-09-14  2:04     ` Stephen Rothwell
  0 siblings, 0 replies; 88+ messages in thread
From: Stephen Rothwell @ 2010-09-14  2:04 UTC (permalink / raw)
  To: Joe Perches; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

BTW, Ben Herrenschmidt is the current PowerPC maintainer.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 04/25] drivers/char: Use static const char arrays
  2010-09-13 19:47 ` [PATCH 04/25] drivers/char: " Joe Perches
@ 2010-09-14  2:06     ` Stephen Rothwell
  0 siblings, 0 replies; 88+ messages in thread
From: Stephen Rothwell @ 2010-09-14  2:06 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

Hi Joe,

On Mon, 13 Sep 2010 12:47:42 -0700 Joe Perches <joe@perches.com> wrote:
>
> Signed-off-by: Joe Perches <joe@perches.com>

Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 04/25] drivers/char: Use static const char arrays
@ 2010-09-14  2:06     ` Stephen Rothwell
  0 siblings, 0 replies; 88+ messages in thread
From: Stephen Rothwell @ 2010-09-14  2:06 UTC (permalink / raw)
  To: Joe Perches; +Cc: linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

Hi Joe,

On Mon, 13 Sep 2010 12:47:42 -0700 Joe Perches <joe@perches.com> wrote:
>
> Signed-off-by: Joe Perches <joe@perches.com>

Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au>

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
  2010-09-13 20:08     ` Jonathan Cameron
  (?)
@ 2010-09-14  7:36       ` Lothar Waßmann
  -1 siblings, 0 replies; 88+ messages in thread
From: Lothar Waßmann @ 2010-09-14  7:36 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Joe Perches, Linus Walleij, linux-kernel, linux-i2c,
	Ben Dooks (embedded platforms), Jean Delvare (PC drivers, core),
	linux-arm-kernel

Hi,

Jonathan Cameron writes:
>  Commit message is  somewhat inaccurate...
> 
> On 09/13/10 20:47, Joe Perches wrote:
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >  drivers/i2c/busses/i2c-stu300.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> > index 495be45..2f7c09c 100644
> > --- a/drivers/i2c/busses/i2c-stu300.c
> > +++ b/drivers/i2c/busses/i2c-stu300.c
> > @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
> >  	struct resource *res;
> >  	int bus_nr;
> >  	int ret = 0;
> > -	char clk_name[] = "I2C0";
> > +	char clk_name[sizeof("I2Cx")];
> >  
> >  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
> >  	if (!dev) {
> > @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	bus_nr = pdev->id;
> > -	clk_name[3] += (char)bus_nr;
> > +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> I'm guessing that there are never more than a couple of these.
> Why is this method a better bet than just putting %d?
>
'%c' will only ever produce one byte of output while '%d' may
produce up to 11 bytes depending on the value of bus_nr thus
overflowing the buffer.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14  7:36       ` Lothar Waßmann
  0 siblings, 0 replies; 88+ messages in thread
From: Lothar Waßmann @ 2010-09-14  7:36 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Linus Walleij, linux-kernel, Jean Delvare (PC drivers, core),
	linux-i2c, Ben Dooks (embedded platforms),
	Joe Perches, linux-arm-kernel

Hi,

Jonathan Cameron writes:
>  Commit message is  somewhat inaccurate...
> 
> On 09/13/10 20:47, Joe Perches wrote:
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >  drivers/i2c/busses/i2c-stu300.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> > index 495be45..2f7c09c 100644
> > --- a/drivers/i2c/busses/i2c-stu300.c
> > +++ b/drivers/i2c/busses/i2c-stu300.c
> > @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
> >  	struct resource *res;
> >  	int bus_nr;
> >  	int ret = 0;
> > -	char clk_name[] = "I2C0";
> > +	char clk_name[sizeof("I2Cx")];
> >  
> >  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
> >  	if (!dev) {
> > @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	bus_nr = pdev->id;
> > -	clk_name[3] += (char)bus_nr;
> > +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> I'm guessing that there are never more than a couple of these.
> Why is this method a better bet than just putting %d?
>
'%c' will only ever produce one byte of output while '%d' may
produce up to 11 bytes depending on the value of bus_nr thus
overflowing the buffer.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14  7:36       ` Lothar Waßmann
  0 siblings, 0 replies; 88+ messages in thread
From: Lothar Waßmann @ 2010-09-14  7:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Jonathan Cameron writes:
>  Commit message is  somewhat inaccurate...
> 
> On 09/13/10 20:47, Joe Perches wrote:
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >  drivers/i2c/busses/i2c-stu300.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> > index 495be45..2f7c09c 100644
> > --- a/drivers/i2c/busses/i2c-stu300.c
> > +++ b/drivers/i2c/busses/i2c-stu300.c
> > @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
> >  	struct resource *res;
> >  	int bus_nr;
> >  	int ret = 0;
> > -	char clk_name[] = "I2C0";
> > +	char clk_name[sizeof("I2Cx")];
> >  
> >  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
> >  	if (!dev) {
> > @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	bus_nr = pdev->id;
> > -	clk_name[3] += (char)bus_nr;
> > +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> I'm guessing that there are never more than a couple of these.
> Why is this method a better bet than just putting %d?
>
'%c' will only ever produce one byte of output while '%d' may
produce up to 11 bytes depending on the value of bus_nr thus
overflowing the buffer.


Lothar Wa?mann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________

^ permalink raw reply	[flat|nested] 88+ messages in thread

* (unknown)
  2010-09-13 19:47 ` Joe Perches
  (?)
@ 2010-09-14  9:14   ` David Howells
  -1 siblings, 0 replies; 88+ messages in thread
From: David Howells @ 2010-09-14  9:14 UTC (permalink / raw)
  To: Joe Perches
  Cc: Amit Kumar Salecha, linux-fbdev, linux-usb, Karsten Keil,
	James Smart, linux-mips, VMware, Inc.,
	Bruce Allan, PJ Waskiewicz, Shreyas Bhatewara, alsa-devel,
	Jaroslav Kysela, dhowells, James E.J. Bottomley, Paul Mackerras,
	linux-i2c, Brett Rudley, sparclinux, devel, linux-s390,
	linux-scsi, Florian Tobias Schandinat, e1000-devel,
	Jesse Brandeburg, linux-acpi

Joe Perches <joe@perches.com> wrote:

> Using static const char foo[] = "bar" can save some
> code and text space, so change the places where it's possible.

That's reasonable.

> Also change the places that use
> 	char foo[] = "barX";
> 	...
> 	foo[3] = value + '0';
> where X is typically changed
> 	char foo[sizeof("barX")];
> 	...
> 	sprintf(foo, "bar%c", value + '0');

You haven't said what this gains.  I can see what it may cost, though
(depending on how gcc loads foo[]).

David

^ permalink raw reply	[flat|nested] 88+ messages in thread

* (no subject)
@ 2010-09-14  9:14   ` David Howells
  0 siblings, 0 replies; 88+ messages in thread
From: David Howells @ 2010-09-14  9:14 UTC (permalink / raw)
  To: Joe Perches
  Cc: dhowells, linux-kernel, Amit Kumar Salecha, linux-fbdev,
	Greg Kroah-Hartman, James Smart, linux-mips, VMware, Inc.,
	PJ Waskiewicz, Shreyas Bhatewara, alsa-devel, Jaroslav Kysela,
	J. Bruce Fields, James E.J. Bottomley, Paul Mackerras, linux-i2c,
	Brett Rudley, sparclinux, Martin Schwidefsky, devel, linux-s390,
	linux-acpi, linux-scsi, Florian Tobias Schandinat, e1000-devel,
	Trond Myklebust, Jesse Brandeburg, Neil Brown, Jeff Kirsher,
	linux-wireless, Ingo Molnar, linux-usb, Len Brown, Alex Duyck,
	Peter Zijlstra, Henry Ptasinski, Heiko Carstens,
	Thomas Winischhofer, Mauro Carvalho Chehab,
	Arnaldo Carvalho de Melo, Jean Delvare (PC drivers, core),
	mjpeg-users, Ben Dooks (embedded platforms),
	linux-nfs, linux-arm-kernel, Neela Syam Kolli, Karsten Keil,
	Linus Walleij, netdev, Anirban Chakraborty, Bruce Allan

Joe Perches <joe@perches.com> wrote:

> Using static const char foo[] = "bar" can save some
> code and text space, so change the places where it's possible.

That's reasonable.

> Also change the places that use
> 	char foo[] = "barX";
> 	...
> 	foo[3] = value + '0';
> where X is typically changed
> 	char foo[sizeof("barX")];
> 	...
> 	sprintf(foo, "bar%c", value + '0');

You haven't said what this gains.  I can see what it may cost, though
(depending on how gcc loads foo[]).

David

^ permalink raw reply	[flat|nested] 88+ messages in thread

* (no subject)
@ 2010-09-14  9:14   ` David Howells
  0 siblings, 0 replies; 88+ messages in thread
From: David Howells @ 2010-09-14  9:14 UTC (permalink / raw)
  To: Joe Perches
  Cc: dhowells, linux-kernel, Amit Kumar Salecha, linux-fbdev,
	Greg Kroah-Hartman, James Smart, linux-mips, VMware, Inc.,
	PJ Waskiewicz, Shreyas Bhatewara, alsa-devel, Jaroslav Kysela,
	J. Bruce Fields, James E.J. Bottomley, Paul Mackerras, linux-i2c,
	Brett Rudley, sparclinux, Martin Schwidefsky, devel, linux-s390,
	linux-acpi, linux-scsi, Florian Tobias Schandinat, e1000-devel,
	Trond Myklebust, Jesse Brandeburg, Neil Brown, Jeff Kirsher,
	linux-wireless, Ingo Molnar, linux-usb, Len Brown, Alex Duyck,
	Peter Zijlstra, Henry Ptasinski, Heiko Carstens,
	Thomas Winischhofer, Mauro Carvalho Chehab,
	Arnaldo Carvalho de Melo, Jean Delvare (PC drivers, core),
	mjpeg-users, Ben Dooks (embedded platforms),
	linux-nfs, linux-arm-kernel, Neela Syam Kolli, Karsten Keil,
	Linus Walleij, netdev, Anirban Chakraborty, Bruce Allan

Joe Perches <joe@perches.com> wrote:

> Using static const char foo[] = "bar" can save some
> code and text space, so change the places where it's possible.

That's reasonable.

> Also change the places that use
> 	char foo[] = "barX";
> 	...
> 	foo[3] = value + '0';
> where X is typically changed
> 	char foo[sizeof("barX")];
> 	...
> 	sprintf(foo, "bar%c", value + '0');

You haven't said what this gains.  I can see what it may cost, though
(depending on how gcc loads foo[]).

David

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 12:57         ` Jonathan Cameron
  0 siblings, 0 replies; 88+ messages in thread
From: Jonathan Cameron @ 2010-09-14 12:57 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: Jonathan Cameron, Joe Perches, Linus Walleij, linux-kernel,
	linux-i2c, Ben Dooks (embedded platforms),
	Jean Delvare (PC drivers, core),
	linux-arm-kernel

On 09/14/10 08:36, Lothar Waßmann wrote:
> Hi,
> 
> Jonathan Cameron writes:
>>  Commit message is  somewhat inaccurate...
>>
>> On 09/13/10 20:47, Joe Perches wrote:
>>> Signed-off-by: Joe Perches <joe@perches.com>
>>> ---
>>>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
>>> index 495be45..2f7c09c 100644
>>> --- a/drivers/i2c/busses/i2c-stu300.c
>>> +++ b/drivers/i2c/busses/i2c-stu300.c
>>> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>>>  	struct resource *res;
>>>  	int bus_nr;
>>>  	int ret = 0;
>>> -	char clk_name[] = "I2C0";
>>> +	char clk_name[sizeof("I2Cx")];
>>>  
>>>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>>>  	if (!dev) {
>>> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>>>  	}
>>>  
>>>  	bus_nr = pdev->id;
>>> -	clk_name[3] += (char)bus_nr;
>>> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
>> I'm guessing that there are never more than a couple of these.
>> Why is this method a better bet than just putting %d?
>>
> '%c' will only ever produce one byte of output while '%d' may
> produce up to 11 bytes depending on the value of bus_nr thus
> overflowing the buffer.
Then use an snprintf, or apply a check to ensure it isn't bigger than
9.

If you don't mind having clocks named i2c$ or something equally
silly then I guess this is fine.  To my mind, if that is possible
this is a bug that should be fixed rather than avoided.



^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 12:57         ` Jonathan Cameron
  0 siblings, 0 replies; 88+ messages in thread
From: Jonathan Cameron @ 2010-09-14 12:57 UTC (permalink / raw)
  To: Lothar Waßmann
  Cc: Jonathan Cameron, Joe Perches, Linus Walleij,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks (embedded platforms),
	Jean Delvare (PC drivers, core),
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 09/14/10 08:36, Lothar Waßmann wrote:
> Hi,
> 
> Jonathan Cameron writes:
>>  Commit message is  somewhat inaccurate...
>>
>> On 09/13/10 20:47, Joe Perches wrote:
>>> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
>>> ---
>>>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
>>> index 495be45..2f7c09c 100644
>>> --- a/drivers/i2c/busses/i2c-stu300.c
>>> +++ b/drivers/i2c/busses/i2c-stu300.c
>>> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>>>  	struct resource *res;
>>>  	int bus_nr;
>>>  	int ret = 0;
>>> -	char clk_name[] = "I2C0";
>>> +	char clk_name[sizeof("I2Cx")];
>>>  
>>>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>>>  	if (!dev) {
>>> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>>>  	}
>>>  
>>>  	bus_nr = pdev->id;
>>> -	clk_name[3] += (char)bus_nr;
>>> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
>> I'm guessing that there are never more than a couple of these.
>> Why is this method a better bet than just putting %d?
>>
> '%c' will only ever produce one byte of output while '%d' may
> produce up to 11 bytes depending on the value of bus_nr thus
> overflowing the buffer.
Then use an snprintf, or apply a check to ensure it isn't bigger than
9.

If you don't mind having clocks named i2c$ or something equally
silly then I guess this is fine.  To my mind, if that is possible
this is a bug that should be fixed rather than avoided.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 12:57         ` Jonathan Cameron
  0 siblings, 0 replies; 88+ messages in thread
From: Jonathan Cameron @ 2010-09-14 12:57 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/14/10 08:36, Lothar Wa?mann wrote:
> Hi,
> 
> Jonathan Cameron writes:
>>  Commit message is  somewhat inaccurate...
>>
>> On 09/13/10 20:47, Joe Perches wrote:
>>> Signed-off-by: Joe Perches <joe@perches.com>
>>> ---
>>>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
>>> index 495be45..2f7c09c 100644
>>> --- a/drivers/i2c/busses/i2c-stu300.c
>>> +++ b/drivers/i2c/busses/i2c-stu300.c
>>> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>>>  	struct resource *res;
>>>  	int bus_nr;
>>>  	int ret = 0;
>>> -	char clk_name[] = "I2C0";
>>> +	char clk_name[sizeof("I2Cx")];
>>>  
>>>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>>>  	if (!dev) {
>>> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>>>  	}
>>>  
>>>  	bus_nr = pdev->id;
>>> -	clk_name[3] += (char)bus_nr;
>>> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
>> I'm guessing that there are never more than a couple of these.
>> Why is this method a better bet than just putting %d?
>>
> '%c' will only ever produce one byte of output while '%d' may
> produce up to 11 bytes depending on the value of bus_nr thus
> overflowing the buffer.
Then use an snprintf, or apply a check to ensure it isn't bigger than
9.

If you don't mind having clocks named i2c$ or something equally
silly then I guess this is fine.  To my mind, if that is possible
this is a bug that should be fixed rather than avoided.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 15/25] drivers/net/wireless/ipw2x00: Use static const char arrays
  2010-09-13 19:47 ` [PATCH 15/25] drivers/net/wireless/ipw2x00: " Joe Perches
@ 2010-09-14 18:41   ` John W. Linville
  0 siblings, 0 replies; 88+ messages in thread
From: John W. Linville @ 2010-09-14 18:41 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, linux-wireless, netdev

On Mon, Sep 13, 2010 at 12:47:53PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/net/wireless/ipw2x00/ipw2100.c       |    2 +-
>  drivers/net/wireless/ipw2x00/ipw2200.c       |    2 +-
>  drivers/net/wireless/ipw2x00/libipw_module.c |    2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index 61915f3..f64103c 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -4261,7 +4261,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr,
>  {
>  	struct ipw2100_priv *priv = dev_get_drvdata(d);
>  	struct net_device *dev = priv->net_dev;
> -	char buffer[] = "00000000";
> +	char buffer[sizeof("00000000")];
>  	unsigned long len =
>  	    (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1;
>  	unsigned long val;

Had to look twice, since you replaced an initialization with a
declaration.  But in all these cases the initial value was already
being overwritten before use anyway.

Acked-by: John W. Linville <linville@tuxdriver.com>

> diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
> index 0f25083..75e83c9 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2200.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
> @@ -1486,7 +1486,7 @@ static ssize_t store_scan_age(struct device *d, struct device_attribute *attr,
>  {
>  	struct ipw_priv *priv = dev_get_drvdata(d);
>  	struct net_device *dev = priv->net_dev;
> -	char buffer[] = "00000000";
> +	char buffer[sizeof("00000000")];
>  	unsigned long len =
>  	    (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1;
>  	unsigned long val;
> diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
> index 32dee2c..d0c8a67 100644
> --- a/drivers/net/wireless/ipw2x00/libipw_module.c
> +++ b/drivers/net/wireless/ipw2x00/libipw_module.c
> @@ -261,7 +261,7 @@ static int debug_level_proc_open(struct inode *inode, struct file *file)
>  static ssize_t debug_level_proc_write(struct file *file,
>  		const char __user *buffer, size_t count, loff_t *pos)
>  {
> -	char buf[] = "0x00000000\n";
> +	char buf[sizeof("0x00000000\n")];
>  	size_t len = min(sizeof(buf) - 1, count);
>  	unsigned long val;
>  
> -- 
> 1.7.3.rc1
> 
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 19:48           ` Russell King - ARM Linux
  0 siblings, 0 replies; 88+ messages in thread
From: Russell King - ARM Linux @ 2010-09-14 19:48 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lothar Waßmann, Linus Walleij, linux-kernel,
	Jonathan Cameron, Jean Delvare (PC drivers, core),
	linux-i2c, Ben Dooks (embedded platforms),
	Joe Perches, linux-arm-kernel

On Tue, Sep 14, 2010 at 01:57:59PM +0100, Jonathan Cameron wrote:
> On 09/14/10 08:36, Lothar Waßmann wrote:
> > Hi,
> > 
> > Jonathan Cameron writes:
> >>  Commit message is  somewhat inaccurate...
> >>
> >> On 09/13/10 20:47, Joe Perches wrote:
> >>> Signed-off-by: Joe Perches <joe@perches.com>
> >>> ---
> >>>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
> >>>  1 files changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> >>> index 495be45..2f7c09c 100644
> >>> --- a/drivers/i2c/busses/i2c-stu300.c
> >>> +++ b/drivers/i2c/busses/i2c-stu300.c
> >>> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
> >>>  	struct resource *res;
> >>>  	int bus_nr;
> >>>  	int ret = 0;
> >>> -	char clk_name[] = "I2C0";
> >>> +	char clk_name[sizeof("I2Cx")];
> >>>  
> >>>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
> >>>  	if (!dev) {
> >>> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >>>  	}
> >>>  
> >>>  	bus_nr = pdev->id;
> >>> -	clk_name[3] += (char)bus_nr;
> >>> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> >> I'm guessing that there are never more than a couple of these.
> >> Why is this method a better bet than just putting %d?
> >>
> > '%c' will only ever produce one byte of output while '%d' may
> > produce up to 11 bytes depending on the value of bus_nr thus
> > overflowing the buffer.
> Then use an snprintf, or apply a check to ensure it isn't bigger than
> 9.
> 
> If you don't mind having clocks named i2c$ or something equally
> silly then I guess this is fine.  To my mind, if that is possible
> this is a bug that should be fixed rather than avoided.

Even better, fix the implementation so that it conforms to the API
spec rather than doing its own thing with the consumer connection ID
argument and ignoring the struct device argument.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 19:48           ` Russell King - ARM Linux
  0 siblings, 0 replies; 88+ messages in thread
From: Russell King - ARM Linux @ 2010-09-14 19:48 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lothar Waßmann, Linus Walleij,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Jonathan Cameron,
	Jean Delvare (PC drivers, core),
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Ben Dooks (embedded platforms),
	Joe Perches, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Sep 14, 2010 at 01:57:59PM +0100, Jonathan Cameron wrote:
> On 09/14/10 08:36, Lothar Waßmann wrote:
> > Hi,
> > 
> > Jonathan Cameron writes:
> >>  Commit message is  somewhat inaccurate...
> >>
> >> On 09/13/10 20:47, Joe Perches wrote:
> >>> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> >>> ---
> >>>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
> >>>  1 files changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> >>> index 495be45..2f7c09c 100644
> >>> --- a/drivers/i2c/busses/i2c-stu300.c
> >>> +++ b/drivers/i2c/busses/i2c-stu300.c
> >>> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
> >>>  	struct resource *res;
> >>>  	int bus_nr;
> >>>  	int ret = 0;
> >>> -	char clk_name[] = "I2C0";
> >>> +	char clk_name[sizeof("I2Cx")];
> >>>  
> >>>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
> >>>  	if (!dev) {
> >>> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >>>  	}
> >>>  
> >>>  	bus_nr = pdev->id;
> >>> -	clk_name[3] += (char)bus_nr;
> >>> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> >> I'm guessing that there are never more than a couple of these.
> >> Why is this method a better bet than just putting %d?
> >>
> > '%c' will only ever produce one byte of output while '%d' may
> > produce up to 11 bytes depending on the value of bus_nr thus
> > overflowing the buffer.
> Then use an snprintf, or apply a check to ensure it isn't bigger than
> 9.
> 
> If you don't mind having clocks named i2c$ or something equally
> silly then I guess this is fine.  To my mind, if that is possible
> this is a bug that should be fixed rather than avoided.

Even better, fix the implementation so that it conforms to the API
spec rather than doing its own thing with the consumer connection ID
argument and ignoring the struct device argument.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 19:48           ` Russell King - ARM Linux
  0 siblings, 0 replies; 88+ messages in thread
From: Russell King - ARM Linux @ 2010-09-14 19:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 14, 2010 at 01:57:59PM +0100, Jonathan Cameron wrote:
> On 09/14/10 08:36, Lothar Wa?mann wrote:
> > Hi,
> > 
> > Jonathan Cameron writes:
> >>  Commit message is  somewhat inaccurate...
> >>
> >> On 09/13/10 20:47, Joe Perches wrote:
> >>> Signed-off-by: Joe Perches <joe@perches.com>
> >>> ---
> >>>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
> >>>  1 files changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> >>> index 495be45..2f7c09c 100644
> >>> --- a/drivers/i2c/busses/i2c-stu300.c
> >>> +++ b/drivers/i2c/busses/i2c-stu300.c
> >>> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
> >>>  	struct resource *res;
> >>>  	int bus_nr;
> >>>  	int ret = 0;
> >>> -	char clk_name[] = "I2C0";
> >>> +	char clk_name[sizeof("I2Cx")];
> >>>  
> >>>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
> >>>  	if (!dev) {
> >>> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
> >>>  	}
> >>>  
> >>>  	bus_nr = pdev->id;
> >>> -	clk_name[3] += (char)bus_nr;
> >>> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
> >> I'm guessing that there are never more than a couple of these.
> >> Why is this method a better bet than just putting %d?
> >>
> > '%c' will only ever produce one byte of output while '%d' may
> > produce up to 11 bytes depending on the value of bus_nr thus
> > overflowing the buffer.
> Then use an snprintf, or apply a check to ensure it isn't bigger than
> 9.
> 
> If you don't mind having clocks named i2c$ or something equally
> silly then I guess this is fine.  To my mind, if that is possible
> this is a bug that should be fixed rather than avoided.

Even better, fix the implementation so that it conforms to the API
spec rather than doing its own thing with the consumer connection ID
argument and ignoring the struct device argument.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 23:23     ` Ben Dooks
  0 siblings, 0 replies; 88+ messages in thread
From: Ben Dooks @ 2010-09-14 23:23 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Linus Walleij, Jean Delvare (PC drivers, core),
	Ben Dooks (embedded platforms),
	linux-arm-kernel, linux-i2c

On Mon, Sep 13, 2010 at 12:47:43PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
>  	dev->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);

personally, i'd prefer to see snprintf() used, to ensure that this sort
of thing never goes wrong if people decde to change the string. It is
a pitty there's no good way of temporarily allocating data an having it
freed in C.

As such, apologies to Russell about the abuse of the clk_get() call, but
let's not fix that just now.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.


^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 23:23     ` Ben Dooks
  0 siblings, 0 replies; 88+ messages in thread
From: Ben Dooks @ 2010-09-14 23:23 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Linus Walleij,
	Jean Delvare (PC drivers, core), Ben Dooks (embedded platforms),
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Mon, Sep 13, 2010 at 12:47:43PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
>  	dev->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);

personally, i'd prefer to see snprintf() used, to ensure that this sort
of thing never goes wrong if people decde to change the string. It is
a pitty there's no good way of temporarily allocating data an having it
freed in C.

As such, apologies to Russell about the abuse of the clk_get() call, but
let's not fix that just now.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* [PATCH 05/25] drivers/i2c: Use static const char arrays
@ 2010-09-14 23:23     ` Ben Dooks
  0 siblings, 0 replies; 88+ messages in thread
From: Ben Dooks @ 2010-09-14 23:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 13, 2010 at 12:47:43PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/i2c/busses/i2c-stu300.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
> index 495be45..2f7c09c 100644
> --- a/drivers/i2c/busses/i2c-stu300.c
> +++ b/drivers/i2c/busses/i2c-stu300.c
> @@ -871,7 +871,7 @@ stu300_probe(struct platform_device *pdev)
>  	struct resource *res;
>  	int bus_nr;
>  	int ret = 0;
> -	char clk_name[] = "I2C0";
> +	char clk_name[sizeof("I2Cx")];
>  
>  	dev = kzalloc(sizeof(struct stu300_dev), GFP_KERNEL);
>  	if (!dev) {
> @@ -881,7 +881,7 @@ stu300_probe(struct platform_device *pdev)
>  	}
>  
>  	bus_nr = pdev->id;
> -	clk_name[3] += (char)bus_nr;
> +	sprintf(clk_name, "I2C%c", '0' + bus_nr);
>  	dev->clk = clk_get(&pdev->dev, clk_name);
>  	if (IS_ERR(dev->clk)) {
>  		ret = PTR_ERR(dev->clk);

personally, i'd prefer to see snprintf() used, to ensure that this sort
of thing never goes wrong if people decde to change the string. It is
a pitty there's no good way of temporarily allocating data an having it
freed in C.

As such, apologies to Russell about the abuse of the clk_get() call, but
let's not fix that just now.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 21/25] drivers/video: Use static const char arrays
  2010-09-13 19:47   ` Joe Perches
@ 2010-09-15 19:02     ` James Simmons
  -1 siblings, 0 replies; 88+ messages in thread
From: James Simmons @ 2010-09-15 19:02 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Thomas Winischhofer, Joseph Chan,
	Florian Tobias Schandinat, linux-fbdev


> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: James Simmons <jsimmons@infradead.org>

> ---
>  drivers/video/sh_mipi_dsi.c  |    4 ++--
>  drivers/video/sis/sis_main.c |   10 +++++-----
>  drivers/video/via/viafbdev.c |    2 +-
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
> index 5699ce0..4a8501b 100644
> --- a/drivers/video/sh_mipi_dsi.c
> +++ b/drivers/video/sh_mipi_dsi.c
> @@ -319,7 +319,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
>  	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	unsigned long rate, f_current;
>  	int idx = pdev->id, ret;
> -	char dsip_clk[] = "dsi.p_clk";
> +	char dsip_clk[sizeof("dsiXp_clk")];
>  
>  	if (!res || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
>  		return -ENODEV;
> @@ -370,7 +370,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
>  
>  	dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
>  
> -	sprintf(dsip_clk, "dsi%1.1dp_clk", idx);
> +	sprintf(dsip_clk, "dsi%cp_clk", idx + '0');
>  	mipi->dsip_clk = clk_get(&pdev->dev, dsip_clk);
>  	if (IS_ERR(mipi->dsip_clk)) {
>  		ret = PTR_ERR(mipi->dsip_clk);
> diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
> index 559bf17..4be65d1 100644
> --- a/drivers/video/sis/sis_main.c
> +++ b/drivers/video/sis/sis_main.c
> @@ -2387,8 +2387,8 @@ SiS_Sense30x(struct sis_video_info *ivideo)
>      u16 cvbs=0, cvbs_c=0;
>      u16 vga2=0, vga2_c=0;
>      int myflag, result;
> -    char stdstr[] = "sisfb: Detected";
> -    char tvstr[]  = "TV connected to";
> +    static const char stdstr[] = "sisfb: Detected";
> +    static const char tvstr[] = "TV connected to";
>  
>      if(ivideo->vbflags2 & VB2_301) {
>         svhs = 0x00b9; cvbs = 0x00b3; vga2 = 0x00d1;
> @@ -2525,7 +2525,7 @@ SiS_SenseCh(struct sis_video_info *ivideo)
>  {
>  #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
>      u8 temp1, temp2;
> -    char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
> +    static const char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
>  #endif
>  #ifdef CONFIG_FB_SIS_300
>      unsigned char test[3];
> @@ -2648,8 +2648,8 @@ SiS_SenseCh(struct sis_video_info *ivideo)
>  static void __devinit
>  sisfb_get_VB_type(struct sis_video_info *ivideo)
>  {
> -	char stdstr[]    = "sisfb: Detected";
> -	char bridgestr[] = "video bridge";
> +	static const char stdstr[] = "sisfb: Detected";
> +	static const char bridgestr[] = "video bridge";
>  	u8 vb_chipid;
>  	u8 reg;
>  
> diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
> index 5a947b0..394ef48 100644
> --- a/drivers/video/via/viafbdev.c
> +++ b/drivers/video/via/viafbdev.c
> @@ -367,7 +367,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
>  	} u;
>  	u32 state_info = 0;
>  	u32 *viafb_gamma_table;
> -	char driver_name[] = "viafb";
> +	static const char driver_name[] = "viafb";
>  
>  	u32 __user *argp = (u32 __user *) arg;
>  	u32 gpu32;
> -- 
> 1.7.3.rc1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" 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] 88+ messages in thread

* Re: [PATCH 21/25] drivers/video: Use static const char arrays
@ 2010-09-15 19:02     ` James Simmons
  0 siblings, 0 replies; 88+ messages in thread
From: James Simmons @ 2010-09-15 19:02 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-kernel, Thomas Winischhofer, Joseph Chan,
	Florian Tobias Schandinat, linux-fbdev


> Signed-off-by: Joe Perches <joe@perches.com>

Acked-by: James Simmons <jsimmons@infradead.org>

> ---
>  drivers/video/sh_mipi_dsi.c  |    4 ++--
>  drivers/video/sis/sis_main.c |   10 +++++-----
>  drivers/video/via/viafbdev.c |    2 +-
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
> index 5699ce0..4a8501b 100644
> --- a/drivers/video/sh_mipi_dsi.c
> +++ b/drivers/video/sh_mipi_dsi.c
> @@ -319,7 +319,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
>  	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	unsigned long rate, f_current;
>  	int idx = pdev->id, ret;
> -	char dsip_clk[] = "dsi.p_clk";
> +	char dsip_clk[sizeof("dsiXp_clk")];
>  
>  	if (!res || idx >= ARRAY_SIZE(mipi_dsi) || !pdata)
>  		return -ENODEV;
> @@ -370,7 +370,7 @@ static int __init sh_mipi_probe(struct platform_device *pdev)
>  
>  	dev_dbg(&pdev->dev, "DSI-T clk %lu -> %lu\n", f_current, rate);
>  
> -	sprintf(dsip_clk, "dsi%1.1dp_clk", idx);
> +	sprintf(dsip_clk, "dsi%cp_clk", idx + '0');
>  	mipi->dsip_clk = clk_get(&pdev->dev, dsip_clk);
>  	if (IS_ERR(mipi->dsip_clk)) {
>  		ret = PTR_ERR(mipi->dsip_clk);
> diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
> index 559bf17..4be65d1 100644
> --- a/drivers/video/sis/sis_main.c
> +++ b/drivers/video/sis/sis_main.c
> @@ -2387,8 +2387,8 @@ SiS_Sense30x(struct sis_video_info *ivideo)
>      u16 cvbs=0, cvbs_c=0;
>      u16 vga2=0, vga2_c=0;
>      int myflag, result;
> -    char stdstr[] = "sisfb: Detected";
> -    char tvstr[]  = "TV connected to";
> +    static const char stdstr[] = "sisfb: Detected";
> +    static const char tvstr[] = "TV connected to";
>  
>      if(ivideo->vbflags2 & VB2_301) {
>         svhs = 0x00b9; cvbs = 0x00b3; vga2 = 0x00d1;
> @@ -2525,7 +2525,7 @@ SiS_SenseCh(struct sis_video_info *ivideo)
>  {
>  #if defined(CONFIG_FB_SIS_300) || defined(CONFIG_FB_SIS_315)
>      u8 temp1, temp2;
> -    char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
> +    static const char stdstr[] = "sisfb: Chrontel: Detected TV connected to";
>  #endif
>  #ifdef CONFIG_FB_SIS_300
>      unsigned char test[3];
> @@ -2648,8 +2648,8 @@ SiS_SenseCh(struct sis_video_info *ivideo)
>  static void __devinit
>  sisfb_get_VB_type(struct sis_video_info *ivideo)
>  {
> -	char stdstr[]    = "sisfb: Detected";
> -	char bridgestr[] = "video bridge";
> +	static const char stdstr[] = "sisfb: Detected";
> +	static const char bridgestr[] = "video bridge";
>  	u8 vb_chipid;
>  	u8 reg;
>  
> diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
> index 5a947b0..394ef48 100644
> --- a/drivers/video/via/viafbdev.c
> +++ b/drivers/video/via/viafbdev.c
> @@ -367,7 +367,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
>  	} u;
>  	u32 state_info = 0;
>  	u32 *viafb_gamma_table;
> -	char driver_name[] = "viafb";
> +	static const char driver_name[] = "viafb";
>  
>  	u32 __user *argp = (u32 __user *) arg;
>  	u32 gpu32;
> -- 
> 1.7.3.rc1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" 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] 88+ messages in thread

* Re: [PATCH 01/25] arch/mips: Use static const char arrays
  2010-09-13 19:47 ` [PATCH 01/25] arch/mips: " Joe Perches
@ 2010-09-18 22:54   ` Ralf Baechle
  2010-09-18 23:44     ` Joe Perches
  0 siblings, 1 reply; 88+ messages in thread
From: Ralf Baechle @ 2010-09-18 22:54 UTC (permalink / raw)
  To: Joe Perches; +Cc: linux-kernel, linux-mips

On Mon, Sep 13, 2010 at 12:47:39PM -0700, Joe Perches wrote:

> diff --git a/arch/mips/pnx8550/common/reset.c b/arch/mips/pnx8550/common/reset.c
> index fadd874..e0ac0b2 100644
> --- a/arch/mips/pnx8550/common/reset.c
> +++ b/arch/mips/pnx8550/common/reset.c
> @@ -27,8 +27,8 @@
>  
>  void pnx8550_machine_restart(char *command)
>  {
> -	char head[] = "************* Machine restart *************";
> -	char foot[] = "*******************************************";
> +	static const char head[] = "************* Machine restart *************";
> +	static const char foot[] = "*******************************************";
>  
>  	printk("\n\n");
>  	printk("%s\n", head);

NAK.

The printks should have been taken out and shot.  And while at it line
use the space on the other side of the wall for pnx8550_machine_power_off.

  Ralf

^ permalink raw reply	[flat|nested] 88+ messages in thread

* Re: [PATCH 01/25] arch/mips: Use static const char arrays
  2010-09-18 22:54   ` Ralf Baechle
@ 2010-09-18 23:44     ` Joe Perches
  0 siblings, 0 replies; 88+ messages in thread
From: Joe Perches @ 2010-09-18 23:44 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-kernel, linux-mips

On Sat, 2010-09-18 at 23:54 +0100, Ralf Baechle wrote:
> On Mon, Sep 13, 2010 at 12:47:39PM -0700, Joe Perches wrote:
> > diff --git a/arch/mips/pnx8550/common/reset.c b/arch/mips/pnx8550/common/reset.c
> > index fadd874..e0ac0b2 100644
> > --- a/arch/mips/pnx8550/common/reset.c
> > +++ b/arch/mips/pnx8550/common/reset.c
> > @@ -27,8 +27,8 @@
> >  
> >  void pnx8550_machine_restart(char *command)
> >  {
> > -	char head[] = "************* Machine restart *************";
> > -	char foot[] = "*******************************************";
> > +	static const char head[] = "************* Machine restart *************";
> > +	static const char foot[] = "*******************************************";
> >  
> >  	printk("\n\n");
> >  	printk("%s\n", head);
> NAK.
> The printks should have been taken out and shot.  And while at it line
> use the space on the other side of the wall for pnx8550_machine_power_off.

Fix them up as you see fit Ralf.

I don't have the hardware and was simply moving stuff
that should be const into const ro sections.

There are a lot of defects in that file, for instance
the printks don't use KERN_<level>.

cheers, Joe


^ permalink raw reply	[flat|nested] 88+ messages in thread

end of thread, other threads:[~2010-09-18 23:45 UTC | newest]

Thread overview: 88+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` [PATCH 01/25] arch/mips: " Joe Perches
2010-09-18 22:54   ` Ralf Baechle
2010-09-18 23:44     ` Joe Perches
2010-09-13 19:47 ` [PATCH 02/25] arch/powerpc: " Joe Perches
2010-09-13 19:47   ` Joe Perches
2010-09-14  2:02   ` Stephen Rothwell
2010-09-14  2:02     ` Stephen Rothwell
2010-09-14  2:04   ` Stephen Rothwell
2010-09-14  2:04     ` Stephen Rothwell
2010-09-13 19:47 ` [PATCH 03/25] drivers/acpi: " Joe Perches
2010-09-13 19:47 ` [PATCH 04/25] drivers/char: " Joe Perches
2010-09-14  2:06   ` Stephen Rothwell
2010-09-14  2:06     ` Stephen Rothwell
2010-09-13 19:47 ` [PATCH 05/25] drivers/i2c: " Joe Perches
2010-09-13 19:47   ` Joe Perches
2010-09-13 19:47   ` Joe Perches
2010-09-13 19:56   ` Russell King - ARM Linux
2010-09-13 19:56     ` Russell King - ARM Linux
2010-09-13 19:56     ` Russell King - ARM Linux
2010-09-13 20:08   ` Jonathan Cameron
2010-09-13 20:08     ` Jonathan Cameron
2010-09-13 20:08     ` Jonathan Cameron
2010-09-13 20:16     ` Joe Perches
2010-09-13 20:16       ` Joe Perches
2010-09-13 20:16       ` Joe Perches
2010-09-14  7:36     ` Lothar Waßmann
2010-09-14  7:36       ` Lothar Waßmann
2010-09-14  7:36       ` Lothar Waßmann
2010-09-14 12:57       ` Jonathan Cameron
2010-09-14 12:57         ` Jonathan Cameron
2010-09-14 12:57         ` Jonathan Cameron
2010-09-14 19:48         ` Russell King - ARM Linux
2010-09-14 19:48           ` Russell King - ARM Linux
2010-09-14 19:48           ` Russell King - ARM Linux
2010-09-14 23:23   ` Ben Dooks
2010-09-14 23:23     ` Ben Dooks
2010-09-14 23:23     ` Ben Dooks
2010-09-13 19:47 ` [PATCH 06/25] drivers/isdn: " Joe Perches
2010-09-13 19:47 ` [PATCH 07/25] drivers/media: " Joe Perches
2010-09-13 21:50   ` Mauro Carvalho Chehab
2010-09-13 22:07     ` [PATCH 07/25] drivers/media/video/zoran: Don't use initialized char array Joe Perches
2010-09-13 19:47 ` [PATCH 08/25] drivers/net/atl1c: Use static const char arrays Joe Perches
2010-09-13 19:47 ` [PATCH 09/25] drivers/net/atl1e: " Joe Perches
2010-09-13 19:47 ` [PATCH 10/25] drivers/net/(intel): " Joe Perches
2010-09-13 19:47   ` Joe Perches
2010-09-13 19:47 ` [PATCH 11/25] drivers/net/netxen: " Joe Perches
2010-09-13 19:47 ` [PATCH 12/25] drivers/net/qlcnic: " Joe Perches
2010-09-13 19:47 ` [PATCH 13/25] drivers/net/spider_net.c: " Joe Perches
2010-09-13 19:47 ` [PATCH 14/25] drivers/net/vnxnet3: " Joe Perches
2010-09-13 19:50   ` [Pv-drivers] " Bhavesh Davda
2010-09-13 20:07   ` Shreyas Bhatewara
2010-09-13 19:47 ` [PATCH 15/25] drivers/net/wireless/ipw2x00: " Joe Perches
2010-09-14 18:41   ` John W. Linville
2010-09-13 19:47 ` [PATCH 16/25] drivers/s390/char: " Joe Perches
2010-09-13 19:47 ` [PATCH 17/25] drivers/scsi: " Joe Perches
2010-09-13 19:47 ` [PATCH 18/25] drivers/serial/suncore.c: " Joe Perches
2010-09-13 19:47   ` Joe Perches
2010-09-13 20:36   ` Alan Cox
2010-09-13 20:36     ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char Alan Cox
2010-09-13 20:22     ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays Joe Perches
2010-09-13 20:22       ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char Joe Perches
2010-09-13 21:11       ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays Nick Bowler
2010-09-13 21:11         ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char Nick Bowler
2010-09-13 21:17         ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char arrays Joe Perches
2010-09-13 21:17           ` [PATCH 18/25] drivers/serial/suncore.c: Use static const char Joe Perches
2010-09-13 19:47 ` [PATCH 19/25] drivers/staging: Use static const char arrays Joe Perches
2010-09-13 19:47 ` [PATCH 20/25] drivers/usb: " Joe Perches
2010-09-13 20:38   ` Greg KH
2010-09-13 19:47 ` [PATCH 21/25] drivers/video: " Joe Perches
2010-09-13 19:47   ` Joe Perches
2010-09-15 19:02   ` James Simmons
2010-09-15 19:02     ` James Simmons
2010-09-13 19:48 ` [PATCH 22/25] net/dsa: " Joe Perches
2010-09-13 19:48 ` [PATCH 23/25] net/sunrpc: " Joe Perches
2010-09-13 19:48 ` [PATCH 24/25] sound: " Joe Perches
2010-09-13 20:30   ` Takashi Iwai
2010-09-13 20:30     ` Takashi Iwai
2010-09-13 20:47     ` Joe Perches
2010-09-13 21:33       ` Takashi Iwai
2010-09-13 21:33         ` Takashi Iwai
2010-09-13 19:48 ` [PATCH 25/25] tools/perf/util: " Joe Perches
2010-09-14  9:14 ` (unknown) David Howells
2010-09-14  9:14   ` (no subject) David Howells
2010-09-14  9:14   ` David Howells

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.