aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-21 05:16:10 -0500
committerJoe Perches <joe@perches.com>2010-12-21 05:16:10 -0500
commit215faf9c5f6e319e97edea9e178123e07825c14d (patch)
tree32fb283f64110ad634a37dc2e133cb91a97988c5 /drivers/net/benet
parent75a84eb5d144dc761e1bb0f7dcacbf2b5cee562c (diff)
drivers/net/*/: Use static const
Using static const generally increases object text and decreases data size. It also generally decreases overall object size. Signed-off-by: Joe Perches <joe@perches.com>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_ethtool.c4
-rw-r--r--drivers/net/benet/be_main.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 0f46366ecc48..b4be0271efe0 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -549,7 +549,9 @@ be_test_ddr_dma(struct be_adapter *adapter)
549{ 549{
550 int ret, i; 550 int ret, i;
551 struct be_dma_mem ddrdma_cmd; 551 struct be_dma_mem ddrdma_cmd;
552 u64 pattern[2] = {0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL}; 552 static const u64 pattern[2] = {
553 0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL
554 };
553 555
554 ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test); 556 ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
555 ddrdma_cmd.va = pci_alloc_consistent(adapter->pdev, ddrdma_cmd.size, 557 ddrdma_cmd.va = pci_alloc_consistent(adapter->pdev, ddrdma_cmd.size,
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 88ce68d63bca..de40d3b7152f 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2398,10 +2398,10 @@ static int be_flash_data(struct be_adapter *adapter,
2398 int num_bytes; 2398 int num_bytes;
2399 const u8 *p = fw->data; 2399 const u8 *p = fw->data;
2400 struct be_cmd_write_flashrom *req = flash_cmd->va; 2400 struct be_cmd_write_flashrom *req = flash_cmd->va;
2401 struct flash_comp *pflashcomp; 2401 const struct flash_comp *pflashcomp;
2402 int num_comp; 2402 int num_comp;
2403 2403
2404 struct flash_comp gen3_flash_types[9] = { 2404 static const struct flash_comp gen3_flash_types[9] = {
2405 { FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE, 2405 { FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
2406 FLASH_IMAGE_MAX_SIZE_g3}, 2406 FLASH_IMAGE_MAX_SIZE_g3},
2407 { FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT, 2407 { FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
@@ -2421,7 +2421,7 @@ static int be_flash_data(struct be_adapter *adapter,
2421 { FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW, 2421 { FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
2422 FLASH_NCSI_IMAGE_MAX_SIZE_g3} 2422 FLASH_NCSI_IMAGE_MAX_SIZE_g3}
2423 }; 2423 };
2424 struct flash_comp gen2_flash_types[8] = { 2424 static const struct flash_comp gen2_flash_types[8] = {
2425 { FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE, 2425 { FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
2426 FLASH_IMAGE_MAX_SIZE_g2}, 2426 FLASH_IMAGE_MAX_SIZE_g2},
2427 { FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT, 2427 { FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT,
@@ -2443,11 +2443,11 @@ static int be_flash_data(struct be_adapter *adapter,
2443 if (adapter->generation == BE_GEN3) { 2443 if (adapter->generation == BE_GEN3) {
2444 pflashcomp = gen3_flash_types; 2444 pflashcomp = gen3_flash_types;
2445 filehdr_size = sizeof(struct flash_file_hdr_g3); 2445 filehdr_size = sizeof(struct flash_file_hdr_g3);
2446 num_comp = 9; 2446 num_comp = ARRAY_SIZE(gen3_flash_types);
2447 } else { 2447 } else {
2448 pflashcomp = gen2_flash_types; 2448 pflashcomp = gen2_flash_types;
2449 filehdr_size = sizeof(struct flash_file_hdr_g2); 2449 filehdr_size = sizeof(struct flash_file_hdr_g2);
2450 num_comp = 8; 2450 num_comp = ARRAY_SIZE(gen2_flash_types);
2451 } 2451 }
2452 for (i = 0; i < num_comp; i++) { 2452 for (i = 0; i < num_comp; i++) {
2453 if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) && 2453 if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&