diff mbox

[1/2,media] tvp5150: Fix type mismatch warning in clamp macro

Message ID 1393519488-5427-1-git-send-email-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel Feb. 27, 2014, 4:44 p.m. UTC
This patch fixes the following warning:

drivers/media/i2c/tvp5150.c: In function '__tvp5150_try_crop':
include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__min);  \
                 ^
drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
  rect->width = clamp(rect->width,
                ^
include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__max);  \
                 ^
drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
  rect->width = clamp(rect->width,
                ^
include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__min);  \
                 ^
drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
  rect->height = clamp(rect->height,
                 ^
include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
  (void) (&__val == &__max);  \
                 ^
drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
  rect->height = clamp(rect->height,
                 ^

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/i2c/tvp5150.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Lad, Prabhakar March 2, 2014, 6:26 a.m. UTC | #1
Hi Philipp,

Thanks for the patch.

On Thu, Feb 27, 2014 at 10:14 PM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> This patch fixes the following warning:
>
> drivers/media/i2c/tvp5150.c: In function '__tvp5150_try_crop':
> include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
>   (void) (&__val == &__min);  \
>                  ^
> drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
>   rect->width = clamp(rect->width,
>                 ^
> include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
>   (void) (&__val == &__max);  \
>                  ^
> drivers/media/i2c/tvp5150.c:886:16: note: in expansion of macro 'clamp'
>   rect->width = clamp(rect->width,
>                 ^
> include/linux/kernel.h:762:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
>   (void) (&__val == &__min);  \
>                  ^
> drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
>   rect->height = clamp(rect->height,
>                  ^
> include/linux/kernel.h:763:17: warning: comparison of distinct pointer types lacks a cast [enabled by default]
>   (void) (&__val == &__max);  \
>                  ^
> drivers/media/i2c/tvp5150.c:904:17: note: in expansion of macro 'clamp'
>   rect->height = clamp(rect->height,
>                  ^
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

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

Patch

diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c
index 542d252..8ac52fc 100644
--- a/drivers/media/i2c/tvp5150.c
+++ b/drivers/media/i2c/tvp5150.c
@@ -16,9 +16,9 @@ 
 
 #include "tvp5150_reg.h"
 
-#define TVP5150_H_MAX		720
-#define TVP5150_V_MAX_525_60	480
-#define TVP5150_V_MAX_OTHERS	576
+#define TVP5150_H_MAX		720U
+#define TVP5150_V_MAX_525_60	480U
+#define TVP5150_V_MAX_OTHERS	576U
 #define TVP5150_MAX_CROP_LEFT	511
 #define TVP5150_MAX_CROP_TOP	127
 #define TVP5150_CROP_SHIFT	2