diff options
author | Leonardo Brás <leobras.c@gmail.com> | 2018-08-07 21:28:16 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-08 14:23:16 +0200 |
commit | 0b1533c6c6f63bca9807fd6f295d769b6f4b5a11 (patch) | |
tree | 792f54ef8386e5043db1d4f3d509c9fbbdf4863a /drivers/staging/fbtft/fbtft.h | |
parent | 243638bc1c76a34d709432a59453f31123408742 (diff) |
staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style
Puts macro arguments in parenthesis to avoid precedence issues.
Some large lines were broken to fit the 80-char limit.
Signed-off-by: Leonardo Brás <leobras.c@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fbtft/fbtft.h')
-rw-r--r-- | drivers/staging/fbtft/fbtft.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index c7cb4a7896f4..0c710d374fab 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -234,8 +234,8 @@ struct fbtft_par { #define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int)) -#define write_reg(par, ...) \ - par->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__) +#define write_reg(par, ...) \ + ((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__)) /* fbtft-core.c */ int fbtft_write_buf_dc(struct fbtft_par *par, void *buf, size_t len, int dc); @@ -404,8 +404,9 @@ do { \ #define fbtft_par_dbg_hex(level, par, dev, type, buf, num, format, arg...) \ do { \ - if (unlikely(par->debug & level)) \ - fbtft_dbg_hex(dev, sizeof(type), buf, num * sizeof(type), format, ##arg); \ + if (unlikely((par)->debug & (level))) \ + fbtft_dbg_hex(dev, sizeof(type), buf,\ + (num) * sizeof(type), format, ##arg); \ } while (0) #endif /* __LINUX_FBTFT_H */ |