Re: [PATCH] staging:bcm2048 : Add parentheses around variable x

2017-02-15 Thread Tabrez Khan
On Fri, Feb 3, 2017 at 3:42 PM, Dan Carpenter  wrote:
> On Sat, Dec 03, 2016 at 03:14:26PM +0530, Tabrez khan wrote:
>> Add parentheses around variable x for the readability purpose.
>>
>
> It's not really about readability...
>
> regards,
> dan carpenter
>
 I will resend it again.

-- 
Regards
Tabrez Khan


Re: [PATCH] staging:bcm2048 : Add parentheses around variable x

2017-02-03 Thread Dan Carpenter
On Sat, Dec 03, 2016 at 03:14:26PM +0530, Tabrez khan wrote:
> Add parentheses around variable x for the readability purpose.
> 

It's not really about readability...

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] staging:bcm2048 : Add parentheses around variable x

2017-02-03 Thread Mauro Carvalho Chehab
Em Sat,  3 Dec 2016 15:14:26 +0530
Tabrez khan  escreveu:

> Add parentheses around variable x for the readability purpose.
> 
> This warning was found using checkpatch.pl.
> 
> Signed-off-by: Tabrez khan 
> ---
>  drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
> b/drivers/staging/media/bcm2048/radio-bcm2048.c
> index 4d9bd02..2f28dd0 100644
> --- a/drivers/staging/media/bcm2048/radio-bcm2048.c
> +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
> @@ -185,7 +185,7 @@
>  #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 lsb(x)  ((u8)((u16)(x) &  0x00FF))

If you're willing to do that, you should do on all macros. Also,
plese remove the extra space before the hexa value.

>  #define compose_u16(msb, lsb)(((u16)msb << 8) | lsb)
>  
>  #define BCM2048_DEFAULT_POWERING_DELAY   20



Thanks,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging:bcm2048 : Add parentheses around variable x

2016-12-03 Thread Tabrez khan
Add parentheses around variable x for the readability purpose.

This warning was found using checkpatch.pl.

Signed-off-by: Tabrez khan 
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c 
b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 4d9bd02..2f28dd0 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -185,7 +185,7 @@
 #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 lsb(x)  ((u8)((u16)(x) &  0x00FF))
 #define compose_u16(msb, lsb)  (((u16)msb << 8) | lsb)
 
 #define BCM2048_DEFAULT_POWERING_DELAY 20
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html