OSDN Git Service

media: v4l2-compat-ioctl32: simplify casts
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 17 Apr 2018 13:01:46 +0000 (09:01 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 20 Apr 2018 12:22:18 +0000 (08:22 -0400)
commit09c033b66596a9c38f61875c80c674c4fed61b86
treeffa1702d9579b717e9057e9fa9684b3ff2ee4562
parent6dd0394f5fcd51ce6892627eefbadcf42441e94d
media: v4l2-compat-ioctl32: simplify casts

Making the cast right for get_user/put_user is not trivial, as
it needs to ensure that the types are the correct ones.

Improve it by using macros.

Tested with vivid with:
$ sudo modprobe vivid no_error_inj=1
$ v4l2-compliance-32bits -a -s10 >32bits && v4l2-compliance-64bits -a -s10 > 64bits && diff -U0 32bits 64bits
--- 32bits 2018-04-17 11:18:29.141240772 -0300
+++ 64bits 2018-04-17 11:18:40.635282341 -0300
@@ -1 +1 @@
-v4l2-compliance SHA   : bc71e4a67c6fbc5940062843bc41e7c8679634ce, 32 bits
+v4l2-compliance SHA   : bc71e4a67c6fbc5940062843bc41e7c8679634ce, 64 bits

Using the latest version of v4l-utils with this patch applied:
https://patchwork.linuxtv.org/patch/48746/

Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-compat-ioctl32.c