diff options
author | Joe Perches | 2015-03-25 20:54:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2015-03-26 13:17:05 +0100 |
commit | 8ee775f92c8af2eb1626d39f06feac04fe0cb6e0 (patch) | |
tree | 99c4d76caa68351c18e18e39ed3e22975004ef2a /drivers/staging/rts5208/rtsx_chip.h | |
parent | staging: rts5208: Remove TRACE_RET and TRACE_GOTO macros (diff) | |
download | kernel-qcow2-linux-8ee775f92c8af2eb1626d39f06feac04fe0cb6e0.tar.gz kernel-qcow2-linux-8ee775f92c8af2eb1626d39f06feac04fe0cb6e0.tar.xz kernel-qcow2-linux-8ee775f92c8af2eb1626d39f06feac04fe0cb6e0.zip |
staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macros
Macros with hidden flow control are bad form as the code path
taken can be unexpected for the reader.
Expand these in-place and remove the macros.
Done with coccinelle script:
@@
expression chip;
expression arg1;
expression arg2;
expression arg3;
@@
- RTSX_WRITE_REG(chip, arg1, arg2, arg3);
+ retval = rtsx_write_register(chip, arg1, arg2, arg3);
+ if (retval) {
+ rtsx_trace(chip);
+ return retval;
+ }
@@
expression chip;
expression arg1;
expression arg2;
@@
- RTSX_READ_REG(chip, arg1, arg2);
+ retval = rtsx_read_register(chip, arg1, arg2);
+ if (retval) {
+ rtsx_trace(chip);
+ return retval;
+ }
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 | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/staging/rts5208/rtsx_chip.h b/drivers/staging/rts5208/rtsx_chip.h index 93fd7b286f49..c295b1eedb44 100644 --- a/drivers/staging/rts5208/rtsx_chip.h +++ b/drivers/staging/rts5208/rtsx_chip.h @@ -988,22 +988,4 @@ int rtsx_read_ppbuf(struct rtsx_chip *chip, u8 *buf, int buf_len); 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) { \ - 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) { \ - rtsx_trace(chip); \ - return retval; \ - } \ -} while (0) - #endif /* __REALTEK_RTSX_CHIP_H */ |