diff options
author | Roland Dreier <rolandd@cisco.com> | 2008-04-17 00:01:10 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-17 00:01:10 -0400 |
commit | e8e91f6b4dc1179a70b0d21241b769c0ebfaa129 (patch) | |
tree | 81b957526d8a2af444073a4d76c91c2ee4aeaeae | |
parent | 1a855fbfb65e0b7b5cce00d7c6a61185ed765edf (diff) |
IB/ehca: Make symbols used only in a single source file static
Allow the compiler to optimize better and generate smaller code:
add/remove: 0/6 grow/shrink: 2/0 up/down: 1528/-1864 (-336)
function old new delta
.ehca_set_pagebuf 1344 2172 +828
.ehca_probe 2312 3012 +700
ehca_set_pagebuf_phys 24 - -24
ehca_set_pagebuf_fmr 24 - -24
ehca_init_device 24 - -24
.ehca_set_pagebuf_fmr 480 - -480
.ehca_set_pagebuf_phys 512 - -512
.ehca_init_device 800 - -800
Also this fixes warnings like:
drivers/infiniband/hw/ehca/ehca_mrmw.c:2015:5: warning: symbol 'ehca_set_pagebuf_fmr' was not declared. Should it be static?
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_hca.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_main.c | 19 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_mrmw.c | 10 |
3 files changed, 15 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c index 5bd7b591987e..8832123d1d0f 100644 --- a/drivers/infiniband/hw/ehca/ehca_hca.c +++ b/drivers/infiniband/hw/ehca/ehca_hca.c | |||
@@ -314,7 +314,7 @@ query_gid1: | |||
314 | return ret; | 314 | return ret; |
315 | } | 315 | } |
316 | 316 | ||
317 | const u32 allowed_port_caps = ( | 317 | static const u32 allowed_port_caps = ( |
318 | IB_PORT_SM | IB_PORT_LED_INFO_SUP | IB_PORT_CM_SUP | | 318 | IB_PORT_SM | IB_PORT_LED_INFO_SUP | IB_PORT_CM_SUP | |
319 | IB_PORT_SNMP_TUNNEL_SUP | IB_PORT_DEVICE_MGMT_SUP | | 319 | IB_PORT_SNMP_TUNNEL_SUP | IB_PORT_DEVICE_MGMT_SUP | |
320 | IB_PORT_VENDOR_CLASS_SUP); | 320 | IB_PORT_VENDOR_CLASS_SUP); |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index a86ebcc79a95..65b3362cdb9b 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -57,16 +57,17 @@ MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>"); | |||
57 | MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver"); | 57 | MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver"); |
58 | MODULE_VERSION(HCAD_VERSION); | 58 | MODULE_VERSION(HCAD_VERSION); |
59 | 59 | ||
60 | int ehca_open_aqp1 = 0; | 60 | static int ehca_open_aqp1 = 0; |
61 | static int ehca_hw_level = 0; | ||
62 | static int ehca_poll_all_eqs = 1; | ||
63 | static int ehca_mr_largepage = 1; | ||
64 | |||
61 | int ehca_debug_level = 0; | 65 | int ehca_debug_level = 0; |
62 | int ehca_hw_level = 0; | ||
63 | int ehca_nr_ports = 2; | 66 | int ehca_nr_ports = 2; |
64 | int ehca_use_hp_mr = 0; | 67 | int ehca_use_hp_mr = 0; |
65 | int ehca_port_act_time = 30; | 68 | int ehca_port_act_time = 30; |
66 | int ehca_poll_all_eqs = 1; | ||
67 | int ehca_static_rate = -1; | 69 | int ehca_static_rate = -1; |
68 | int ehca_scaling_code = 0; | 70 | int ehca_scaling_code = 0; |
69 | int ehca_mr_largepage = 1; | ||
70 | int ehca_lock_hcalls = -1; | 71 | int ehca_lock_hcalls = -1; |
71 | 72 | ||
72 | module_param_named(open_aqp1, ehca_open_aqp1, int, S_IRUGO); | 73 | module_param_named(open_aqp1, ehca_open_aqp1, int, S_IRUGO); |
@@ -396,7 +397,7 @@ init_node_guid1: | |||
396 | return ret; | 397 | return ret; |
397 | } | 398 | } |
398 | 399 | ||
399 | int ehca_init_device(struct ehca_shca *shca) | 400 | static int ehca_init_device(struct ehca_shca *shca) |
400 | { | 401 | { |
401 | int ret; | 402 | int ret; |
402 | 403 | ||
@@ -579,8 +580,8 @@ static ssize_t ehca_store_debug_level(struct device_driver *ddp, | |||
579 | return 1; | 580 | return 1; |
580 | } | 581 | } |
581 | 582 | ||
582 | DRIVER_ATTR(debug_level, S_IRUSR | S_IWUSR, | 583 | static DRIVER_ATTR(debug_level, S_IRUSR | S_IWUSR, |
583 | ehca_show_debug_level, ehca_store_debug_level); | 584 | ehca_show_debug_level, ehca_store_debug_level); |
584 | 585 | ||
585 | static struct attribute *ehca_drv_attrs[] = { | 586 | static struct attribute *ehca_drv_attrs[] = { |
586 | &driver_attr_debug_level.attr, | 587 | &driver_attr_debug_level.attr, |
@@ -941,7 +942,7 @@ void ehca_poll_eqs(unsigned long data) | |||
941 | spin_unlock(&shca_list_lock); | 942 | spin_unlock(&shca_list_lock); |
942 | } | 943 | } |
943 | 944 | ||
944 | int __init ehca_module_init(void) | 945 | static int __init ehca_module_init(void) |
945 | { | 946 | { |
946 | int ret; | 947 | int ret; |
947 | 948 | ||
@@ -988,7 +989,7 @@ module_init1: | |||
988 | return ret; | 989 | return ret; |
989 | }; | 990 | }; |
990 | 991 | ||
991 | void __exit ehca_module_exit(void) | 992 | static void __exit ehca_module_exit(void) |
992 | { | 993 | { |
993 | if (ehca_poll_all_eqs == 1) | 994 | if (ehca_poll_all_eqs == 1) |
994 | del_timer_sync(&poll_eqs_timer); | 995 | del_timer_sync(&poll_eqs_timer); |
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/infiniband/hw/ehca/ehca_mrmw.c index e239bbf54da1..5e99c45493c1 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c | |||
@@ -1952,9 +1952,8 @@ next_kpage: | |||
1952 | return ret; | 1952 | return ret; |
1953 | } | 1953 | } |
1954 | 1954 | ||
1955 | int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo, | 1955 | static int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo, |
1956 | u32 number, | 1956 | u32 number, u64 *kpage) |
1957 | u64 *kpage) | ||
1958 | { | 1957 | { |
1959 | int ret = 0; | 1958 | int ret = 0; |
1960 | struct ib_phys_buf *pbuf; | 1959 | struct ib_phys_buf *pbuf; |
@@ -2012,9 +2011,8 @@ int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo, | |||
2012 | return ret; | 2011 | return ret; |
2013 | } | 2012 | } |
2014 | 2013 | ||
2015 | int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo, | 2014 | static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo, |
2016 | u32 number, | 2015 | u32 number, u64 *kpage) |
2017 | u64 *kpage) | ||
2018 | { | 2016 | { |
2019 | int ret = 0; | 2017 | int ret = 0; |
2020 | u64 *fmrlist; | 2018 | u64 *fmrlist; |