aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-10-02 01:47:59 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-07 09:19:50 -0400
commitd92462401dde1effa04a51d0a15000e6246d2a43 (patch)
treebfb673595f0ecfcbbf7abddcb0d4eee151e15c82 /drivers/media/v4l2-core
parent1b8b10cc7e6bd9bf017c58e32b1e7f632e23850d (diff)
[media] v4l2-ioctl: fix W=1 warnings
Since the prt_names() macro is always called with an unsigned index the ((a) >= 0) condition is always true and gives a compiler warning when compiling with W=1. Rewrite the macro to avoid that warning, but cast the index to unsigned just in case it is ever called with a signed argument. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-ioctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 11874c170cbe..8f388ff31ebb 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -157,8 +157,7 @@ static const char *v4l2_memory_names[] = {
157 [V4L2_MEMORY_OVERLAY] = "overlay", 157 [V4L2_MEMORY_OVERLAY] = "overlay",
158}; 158};
159 159
160#define prt_names(a, arr) ((((a) >= 0) && ((a) < ARRAY_SIZE(arr))) ? \ 160#define prt_names(a, arr) (((unsigned)(a)) < ARRAY_SIZE(arr) ? arr[a] : "unknown")
161 arr[a] : "unknown")
162 161
163/* ------------------------------------------------------------------ */ 162/* ------------------------------------------------------------------ */
164/* debug help functions */ 163/* debug help functions */