linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qlogic/qed: Constify *pkt_type_str[]
@ 2018-02-27 22:31 Hernán Gonzalez
  2018-02-28  8:21 ` Kalderon, Michal
  2018-02-28 16:40 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Hernán Gonzalez @ 2018-02-27 22:31 UTC (permalink / raw)
  To: Ariel.Elior, everest-linux-l2, netdev, linux-kernel, hernan

Note: This is compile only tested as I have no access to the hw.
Constifying and declaring as static saves 24 bytes.

add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-24 (-24)
Function                                     old     new   delta
pkt_type_str                                  24       -     -24
Total: Before=3599256, After=3599232, chg -0.00%

Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
---
 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 ca4a81d..03ad4ee 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
@@ -1784,7 +1784,7 @@ enum qed_iwarp_mpa_pkt_type {
 /* fpdu can be fragmented over maximum 3 bds: header, partial mpa, unaligned */
 #define QED_IWARP_MAX_BDS_PER_FPDU 3
 
-char *pkt_type_str[] = {
+static const char * const pkt_type_str[] = {
 	"QED_IWARP_MPA_PKT_PACKED",
 	"QED_IWARP_MPA_PKT_PARTIAL",
 	"QED_IWARP_MPA_PKT_UNALIGNED"
-- 
2.7.4

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

* RE: [PATCH] qlogic/qed: Constify *pkt_type_str[]
  2018-02-27 22:31 [PATCH] qlogic/qed: Constify *pkt_type_str[] Hernán Gonzalez
@ 2018-02-28  8:21 ` Kalderon, Michal
  2018-02-28 16:40 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Kalderon, Michal @ 2018-02-28  8:21 UTC (permalink / raw)
  To: Hernán Gonzalez, Elior, Ariel, Dept-Eng Everest Linux L2,
	netdev, linux-kernel

> From: Hernán Gonzalez [mailto:hernan@vanguardiasur.com.ar]
> Sent: Wednesday, February 28, 2018 12:32 AM
> 
> Note: This is compile only tested as I have no access to the hw.
> Constifying and declaring as static saves 24 bytes.
> 
> add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-24 (-24)
> Function                                     old     new   delta
> pkt_type_str                                  24       -     -24
> Total: Before=3599256, After=3599232, chg -0.00%
> 
> Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
> ---
>  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 ca4a81d..03ad4ee 100644
> --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c
> @@ -1784,7 +1784,7 @@ enum qed_iwarp_mpa_pkt_type {
>  /* fpdu can be fragmented over maximum 3 bds: header, partial mpa,
> unaligned */  #define QED_IWARP_MAX_BDS_PER_FPDU 3
> 
> -char *pkt_type_str[] = {
> +static const char * const pkt_type_str[] = {
>  	"QED_IWARP_MPA_PKT_PACKED",
>  	"QED_IWARP_MPA_PKT_PARTIAL",
>  	"QED_IWARP_MPA_PKT_UNALIGNED"
> --
> 2.7.4

Thanks

Acked-by: Michal Kalderon <michal.kalderon@cavium.com>

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

* Re: [PATCH] qlogic/qed: Constify *pkt_type_str[]
  2018-02-27 22:31 [PATCH] qlogic/qed: Constify *pkt_type_str[] Hernán Gonzalez
  2018-02-28  8:21 ` Kalderon, Michal
@ 2018-02-28 16:40 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-02-28 16:40 UTC (permalink / raw)
  To: hernan; +Cc: Ariel.Elior, everest-linux-l2, netdev, linux-kernel

From: Hernán Gonzalez <hernan@vanguardiasur.com.ar>
Date: Tue, 27 Feb 2018 19:31:34 -0300

> Note: This is compile only tested as I have no access to the hw.
> Constifying and declaring as static saves 24 bytes.
> 
> add/remove: 0/1 grow/shrink: 0/0 up/down: 0/-24 (-24)
> Function                                     old     new   delta
> pkt_type_str                                  24       -     -24
> Total: Before=3599256, After=3599232, chg -0.00%
> 
> Signed-off-by: Hernán Gonzalez <hernan@vanguardiasur.com.ar>

Applied to net-next.

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

end of thread, other threads:[~2018-02-28 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-27 22:31 [PATCH] qlogic/qed: Constify *pkt_type_str[] Hernán Gonzalez
2018-02-28  8:21 ` Kalderon, Michal
2018-02-28 16:40 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).