diff options
author | Peter Tiedemann <ptiedem@de.ibm.com> | 2008-04-24 04:15:21 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-29 01:56:30 -0400 |
commit | cd023216e64cc0359ec51312bef14ef2449535dd (patch) | |
tree | 55305852ea1e1508180e57d92d3a8f0aa19b9711 | |
parent | 022b660ae5d075ed9eaddef6f6fb7abb48bdf63b (diff) |
qeth module size reduction.
Replace complex macro for s390dbf calls by equivalent function. This reduces
module size about 10% without visible performance impact.
Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/s390/net/qeth_core.h | 18 | ||||
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 15 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 3 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3.h | 3 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 2 |
5 files changed, 14 insertions, 27 deletions
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 66f4f12503c..b7bb0ff87c1 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h | |||
@@ -72,22 +72,7 @@ struct qeth_dbf_info { | |||
72 | debug_sprintf_event(qeth_dbf[QETH_DBF_MSG].id, level, text) | 72 | debug_sprintf_event(qeth_dbf[QETH_DBF_MSG].id, level, text) |
73 | 73 | ||
74 | #define QETH_DBF_TEXT_(name, level, text...) \ | 74 | #define QETH_DBF_TEXT_(name, level, text...) \ |
75 | do { \ | 75 | qeth_dbf_longtext(QETH_DBF_##name, level, text) |
76 | if (qeth_dbf_passes(qeth_dbf[QETH_DBF_##name].id, level)) { \ | ||
77 | char *dbf_txt_buf = \ | ||
78 | get_cpu_var(QETH_DBF_TXT_BUF); \ | ||
79 | sprintf(dbf_txt_buf, text); \ | ||
80 | debug_text_event(qeth_dbf[QETH_DBF_##name].id, \ | ||
81 | level, dbf_txt_buf); \ | ||
82 | put_cpu_var(QETH_DBF_TXT_BUF); \ | ||
83 | } \ | ||
84 | } while (0) | ||
85 | |||
86 | /* Allow to sort out low debug levels early to avoid wasted sprints */ | ||
87 | static inline int qeth_dbf_passes(debug_info_t *dbf_grp, int level) | ||
88 | { | ||
89 | return (level <= dbf_grp->level); | ||
90 | } | ||
91 | 76 | ||
92 | /** | 77 | /** |
93 | * some more debug stuff | 78 | * some more debug stuff |
@@ -894,6 +879,7 @@ void qeth_core_get_ethtool_stats(struct net_device *, | |||
894 | struct ethtool_stats *, u64 *); | 879 | struct ethtool_stats *, u64 *); |
895 | void qeth_core_get_strings(struct net_device *, u32, u8 *); | 880 | void qeth_core_get_strings(struct net_device *, u32, u8 *); |
896 | void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); | 881 | void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); |
882 | void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...); | ||
897 | 883 | ||
898 | /* exports for OSN */ | 884 | /* exports for OSN */ |
899 | int qeth_osn_assist(struct net_device *, void *, int); | 885 | int qeth_osn_assist(struct net_device *, void *, int); |
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 231d18c3b6f..18323250a33 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -26,9 +26,6 @@ | |||
26 | #include "qeth_core.h" | 26 | #include "qeth_core.h" |
27 | #include "qeth_core_offl.h" | 27 | #include "qeth_core_offl.h" |
28 | 28 | ||
29 | static DEFINE_PER_CPU(char[256], qeth_core_dbf_txt_buf); | ||
30 | #define QETH_DBF_TXT_BUF qeth_core_dbf_txt_buf | ||
31 | |||
32 | struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS] = { | 29 | struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS] = { |
33 | /* define dbf - Name, Pages, Areas, Maxlen, Level, View, Handle */ | 30 | /* define dbf - Name, Pages, Areas, Maxlen, Level, View, Handle */ |
34 | /* N P A M L V H */ | 31 | /* N P A M L V H */ |
@@ -4067,6 +4064,18 @@ static void qeth_unregister_dbf_views(void) | |||
4067 | } | 4064 | } |
4068 | } | 4065 | } |
4069 | 4066 | ||
4067 | void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...) | ||
4068 | { | ||
4069 | char dbf_txt_buf[32]; | ||
4070 | |||
4071 | if (level > (qeth_dbf[dbf_nix].id)->level) | ||
4072 | return; | ||
4073 | snprintf(dbf_txt_buf, sizeof(dbf_txt_buf), text); | ||
4074 | debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf); | ||
4075 | |||
4076 | } | ||
4077 | EXPORT_SYMBOL_GPL(qeth_dbf_longtext); | ||
4078 | |||
4070 | static int qeth_register_dbf_views(void) | 4079 | static int qeth_register_dbf_views(void) |
4071 | { | 4080 | { |
4072 | int ret; | 4081 | int ret; |
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 3921d1631a7..7e8f6396509 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -22,9 +22,6 @@ | |||
22 | #include "qeth_core.h" | 22 | #include "qeth_core.h" |
23 | #include "qeth_core_offl.h" | 23 | #include "qeth_core_offl.h" |
24 | 24 | ||
25 | #define QETH_DBF_TXT_BUF qeth_l2_dbf_txt_buf | ||
26 | static DEFINE_PER_CPU(char[256], qeth_l2_dbf_txt_buf); | ||
27 | |||
28 | static int qeth_l2_set_offline(struct ccwgroup_device *); | 25 | static int qeth_l2_set_offline(struct ccwgroup_device *); |
29 | static int qeth_l2_stop(struct net_device *); | 26 | static int qeth_l2_stop(struct net_device *); |
30 | static int qeth_l2_send_delmac(struct qeth_card *, __u8 *); | 27 | static int qeth_l2_send_delmac(struct qeth_card *, __u8 *); |
diff --git a/drivers/s390/net/qeth_l3.h b/drivers/s390/net/qeth_l3.h index 1be353593a5..9f143c83bba 100644 --- a/drivers/s390/net/qeth_l3.h +++ b/drivers/s390/net/qeth_l3.h | |||
@@ -13,9 +13,6 @@ | |||
13 | 13 | ||
14 | #include "qeth_core.h" | 14 | #include "qeth_core.h" |
15 | 15 | ||
16 | #define QETH_DBF_TXT_BUF qeth_l3_dbf_txt_buf | ||
17 | DECLARE_PER_CPU(char[256], qeth_l3_dbf_txt_buf); | ||
18 | |||
19 | struct qeth_ipaddr { | 16 | struct qeth_ipaddr { |
20 | struct list_head entry; | 17 | struct list_head entry; |
21 | enum qeth_ip_types type; | 18 | enum qeth_ip_types type; |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index e1bfe56087d..62a54364a51 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -28,8 +28,6 @@ | |||
28 | #include "qeth_l3.h" | 28 | #include "qeth_l3.h" |
29 | #include "qeth_core_offl.h" | 29 | #include "qeth_core_offl.h" |
30 | 30 | ||
31 | DEFINE_PER_CPU(char[256], qeth_l3_dbf_txt_buf); | ||
32 | |||
33 | static int qeth_l3_set_offline(struct ccwgroup_device *); | 31 | static int qeth_l3_set_offline(struct ccwgroup_device *); |
34 | static int qeth_l3_recover(void *); | 32 | static int qeth_l3_recover(void *); |
35 | static int qeth_l3_stop(struct net_device *); | 33 | static int qeth_l3_stop(struct net_device *); |