diff options
author | Nikola Jelic <nikola.jelic83@gmail.com> | 2017-04-08 12:44:41 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-04-10 14:44:08 -0300 |
commit | eef04f82783d6cc712c899cff81e56c384dc06ac (patch) | |
tree | c2090a342f3b66ae90147e12641285cfa5a2cd49 | |
parent | 41309271448e559afe208f1e89d4d30b83259678 (diff) | |
download | linux-eef04f82783d6cc712c899cff81e56c384dc06ac.tar.bz2 |
[media] media: bcm2048: fix several macros
Some of the macros didn't use the parenthesis around the parameters when
used in the body of the macro.
Signed-off-by: Nikola Jelic <nikola.jelic83@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/staging/media/bcm2048/radio-bcm2048.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index 375c6178032a..38f72d069e27 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -177,12 +177,12 @@ #define BCM2048_FREQDEV_UNIT 10000 #define BCM2048_FREQV4L2_MULTI 625 -#define dev_to_v4l2(f) ((f * BCM2048_FREQDEV_UNIT) / BCM2048_FREQV4L2_MULTI) -#define v4l2_to_dev(f) ((f * BCM2048_FREQV4L2_MULTI) / BCM2048_FREQDEV_UNIT) +#define dev_to_v4l2(f) (((f) * BCM2048_FREQDEV_UNIT) / BCM2048_FREQV4L2_MULTI) +#define v4l2_to_dev(f) (((f) * BCM2048_FREQV4L2_MULTI) / BCM2048_FREQDEV_UNIT) -#define msb(x) ((u8)((u16)x >> 8)) -#define lsb(x) ((u8)((u16)x & 0x00FF)) -#define compose_u16(msb, lsb) (((u16)msb << 8) | lsb) +#define msb(x) ((u8)((u16)(x) >> 8)) +#define lsb(x) ((u8)((u16)(x) & 0x00FF)) +#define compose_u16(msb, lsb) (((u16)(msb) << 8) | (lsb)) #define BCM2048_DEFAULT_POWERING_DELAY 20 #define BCM2048_DEFAULT_REGION 0x02 @@ -2016,7 +2016,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev, \ if (!bdev) \ return -ENODEV; \ \ - out = kzalloc(size + 1, GFP_KERNEL); \ + out = kzalloc((size) + 1, GFP_KERNEL); \ if (!out) \ return -ENOMEM; \ \ |