Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peter Tiedemann and committed by
Jeff Garzik
cd023216 022b660a

+14 -27
+2 -16
drivers/s390/net/qeth_core.h
··· 72 72 debug_sprintf_event(qeth_dbf[QETH_DBF_MSG].id, level, text) 73 73 74 74 #define QETH_DBF_TEXT_(name, level, text...) \ 75 - do { \ 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 - } 75 + qeth_dbf_longtext(QETH_DBF_##name, level, text) 91 76 92 77 /** 93 78 * some more debug stuff ··· 879 894 struct ethtool_stats *, u64 *); 880 895 void qeth_core_get_strings(struct net_device *, u32, u8 *); 881 896 void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *); 897 + void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...); 882 898 883 899 /* exports for OSN */ 884 900 int qeth_osn_assist(struct net_device *, void *, int);
+12 -3
drivers/s390/net/qeth_core_main.c
··· 26 26 #include "qeth_core.h" 27 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 29 struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS] = { 33 30 /* define dbf - Name, Pages, Areas, Maxlen, Level, View, Handle */ 34 31 /* N P A M L V H */ ··· 4063 4066 qeth_dbf[x].id = NULL; 4064 4067 } 4065 4068 } 4069 + 4070 + void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...) 4071 + { 4072 + char dbf_txt_buf[32]; 4073 + 4074 + if (level > (qeth_dbf[dbf_nix].id)->level) 4075 + return; 4076 + snprintf(dbf_txt_buf, sizeof(dbf_txt_buf), text); 4077 + debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf); 4078 + 4079 + } 4080 + EXPORT_SYMBOL_GPL(qeth_dbf_longtext); 4066 4081 4067 4082 static int qeth_register_dbf_views(void) 4068 4083 {
-3
drivers/s390/net/qeth_l2_main.c
··· 22 22 #include "qeth_core.h" 23 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 25 static int qeth_l2_set_offline(struct ccwgroup_device *); 29 26 static int qeth_l2_stop(struct net_device *); 30 27 static int qeth_l2_send_delmac(struct qeth_card *, __u8 *);
-3
drivers/s390/net/qeth_l3.h
··· 13 13 14 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 16 struct qeth_ipaddr { 20 17 struct list_head entry; 21 18 enum qeth_ip_types type;
-2
drivers/s390/net/qeth_l3_main.c
··· 28 28 #include "qeth_l3.h" 29 29 #include "qeth_core_offl.h" 30 30 31 - DEFINE_PER_CPU(char[256], qeth_l3_dbf_txt_buf); 32 - 33 31 static int qeth_l3_set_offline(struct ccwgroup_device *); 34 32 static int qeth_l3_recover(void *); 35 33 static int qeth_l3_stop(struct net_device *);