From: frank.blaschka@de.ibm.com
To: jgarzik@pobox.com
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
Peter Tiedemann <ptiedem@de.ibm.com>
Subject: [patch 04/11] qeth module size reduction.
Date: Thu, 24 Apr 2008 10:15:21 +0200 [thread overview]
Message-ID: <20080424081904.171852000@de.ibm.com> (raw)
In-Reply-To: 20080424081517.987104000@de.ibm.com
[-- Attachment #1: 703-qeth-dbf.diff --]
[-- Type: text/plain, Size: 4746 bytes --]
From: Peter Tiedemann <ptiedem@de.ibm.com>
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>
---
drivers/s390/net/qeth_core.h | 18 ++----------------
drivers/s390/net/qeth_core_main.c | 15 ++++++++++++---
drivers/s390/net/qeth_l2_main.c | 3 ---
drivers/s390/net/qeth_l3.h | 3 ---
drivers/s390/net/qeth_l3_main.c | 2 --
5 files changed, 14 insertions(+), 27 deletions(-)
diff -urpN linux-2.6/drivers/s390/net/qeth_core.h linux-2.6-patched/drivers/s390/net/qeth_core.h
--- linux-2.6/drivers/s390/net/qeth_core.h 2008-04-23 17:52:28.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_core.h 2008-04-23 17:55:50.000000000 +0200
@@ -72,22 +72,7 @@ struct qeth_dbf_info {
debug_sprintf_event(qeth_dbf[QETH_DBF_MSG].id, level, text)
#define QETH_DBF_TEXT_(name, level, text...) \
- do { \
- if (qeth_dbf_passes(qeth_dbf[QETH_DBF_##name].id, level)) { \
- char *dbf_txt_buf = \
- get_cpu_var(QETH_DBF_TXT_BUF); \
- sprintf(dbf_txt_buf, text); \
- debug_text_event(qeth_dbf[QETH_DBF_##name].id, \
- level, dbf_txt_buf); \
- put_cpu_var(QETH_DBF_TXT_BUF); \
- } \
- } while (0)
-
-/* Allow to sort out low debug levels early to avoid wasted sprints */
-static inline int qeth_dbf_passes(debug_info_t *dbf_grp, int level)
-{
- return (level <= dbf_grp->level);
-}
+ qeth_dbf_longtext(QETH_DBF_##name, level, text)
/**
* some more debug stuff
@@ -894,6 +879,7 @@ void qeth_core_get_ethtool_stats(struct
struct ethtool_stats *, u64 *);
void qeth_core_get_strings(struct net_device *, u32, u8 *);
void qeth_core_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
+void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...);
/* exports for OSN */
int qeth_osn_assist(struct net_device *, void *, int);
diff -urpN linux-2.6/drivers/s390/net/qeth_core_main.c linux-2.6-patched/drivers/s390/net/qeth_core_main.c
--- linux-2.6/drivers/s390/net/qeth_core_main.c 2008-04-23 17:55:50.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_core_main.c 2008-04-23 17:55:50.000000000 +0200
@@ -26,9 +26,6 @@
#include "qeth_core.h"
#include "qeth_core_offl.h"
-static DEFINE_PER_CPU(char[256], qeth_core_dbf_txt_buf);
-#define QETH_DBF_TXT_BUF qeth_core_dbf_txt_buf
-
struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS] = {
/* define dbf - Name, Pages, Areas, Maxlen, Level, View, Handle */
/* N P A M L V H */
@@ -4067,6 +4064,18 @@ static void qeth_unregister_dbf_views(vo
}
}
+void qeth_dbf_longtext(enum qeth_dbf_names dbf_nix, int level, char *text, ...)
+{
+ char dbf_txt_buf[32];
+
+ if (level > (qeth_dbf[dbf_nix].id)->level)
+ return;
+ snprintf(dbf_txt_buf, sizeof(dbf_txt_buf), text);
+ debug_text_event(qeth_dbf[dbf_nix].id, level, dbf_txt_buf);
+
+}
+EXPORT_SYMBOL_GPL(qeth_dbf_longtext);
+
static int qeth_register_dbf_views(void)
{
int ret;
diff -urpN linux-2.6/drivers/s390/net/qeth_l2_main.c linux-2.6-patched/drivers/s390/net/qeth_l2_main.c
--- linux-2.6/drivers/s390/net/qeth_l2_main.c 2008-04-23 17:52:28.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_l2_main.c 2008-04-23 17:55:50.000000000 +0200
@@ -22,9 +22,6 @@
#include "qeth_core.h"
#include "qeth_core_offl.h"
-#define QETH_DBF_TXT_BUF qeth_l2_dbf_txt_buf
-static DEFINE_PER_CPU(char[256], qeth_l2_dbf_txt_buf);
-
static int qeth_l2_set_offline(struct ccwgroup_device *);
static int qeth_l2_stop(struct net_device *);
static int qeth_l2_send_delmac(struct qeth_card *, __u8 *);
diff -urpN linux-2.6/drivers/s390/net/qeth_l3.h linux-2.6-patched/drivers/s390/net/qeth_l3.h
--- linux-2.6/drivers/s390/net/qeth_l3.h 2008-04-23 17:52:28.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_l3.h 2008-04-23 17:55:50.000000000 +0200
@@ -13,9 +13,6 @@
#include "qeth_core.h"
-#define QETH_DBF_TXT_BUF qeth_l3_dbf_txt_buf
-DECLARE_PER_CPU(char[256], qeth_l3_dbf_txt_buf);
-
struct qeth_ipaddr {
struct list_head entry;
enum qeth_ip_types type;
diff -urpN linux-2.6/drivers/s390/net/qeth_l3_main.c linux-2.6-patched/drivers/s390/net/qeth_l3_main.c
--- linux-2.6/drivers/s390/net/qeth_l3_main.c 2008-04-23 17:52:28.000000000 +0200
+++ linux-2.6-patched/drivers/s390/net/qeth_l3_main.c 2008-04-23 17:55:50.000000000 +0200
@@ -28,8 +28,6 @@
#include "qeth_l3.h"
#include "qeth_core_offl.h"
-DEFINE_PER_CPU(char[256], qeth_l3_dbf_txt_buf);
-
static int qeth_l3_set_offline(struct ccwgroup_device *);
static int qeth_l3_recover(void *);
static int qeth_l3_stop(struct net_device *);
--
next prev parent reply other threads:[~2008-04-24 8:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-24 8:15 [patch 00/11] s390: network device driver fixes for 2.6.26 frank.blaschka
2008-04-24 8:15 ` [patch 01/11] lcs: CCL-sequ. numbers required for protocol 802.2 only frank.blaschka
2008-04-29 5:59 ` Jeff Garzik
2008-04-24 8:15 ` [patch 02/11] netiucv: get rid of in_atomic() use frank.blaschka
2008-04-24 8:15 ` [patch 03/11] ccwgroup: Unify parsing for group attribute frank.blaschka
2008-04-24 8:15 ` frank.blaschka [this message]
2008-04-24 8:15 ` [patch 05/11] qeth: layer 3 support vlan IPv6 on hiper socket frank.blaschka
2008-04-24 8:15 ` [patch 06/11] qeth: provide get ethtool settings frank.blaschka
2008-04-24 8:15 ` [patch 07/11] qeth: rework fast path frank.blaschka
2008-04-24 8:15 ` [patch 08/11] qeth: layer 3 add missing dev_open/close to ccwgroup handler frank.blaschka
2008-04-24 8:15 ` [patch 09/11] qeth: read number of ports from card frank.blaschka
2008-04-24 8:15 ` [patch 10/11] qeth: layer 2 allow ethtool to set TSO frank.blaschka
2008-04-24 8:15 ` [patch 11/11] netiucv: Fix missing driver attributes frank.blaschka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080424081904.171852000@de.ibm.com \
--to=frank.blaschka@de.ibm.com \
--cc=jgarzik@pobox.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ptiedem@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).