* [PATCH 00/25] treewide-next: Use static const char arrays
@ 2010-09-13 19:47 Joe Perches
2010-09-13 19:47 ` [PATCH 06/25] drivers/isdn: " Joe Perches
` (11 more replies)
0 siblings, 12 replies; 16+ 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] 16+ messages in thread
* [PATCH 06/25] drivers/isdn: Use static const char arrays
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 ` [PATCH 08/25] drivers/net/atl1c: " Joe Perches
` (10 subsequent siblings)
11 siblings, 0 replies; 16+ 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] 16+ messages in thread
* [PATCH 08/25] drivers/net/atl1c: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
2010-09-13 19:47 ` [PATCH 06/25] drivers/isdn: " Joe Perches
@ 2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` [PATCH 09/25] drivers/net/atl1e: " Joe Perches
` (9 subsequent siblings)
11 siblings, 0 replies; 16+ 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] 16+ messages in thread
* [PATCH 09/25] drivers/net/atl1e: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
2010-09-13 19:47 ` [PATCH 06/25] drivers/isdn: " Joe Perches
2010-09-13 19:47 ` [PATCH 08/25] drivers/net/atl1c: " Joe Perches
@ 2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` [PATCH 10/25] drivers/net/(intel): " Joe Perches
` (8 subsequent siblings)
11 siblings, 0 replies; 16+ 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] 16+ messages in thread
* [PATCH 10/25] drivers/net/(intel): Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (2 preceding siblings ...)
2010-09-13 19:47 ` [PATCH 09/25] drivers/net/atl1e: " Joe Perches
@ 2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` [PATCH 11/25] drivers/net/netxen: " Joe Perches
` (7 subsequent siblings)
11 siblings, 0 replies; 16+ 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® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 11/25] drivers/net/netxen: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (3 preceding siblings ...)
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 12/25] drivers/net/qlcnic: " Joe Perches
` (6 subsequent siblings)
11 siblings, 0 replies; 16+ 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] 16+ messages in thread
* [PATCH 12/25] drivers/net/qlcnic: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (4 preceding siblings ...)
2010-09-13 19:47 ` [PATCH 11/25] drivers/net/netxen: " Joe Perches
@ 2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` [PATCH 13/25] drivers/net/spider_net.c: " Joe Perches
` (5 subsequent siblings)
11 siblings, 0 replies; 16+ 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] 16+ messages in thread
* [PATCH 13/25] drivers/net/spider_net.c: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (5 preceding siblings ...)
2010-09-13 19:47 ` [PATCH 12/25] drivers/net/qlcnic: " Joe Perches
@ 2010-09-13 19:47 ` Joe Perches
2010-09-13 19:47 ` [PATCH 14/25] drivers/net/vnxnet3: " Joe Perches
` (4 subsequent siblings)
11 siblings, 0 replies; 16+ 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] 16+ messages in thread
* [PATCH 14/25] drivers/net/vnxnet3: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (6 preceding siblings ...)
2010-09-13 19:47 ` [PATCH 13/25] drivers/net/spider_net.c: " Joe Perches
@ 2010-09-13 19:47 ` 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
` (3 subsequent siblings)
11 siblings, 2 replies; 16+ 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] 16+ messages in thread
* [PATCH 15/25] drivers/net/wireless/ipw2x00: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (7 preceding siblings ...)
2010-09-13 19:47 ` [PATCH 14/25] drivers/net/vnxnet3: " Joe Perches
@ 2010-09-13 19:47 ` Joe Perches
2010-09-14 18:41 ` John W. Linville
2010-09-13 19:48 ` [PATCH 22/25] net/dsa: " Joe Perches
` (2 subsequent siblings)
11 siblings, 1 reply; 16+ 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] 16+ messages in thread
* [PATCH 22/25] net/dsa: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (8 preceding siblings ...)
2010-09-13 19:47 ` [PATCH 15/25] drivers/net/wireless/ipw2x00: " Joe Perches
@ 2010-09-13 19:48 ` Joe Perches
2010-09-13 19:48 ` [PATCH 23/25] net/sunrpc: " Joe Perches
2010-09-14 9:14 ` (unknown) David Howells
11 siblings, 0 replies; 16+ 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] 16+ messages in thread
* [PATCH 23/25] net/sunrpc: Use static const char arrays
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (9 preceding siblings ...)
2010-09-13 19:48 ` [PATCH 22/25] net/dsa: " Joe Perches
@ 2010-09-13 19:48 ` Joe Perches
2010-09-14 9:14 ` (unknown) David Howells
11 siblings, 0 replies; 16+ 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] 16+ 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; 16+ messages in thread
From: Bhavesh Davda @ 2010-09-13 19:50 UTC (permalink / raw)
To: Joe Perches, linux-kernel@vger•kernel.org
Cc: VMware, Inc., netdev@vger•kernel.org
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] 16+ 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; 16+ messages in thread
From: Shreyas Bhatewara @ 2010-09-13 20:07 UTC (permalink / raw)
To: Joe Perches, linux-kernel@vger•kernel.org
Cc: VMware, Inc., netdev@vger•kernel.org
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] 16+ messages in thread
* (unknown)
2010-09-13 19:47 [PATCH 00/25] treewide-next: Use static const char arrays Joe Perches
` (10 preceding siblings ...)
2010-09-13 19:48 ` [PATCH 23/25] net/sunrpc: " Joe Perches
@ 2010-09-14 9:14 ` David Howells
11 siblings, 0 replies; 16+ 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] 16+ 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; 16+ 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] 16+ messages in thread
end of thread, other threads:[~2010-09-14 18:41 UTC | newest]
Thread overview: 16+ 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 ` [PATCH 06/25] drivers/isdn: " Joe Perches
2010-09-13 19:47 ` [PATCH 08/25] drivers/net/atl1c: " 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 ` [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:48 ` [PATCH 22/25] net/dsa: " Joe Perches
2010-09-13 19:48 ` [PATCH 23/25] net/sunrpc: " Joe Perches
2010-09-14 9:14 ` (unknown) David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox