2019-09-04 14:18:50

by Krzysztof Wilczyński

[permalink] [raw]
Subject: [PATCH] net: qed: Move static keyword to the front of declaration

Move the static keyword to the front of declaration of iwarp_state_names,
and resolve the following compiler warning that can be seen when building
with warnings enabled (W=1):

drivers/net/ethernet/qlogic/qed/qed_iwarp.c:385:1: warning:
‘static’ is not at beginning of declaration [-Wold-style-declaration]

Also, resolve checkpatch.pl script warning:

WARNING: static const char * array should probably be
static const char * const

Signed-off-by: Krzysztof Wilczynski <[email protected]>
---
Related: https://lore.kernel.org/r/[email protected]

drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
index f380fae8799d..65ec16a31658 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
@@ -382,7 +382,7 @@ qed_iwarp2roce_state(enum qed_iwarp_qp_state state)
}
}

-const static char *iwarp_state_names[] = {
+static const char * const iwarp_state_names[] = {
"IDLE",
"RTS",
"TERMINATE",
--
2.22.1


2019-09-05 08:15:35

by Michal Kalderon

[permalink] [raw]
Subject: RE: [EXT] [PATCH] net: qed: Move static keyword to the front of declaration

> From: Krzysztof Wilczynski <[email protected]> On Behalf Of Krzysztof
> Wilczynski
>
> External Email
>
> ----------------------------------------------------------------------
> Move the static keyword to the front of declaration of iwarp_state_names,
> and resolve the following compiler warning that can be seen when building
> with warnings enabled (W=1):
>
> drivers/net/ethernet/qlogic/qed/qed_iwarp.c:385:1: warning:
> ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>
> Also, resolve checkpatch.pl script warning:
>
> WARNING: static const char * array should probably be
> static const char * const
>
> Signed-off-by: Krzysztof Wilczynski <[email protected]>
> ---
> Related: https://lore.kernel.org/r/[email protected]
>
> drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> index f380fae8799d..65ec16a31658 100644
> --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> @@ -382,7 +382,7 @@ qed_iwarp2roce_state(enum qed_iwarp_qp_state
> state)
> }
> }
>
> -const static char *iwarp_state_names[] = {
> +static const char * const iwarp_state_names[] = {
> "IDLE",
> "RTS",
> "TERMINATE",

Thanks, 

Acked-by: Michal Kalderon <[email protected]>


> --
> 2.22.1

2019-09-05 12:55:12

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net: qed: Move static keyword to the front of declaration

From: Krzysztof Wilczynski <[email protected]>
Date: Wed, 4 Sep 2019 16:17:30 +0200

> Move the static keyword to the front of declaration of iwarp_state_names,
> and resolve the following compiler warning that can be seen when building
> with warnings enabled (W=1):
>
> drivers/net/ethernet/qlogic/qed/qed_iwarp.c:385:1: warning:
> ?static? is not at beginning of declaration [-Wold-style-declaration]
>
> Also, resolve checkpatch.pl script warning:
>
> WARNING: static const char * array should probably be
> static const char * const
>
> Signed-off-by: Krzysztof Wilczynski <[email protected]>

Applied to net-next.