diff options
author | Joe Perches | 2015-03-25 20:54:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2015-03-26 13:16:19 +0100 |
commit | 031366ea65495f787eb792a135f51c093d75a197 (patch) | |
tree | 21b523d33f37b7d66cfcf798cb3ba43be8e1cc61 /drivers/staging/rts5208/rtsx_chip.h | |
parent | Staging: rtl8188eu: replace kzalloc and memcpy by kmemdup (diff) | |
download | kernel-qcow2-linux-031366ea65495f787eb792a135f51c093d75a197.tar.gz kernel-qcow2-linux-031366ea65495f787eb792a135f51c093d75a197.tar.xz kernel-qcow2-linux-031366ea65495f787eb792a135f51c093d75a197.zip |
staging: rts5208: Remove TRACE_RET and TRACE_GOTO macros
Remove these flow hiding macros.
Miscellanea:
o Add a macro and function to replace a large inline
o Simplify #includes
o Add trace.c and update Makefile
o Remove static inline filename function and use kbasename instead
This reduces object size quite a lot: ~350KB (x86-64 allyesconfig)
$ size drivers/staging/rts5208/built-in.o*
text data bss dec hex filename
248385 36728 77888 363001 589f9 drivers/staging/rts5208/built-in.o.new
506691 83352 115896 705939 ac593 drivers/staging/rts5208/built-in.o.old
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;
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208/rtsx_chip.h')
-rw-r--r-- | drivers/staging/rts5208/rtsx_chip.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/staging/rts5208/rtsx_chip.h b/drivers/staging/rts5208/rtsx_chip.h index feac98661cec..93fd7b286f49 100644 --- a/drivers/staging/rts5208/rtsx_chip.h +++ b/drivers/staging/rts5208/rtsx_chip.h @@ -989,19 +989,21 @@ int rtsx_write_ppbuf(struct rtsx_chip *chip, u8 *buf, int buf_len); int rtsx_check_chip_exist(struct rtsx_chip *chip); #define RTSX_WRITE_REG(chip, addr, mask, data) \ - do { \ - int retval = rtsx_write_register((chip), (addr), (mask), (data)); \ - if (retval != STATUS_SUCCESS) { \ - TRACE_RET((chip), retval); \ - } \ - } while (0) +do { \ + int retval = rtsx_write_register(chip, addr, mask, data); \ + if (retval != STATUS_SUCCESS) { \ + rtsx_trace(chip); \ + return retval; \ + } \ +} while (0) #define RTSX_READ_REG(chip, addr, data) \ - do { \ - int retval = rtsx_read_register((chip), (addr), (data)); \ - if (retval != STATUS_SUCCESS) { \ - TRACE_RET((chip), retval); \ - } \ - } while (0) +do { \ + int retval = rtsx_read_register(chip, addr, data); \ + if (retval != STATUS_SUCCESS) { \ + rtsx_trace(chip); \ + return retval; \ + } \ +} while (0) #endif /* __REALTEK_RTSX_CHIP_H */ |