Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756488Ab0KUCkD (ORCPT ); Sat, 20 Nov 2010 21:40:03 -0500 Received: from mail.perches.com ([173.55.12.10]:1643 "EHLO mail.perches.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756143Ab0KUCju (ORCPT ); Sat, 20 Nov 2010 21:39:50 -0500 From: Joe Perches To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 10/62] chelsio: Use static const Date: Sat, 20 Nov 2010 18:38:11 -0800 Message-Id: <33643252f41c2b54ae8a8bac91e3fd6cbcaa835f.1290305776.git.joe@perches.com> X-Mailer: git-send-email 1.7.3.2.245.g03276.dirty In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1925 Lines: 57 Moved duplicated ch_mac_addr declarations to single static const file scope. Using static const generally increases object text and decreases data size. It also generally decreases overall object size. text data bss dec hex filename 21712 305 5168 27185 6a31 drivers/net/chelsio/sge.o.new 21806 305 5168 27279 6a8f drivers/net/chelsio/sge.o.old Signed-off-by: Joe Perches --- drivers/net/chelsio/sge.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 70221ca..f778b15 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c @@ -273,6 +273,10 @@ struct sge { struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp; }; +static const u8 ch_mac_addr[ETH_ALEN] = { + 0x0, 0x7, 0x43, 0x0, 0x0, 0x0 +}; + /* * stop tasklet and free all pending skb's */ @@ -2012,10 +2016,6 @@ static void espibug_workaround_t204(unsigned long data) continue; if (!skb->cb[0]) { - u8 ch_mac_addr[ETH_ALEN] = { - 0x0, 0x7, 0x43, 0x0, 0x0, 0x0 - }; - skb_copy_to_linear_data_offset(skb, sizeof(struct cpl_tx_pkt), ch_mac_addr, @@ -2048,8 +2048,6 @@ static void espibug_workaround(unsigned long data) if ((seop & 0xfff0fff) == 0xfff && skb) { if (!skb->cb[0]) { - u8 ch_mac_addr[ETH_ALEN] = - {0x0, 0x7, 0x43, 0x0, 0x0, 0x0}; skb_copy_to_linear_data_offset(skb, sizeof(struct cpl_tx_pkt), ch_mac_addr, -- 1.7.3.2.245.g03276.dirty -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/