Skip to contentSkip to conversation

staging: rts5208: Remove TRACE_RET and TRACE_GOTO macros

PATCH In review Joe Perches 1 participant 2 messages Mar 25, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rts5208: Remove TRACE_RET and TRACE_GOTO macros

Remove these flow hiding macros.

Done via coccinelle script and some typing.

@@
expression chip;
expression ret;
@@

- TRACE_RET(chip, ret);
+ rtsx_trace(chip);
+ return ret;

@@
expression chip;
identifier label;
@@

- TRACE_GOTO(chip, label);
+ rtsx_trace(chip);
+ goto label;

Miscellanea:

o Add a macro and function to replace a large inline
o Simplify #includes
o Add trace.c and update Makefile

This reduces object size quite a lot: ~350KB. (allyesconfig)

$ size drivers/staging/rts5208/built-in.o*
   text	   data	    bss	    dec	    hex	filename
 248453	  36728	  77904	 363085	  58a4d	drivers/staging/rts5208/built-in.o.new
 506691	  83352	 115896	 705939	  ac593	drivers/staging/rts5208/built-in.o.old
---
 drivers/staging/rts5208/Makefile         |    2 +-
 drivers/staging/rts5208/ms.c             | 1406 ++++++++++++++++++++----------
 drivers/staging/rts5208/rtsx.c           |    6 -
 drivers/staging/rts5208/rtsx.h           |   13 +-
 drivers/staging/rts5208/rtsx_card.c      |   85 +-
 drivers/staging/rts5208/rtsx_chip.c      |  295 ++++---
 drivers/staging/rts5208/rtsx_chip.h      |   26 +-
 drivers/staging/rts5208/rtsx_scsi.c      |  539 ++++++++----
 drivers/staging/rts5208/rtsx_transport.c |    7 +-
 drivers/staging/rts5208/sd.c             | 1389 +++++++++++++++++++----------
 drivers/staging/rts5208/spi.c            |  255 ++++--
 drivers/staging/rts5208/trace.h          |   52 +-
 drivers/staging/rts5208/xd.c             |  453 ++++++----
 13 files changed, 2971 insertions(+), 1557 deletions(-)
drivers/staging/rts5208/Makefile +1 -1
index 17b4471..f7fd03a 100644
@@ -3,4 +3,4 @@ obj-$(CONFIG_RTS5208) := rts5208.o
 ccflags-y := -Idrivers/scsi
 
 rts5208-y := rtsx.o rtsx_chip.o rtsx_transport.o rtsx_scsi.o \
-	rtsx_card.o general.o sd.o xd.o ms.o spi.o
+	rtsx_card.o general.o sd.o xd.o ms.o spi.o trace.o
drivers/staging/rts5208/ms.c +934 -472

2,870 lines not on this page · raw message

drivers/staging/rts5208/rtsx.c +0 -6
index c482a6a..d64b6ed 100644
@@ -26,12 +26,6 @@
 #include <linux/workqueue.h>
 
 #include "rtsx.h"
-#include "rtsx_chip.h"
-#include "rtsx_transport.h"
-#include "rtsx_scsi.h"
-#include "rtsx_card.h"
-#include "general.h"
-
 #include "ms.h"
 #include "sd.h"
 #include "xd.h"
drivers/staging/rts5208/rtsx.h +10 -3
index 9e6ecb7..262441b 100644
@@ -46,9 +46,6 @@
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_host.h>
 
-#include "trace.h"
-#include "general.h"
-
 #define CR_DRIVER_NAME		"rts5208"
 
 #define pci_get_bus_and_slot(bus, devfn)	\
@@ -181,4 +178,14 @@ enum xfer_buf_dir	{TO_XFER_BUF, FROM_XFER_BUF};
 
 int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val);
 
+#define _MSG_TRACE
+
+#include "trace.h"
+#include "rtsx_chip.h"
+#include "rtsx_transport.h"
+#include "rtsx_scsi.h"
+#include "rtsx_card.h"
+#include "rtsx_sys.h"
+#include "general.h"
+
 #endif  /* __REALTEK_RTSX_H */
drivers/staging/rts5208/rtsx_card.c +52 -33

90 lines not on this page · raw message

drivers/staging/rts5208/rtsx_chip.c +192 -103

295 lines not on this page · raw message

drivers/staging/rts5208/rtsx_chip.h +14 -12
index feac986..93fd7b2 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rts5208/rtsx_scsi.c +356 -183

539 lines not on this page · raw message

drivers/staging/rts5208/rtsx_transport.c +2 -5
index 03caa9b..f27491e 100644

Lines of this file are not shown. View the raw message.

drivers/staging/rts5208/sd.c +924 -465

1,389 lines not on this page · raw message

drivers/staging/rts5208/spi.c +168 -87

255 lines not on this page · raw message

drivers/staging/rts5208/trace.h +16 -36

52 lines not on this page · raw message

drivers/staging/rts5208/xd.c +302 -151

453 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.2

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 1 line · Joe Perches

Remove these flow hiding macros.

Apologies, this won't compile properly as I neglected to "git add trace.c" prior to the git commit.

I'll resend later.