* [net-next patch] bnx2x: Define bnx2x_tests_str_arr as const
@ 2012-06-27 11:52 Merav Sicron
2012-06-27 11:59 ` David Laight
0 siblings, 1 reply; 4+ messages in thread
From: Merav Sicron @ 2012-06-27 11:52 UTC (permalink / raw)
To: davem, netdev, eilong; +Cc: Merav Sicron
This patch changes the definition of bnx2x_tests_str_arr from static char to
static const char.
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
Hi Dave,
Please consider applying this patch to net-next.
Thanks,
Merav
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index bff3129..81cadb6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -1600,7 +1600,7 @@ static int bnx2x_set_pauseparam(struct net_device *dev,
return 0;
}
-static char *bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF] = {
+static const char *bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF] = {
"register_test (offline) ",
"memory_test (offline) ",
"int_loopback_test (offline)",
--
1.7.10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [net-next patch] bnx2x: Define bnx2x_tests_str_arr as const
2012-06-27 11:52 [net-next patch] bnx2x: Define bnx2x_tests_str_arr as const Merav Sicron
@ 2012-06-27 11:59 ` David Laight
2012-06-27 12:45 ` Merav Sicron
0 siblings, 1 reply; 4+ messages in thread
From: David Laight @ 2012-06-27 11:59 UTC (permalink / raw)
To: Merav Sicron, davem, netdev, eilong
> -static char *bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF] = {
> +static const char *bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF] = {
> "register_test (offline) ",
> "memory_test (offline) ",
> "int_loopback_test (offline)",
You are still missing a 'const'.
You probably want:
static const char *const bnx2x_tests_str_arr[] ...
However if you are going to pad the strings to [28]
you might as well remove the layer of indirection - ie:
static const char bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF][28] = { ...
}
Or pad to 32 chars to (probably) remove some code bytes.
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [net-next patch] bnx2x: Define bnx2x_tests_str_arr as const
2012-06-27 11:59 ` David Laight
@ 2012-06-27 12:45 ` Merav Sicron
2012-06-27 22:43 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Merav Sicron @ 2012-06-27 12:45 UTC (permalink / raw)
To: David Laight; +Cc: davem, netdev, eilong
On Wed, 2012-06-27 at 12:59 +0100, David Laight wrote:
> > -static char *bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF] = {
> > +static const char *bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF] = {
> > "register_test (offline) ",
> > "memory_test (offline) ",
> > "int_loopback_test (offline)",
>
> You are still missing a 'const'.
> You probably want:
> static const char *const bnx2x_tests_str_arr[] ...
>
> However if you are going to pad the strings to [28]
> you might as well remove the layer of indirection - ie:
> static const char bnx2x_tests_str_arr[BNX2X_NUM_TESTS_SF][28] = { ...
> }
> Or pad to 32 chars to (probably) remove some code bytes.
>
> David
>
Thanks David, let me think about it.
Dave, please ignore this patch for now.
Thanks,
Merav
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net-next patch] bnx2x: Define bnx2x_tests_str_arr as const
2012-06-27 12:45 ` Merav Sicron
@ 2012-06-27 22:43 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-06-27 22:43 UTC (permalink / raw)
To: meravs; +Cc: David.Laight, netdev, eilong
From: "Merav Sicron" <meravs@broadcom.com>
Date: Wed, 27 Jun 2012 15:45:10 +0300
> Dave, please ignore this patch for now.
Ok.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-27 22:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-27 11:52 [net-next patch] bnx2x: Define bnx2x_tests_str_arr as const Merav Sicron
2012-06-27 11:59 ` David Laight
2012-06-27 12:45 ` Merav Sicron
2012-06-27 22:43 ` David Miller
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.