]> err.no Git - linux-2.6/commitdiff
IB/ehca: Make symbols used only in a single source file static
authorRoland Dreier <rolandd@cisco.com>
Thu, 17 Apr 2008 04:01:10 +0000 (21:01 -0700)
committerRoland Dreier <rolandd@cisco.com>
Thu, 17 Apr 2008 04:01:10 +0000 (21:01 -0700)
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>
drivers/infiniband/hw/ehca/ehca_hca.c
drivers/infiniband/hw/ehca/ehca_main.c
drivers/infiniband/hw/ehca/ehca_mrmw.c

index 5bd7b591987ed3c77b545197714858a62a470108..8832123d1d0fb89024e9bd260ffa84e432b727e7 100644 (file)
@@ -314,7 +314,7 @@ query_gid1:
        return ret;
 }
 
-const u32 allowed_port_caps = (
+static const u32 allowed_port_caps = (
        IB_PORT_SM | IB_PORT_LED_INFO_SUP | IB_PORT_CM_SUP |
        IB_PORT_SNMP_TUNNEL_SUP | IB_PORT_DEVICE_MGMT_SUP |
        IB_PORT_VENDOR_CLASS_SUP);
index a86ebcc79a95a7db5343cdcd4f37fb6a9a1e8d07..65b3362cdb9b5a82321ce56ebaf71d3ce6b3ca4c 100644 (file)
@@ -57,16 +57,17 @@ MODULE_AUTHOR("Christoph Raisch <raisch@de.ibm.com>");
 MODULE_DESCRIPTION("IBM eServer HCA InfiniBand Device Driver");
 MODULE_VERSION(HCAD_VERSION);
 
-int ehca_open_aqp1     = 0;
+static int ehca_open_aqp1     = 0;
+static int ehca_hw_level      = 0;
+static int ehca_poll_all_eqs  = 1;
+static int ehca_mr_largepage  = 1;
+
 int ehca_debug_level   = 0;
-int ehca_hw_level      = 0;
 int ehca_nr_ports      = 2;
 int ehca_use_hp_mr     = 0;
 int ehca_port_act_time = 30;
-int ehca_poll_all_eqs  = 1;
 int ehca_static_rate   = -1;
 int ehca_scaling_code  = 0;
-int ehca_mr_largepage  = 1;
 int ehca_lock_hcalls   = -1;
 
 module_param_named(open_aqp1,     ehca_open_aqp1,     int, S_IRUGO);
@@ -396,7 +397,7 @@ init_node_guid1:
        return ret;
 }
 
-int ehca_init_device(struct ehca_shca *shca)
+static int ehca_init_device(struct ehca_shca *shca)
 {
        int ret;
 
@@ -579,8 +580,8 @@ static ssize_t ehca_store_debug_level(struct device_driver *ddp,
        return 1;
 }
 
-DRIVER_ATTR(debug_level, S_IRUSR | S_IWUSR,
-           ehca_show_debug_level, ehca_store_debug_level);
+static DRIVER_ATTR(debug_level, S_IRUSR | S_IWUSR,
+                  ehca_show_debug_level, ehca_store_debug_level);
 
 static struct attribute *ehca_drv_attrs[] = {
        &driver_attr_debug_level.attr,
@@ -941,7 +942,7 @@ void ehca_poll_eqs(unsigned long data)
        spin_unlock(&shca_list_lock);
 }
 
-int __init ehca_module_init(void)
+static int __init ehca_module_init(void)
 {
        int ret;
 
@@ -988,7 +989,7 @@ module_init1:
        return ret;
 };
 
-void __exit ehca_module_exit(void)
+static void __exit ehca_module_exit(void)
 {
        if (ehca_poll_all_eqs == 1)
                del_timer_sync(&poll_eqs_timer);
index e239bbf54da14ff3d79b49912bb745018a1407f2..5e99c45493c18cba256f6f01c59a0f3654867b62 100644 (file)
@@ -1952,9 +1952,8 @@ next_kpage:
        return ret;
 }
 
-int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo,
-                         u32 number,
-                         u64 *kpage)
+static int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo,
+                                u32 number, u64 *kpage)
 {
        int ret = 0;
        struct ib_phys_buf *pbuf;
@@ -2012,9 +2011,8 @@ int ehca_set_pagebuf_phys(struct ehca_mr_pginfo *pginfo,
        return ret;
 }
 
-int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo,
-                        u32 number,
-                        u64 *kpage)
+static int ehca_set_pagebuf_fmr(struct ehca_mr_pginfo *pginfo,
+                               u32 number, u64 *kpage)
 {
        int ret = 0;
        u64 *fmrlist;