staging: rts5208: Remove RTSX_READ_REG and RTSX_WRITE_REG macros
authorJoe Perches <joe@perches.com>
Wed, 25 Mar 2015 19:54:26 +0000 (12:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 12:17:05 +0000 (13:17 +0100)
commit8ee775f92c8af2eb1626d39f06feac04fe0cb6e0
tree99c4d76caa68351c18e18e39ed3e22975004ef2a
parent031366ea65495f787eb792a135f51c093d75a197
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>
drivers/staging/rts5208/ms.c
drivers/staging/rts5208/rtsx_card.c
drivers/staging/rts5208/rtsx_card.h
drivers/staging/rts5208/rtsx_chip.c
drivers/staging/rts5208/rtsx_chip.h
drivers/staging/rts5208/sd.c
drivers/staging/rts5208/spi.c
drivers/staging/rts5208/xd.c