diff mbox series

[1/2] v4l-utils: fix formats under ppc/mips64

Message ID 20240610212316.136612-1-rosenp@gmail.com (mailing list archive)
State New
Headers show
Series [1/2] v4l-utils: fix formats under ppc/mips64 | expand

Commit Message

Rosen Penev June 10, 2024, 9:23 p.m. UTC
By default, these platforms use long instead of long long for __u64.
__SANE_USERSPACE_TYPES__ fixes -Wformat warnings.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 contrib/xc3028-firmware/firmware-tool.c | 2 ++
 include/linux/compiler.h                | 1 +
 utils/cec-compliance/cec-compliance.h   | 2 ++
 utils/cec-ctl/cec-ctl.cpp               | 2 ++
 utils/cec-ctl/cec-ctl.h                 | 2 ++
 utils/cec-ctl/cec-pin.cpp               | 2 ++
 utils/cec-follower/cec-processing.cpp   | 2 ++
 utils/common/v4l2-info.h                | 2 ++
 utils/cx18-ctl/cx18-ctl.c               | 2 ++
 utils/ivtv-ctl/ivtv-ctl.c               | 2 ++
 utils/keytable/keytable.c               | 2 ++
 utils/media-ctl/media-ctl.c             | 2 ++
 utils/v4l2-compliance/v4l2-compliance.h | 2 ++
 utils/v4l2-ctl/v4l2-ctl-common.cpp      | 2 ++
 utils/v4l2-ctl/v4l2-ctl-streaming.cpp   | 2 ++
 utils/v4l2-ctl/v4l2-ctl.cpp             | 2 ++
 utils/v4l2-ctl/v4l2-ctl.h               | 2 ++
 utils/v4l2-dbg/v4l2-dbg.cpp             | 2 ++
 18 files changed, 35 insertions(+)

Comments

Hans Verkuil June 30, 2024, 8:24 a.m. UTC | #1
Hi Rosen,

On 10/06/2024 23:23, Rosen Penev wrote:
> By default, these platforms use long instead of long long for __u64.
> __SANE_USERSPACE_TYPES__ fixes -Wformat warnings.

I think this needs a more extensive commit message.

See e.g. https://lists.openembedded.org/g/openembedded-core/message/46881
(found after googling for __SANE_USERSPACE_TYPES__).

> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  contrib/xc3028-firmware/firmware-tool.c | 2 ++
>  include/linux/compiler.h                | 1 +
>  utils/cec-compliance/cec-compliance.h   | 2 ++
>  utils/cec-ctl/cec-ctl.cpp               | 2 ++
>  utils/cec-ctl/cec-ctl.h                 | 2 ++
>  utils/cec-ctl/cec-pin.cpp               | 2 ++
>  utils/cec-follower/cec-processing.cpp   | 2 ++
>  utils/common/v4l2-info.h                | 2 ++
>  utils/cx18-ctl/cx18-ctl.c               | 2 ++
>  utils/ivtv-ctl/ivtv-ctl.c               | 2 ++
>  utils/keytable/keytable.c               | 2 ++
>  utils/media-ctl/media-ctl.c             | 2 ++
>  utils/v4l2-compliance/v4l2-compliance.h | 2 ++
>  utils/v4l2-ctl/v4l2-ctl-common.cpp      | 2 ++
>  utils/v4l2-ctl/v4l2-ctl-streaming.cpp   | 2 ++
>  utils/v4l2-ctl/v4l2-ctl.cpp             | 2 ++
>  utils/v4l2-ctl/v4l2-ctl.h               | 2 ++
>  utils/v4l2-dbg/v4l2-dbg.cpp             | 2 ++
>  18 files changed, 35 insertions(+)
> 
> diff --git a/contrib/xc3028-firmware/firmware-tool.c b/contrib/xc3028-firmware/firmware-tool.c
> index 5dd205e0..6bcb3237 100644
> --- a/contrib/xc3028-firmware/firmware-tool.c
> +++ b/contrib/xc3028-firmware/firmware-tool.c
> @@ -29,6 +29,8 @@
>  #include <string.h>
>  #include <unistd.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <asm/byteorder.h>
>  #include <asm/types.h>
>  
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index 379629be..5a6326f8 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -1,6 +1,7 @@
>  #ifndef __linux_compiler_h
>  #define __linux_compiler_h
>  
> +#define __SANE_USERSPACE_TYPES__

This needs a comment as well.

Regards,

	Hans

>  #define __user
>  
>  #endif
> diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
> index aae72842..d5bd1d0a 100644
> --- a/utils/cec-compliance/cec-compliance.h
> +++ b/utils/cec-compliance/cec-compliance.h
> @@ -8,6 +8,8 @@
>  #ifndef _CEC_COMPLIANCE_H_
>  #define _CEC_COMPLIANCE_H_
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/cec-funcs.h>
>  #include "cec-htng-funcs.h"
>  
> diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
> index 8848a49d..69aeb8cd 100644
> --- a/utils/cec-ctl/cec-ctl.cpp
> +++ b/utils/cec-ctl/cec-ctl.cpp
> @@ -20,6 +20,8 @@
>  #include <sys/time.h>
>  #include <unistd.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/cec-funcs.h>
>  #include "cec-htng-funcs.h"
>  #include "cec-log.h"
> diff --git a/utils/cec-ctl/cec-ctl.h b/utils/cec-ctl/cec-ctl.h
> index 2c82bedc..e0692c31 100644
> --- a/utils/cec-ctl/cec-ctl.h
> +++ b/utils/cec-ctl/cec-ctl.h
> @@ -6,6 +6,8 @@
>  #ifndef _CEC_CTL_H_
>  #define _CEC_CTL_H_
>  
> +#include "linux/compiler.h"
> +
>  #include <cec-info.h>
>  
>  // cec-ctl.cpp
> diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
> index f3500555..0cdc19f7 100644
> --- a/utils/cec-ctl/cec-pin.cpp
> +++ b/utils/cec-ctl/cec-pin.cpp
> @@ -3,6 +3,8 @@
>   * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
>   */
>  
> +#include "linux/compiler.h"
> +
>  #include <string>
>  
>  #include <linux/cec.h>
> diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
> index 14ee211b..3b5c3ce5 100644
> --- a/utils/cec-follower/cec-processing.cpp
> +++ b/utils/cec-follower/cec-processing.cpp
> @@ -3,6 +3,8 @@
>   * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
>   */
>  
> +#include "linux/compiler.h"
> +
>  #include <cerrno>
>  #include <ctime>
>  #include <string>
> diff --git a/utils/common/v4l2-info.h b/utils/common/v4l2-info.h
> index ac227971..eeb7bc6b 100644
> --- a/utils/common/v4l2-info.h
> +++ b/utils/common/v4l2-info.h
> @@ -8,6 +8,8 @@
>  
>  #include <string>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/videodev2.h>
>  #include <linux/v4l2-subdev.h>
>  
> diff --git a/utils/cx18-ctl/cx18-ctl.c b/utils/cx18-ctl/cx18-ctl.c
> index 8586f72d..7c13b1a3 100644
> --- a/utils/cx18-ctl/cx18-ctl.c
> +++ b/utils/cx18-ctl/cx18-ctl.c
> @@ -34,6 +34,8 @@
>  #include <sys/time.h>
>  #include <math.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/videodev2.h>
>  #include <v4l-getsubopt.h>
>  
> diff --git a/utils/ivtv-ctl/ivtv-ctl.c b/utils/ivtv-ctl/ivtv-ctl.c
> index b42b3489..bf36f40b 100644
> --- a/utils/ivtv-ctl/ivtv-ctl.c
> +++ b/utils/ivtv-ctl/ivtv-ctl.c
> @@ -34,6 +34,8 @@
>  #include <sys/time.h>
>  #include <math.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/videodev2.h>
>  #include <v4l-getsubopt.h>
>  
> diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
> index b6474d5c..a726921a 100644
> --- a/utils/keytable/keytable.c
> +++ b/utils/keytable/keytable.c
> @@ -12,6 +12,8 @@
>     GNU General Public License for more details.
>   */
>  
> +#include "linux/compiler.h"
> +
>  #include <ctype.h>
>  #include <errno.h>
>  #include <fcntl.h>
> diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
> index 1a9e393a..b180185f 100644
> --- a/utils/media-ctl/media-ctl.c
> +++ b/utils/media-ctl/media-ctl.c
> @@ -34,6 +34,8 @@
>  #include <string.h>
>  #include <unistd.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/media.h>
>  #include <linux/types.h>
>  #include <linux/v4l2-mediabus.h>
> diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
> index 3517bd07..2c2b2158 100644
> --- a/utils/v4l2-compliance/v4l2-compliance.h
> +++ b/utils/v4l2-compliance/v4l2-compliance.h
> @@ -26,6 +26,8 @@
>  #include <string>
>  #include <cstdint>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/videodev2.h>
>  #include <linux/v4l2-subdev.h>
>  #include <linux/media.h>
> diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> index 1f9cd0fb..ea120eb8 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
> @@ -9,6 +9,8 @@
>  #include <sys/stat.h>
>  #include <sys/sysmacros.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/media.h>
>  
>  #include "v4l2-ctl.h"
> diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> index 13bc057d..7af62ec8 100644
> --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
> @@ -3,6 +3,8 @@
>  #include <netdb.h>
>  #include <sys/types.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/media.h>
>  
>  #include "compiler.h"
> diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
> index a64fa514..d8a6c617 100644
> --- a/utils/v4l2-ctl/v4l2-ctl.cpp
> +++ b/utils/v4l2-ctl/v4l2-ctl.cpp
> @@ -27,6 +27,8 @@
>  #include <getopt.h>
>  #include <sys/epoll.h>
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/media.h>
>  
>  #include "v4l2-ctl.h"
> diff --git a/utils/v4l2-ctl/v4l2-ctl.h b/utils/v4l2-ctl/v4l2-ctl.h
> index a1911e80..fd1bd24a 100644
> --- a/utils/v4l2-ctl/v4l2-ctl.h
> +++ b/utils/v4l2-ctl/v4l2-ctl.h
> @@ -1,6 +1,8 @@
>  #ifndef _V4L2_CTL_H
>  #define _V4L2_CTL_H
>  
> +#include "linux/compiler.h"
> +
>  #include <cstdint>
>  #include <linux/videodev2.h>
>  #include <linux/v4l2-subdev.h>
> diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
> index bd08b4cf..1b0d278a 100644
> --- a/utils/v4l2-dbg/v4l2-dbg.cpp
> +++ b/utils/v4l2-dbg/v4l2-dbg.cpp
> @@ -31,6 +31,8 @@
>  #include <sys/klog.h>
>  #endif
>  
> +#include "linux/compiler.h"
> +
>  #include <linux/videodev2.h>
>  #include <v4l-getsubopt.h>
>
diff mbox series

Patch

diff --git a/contrib/xc3028-firmware/firmware-tool.c b/contrib/xc3028-firmware/firmware-tool.c
index 5dd205e0..6bcb3237 100644
--- a/contrib/xc3028-firmware/firmware-tool.c
+++ b/contrib/xc3028-firmware/firmware-tool.c
@@ -29,6 +29,8 @@ 
 #include <string.h>
 #include <unistd.h>
 
+#include "linux/compiler.h"
+
 #include <asm/byteorder.h>
 #include <asm/types.h>
 
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 379629be..5a6326f8 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -1,6 +1,7 @@ 
 #ifndef __linux_compiler_h
 #define __linux_compiler_h
 
+#define __SANE_USERSPACE_TYPES__
 #define __user
 
 #endif
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index aae72842..d5bd1d0a 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -8,6 +8,8 @@ 
 #ifndef _CEC_COMPLIANCE_H_
 #define _CEC_COMPLIANCE_H_
 
+#include "linux/compiler.h"
+
 #include <linux/cec-funcs.h>
 #include "cec-htng-funcs.h"
 
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index 8848a49d..69aeb8cd 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -20,6 +20,8 @@ 
 #include <sys/time.h>
 #include <unistd.h>
 
+#include "linux/compiler.h"
+
 #include <linux/cec-funcs.h>
 #include "cec-htng-funcs.h"
 #include "cec-log.h"
diff --git a/utils/cec-ctl/cec-ctl.h b/utils/cec-ctl/cec-ctl.h
index 2c82bedc..e0692c31 100644
--- a/utils/cec-ctl/cec-ctl.h
+++ b/utils/cec-ctl/cec-ctl.h
@@ -6,6 +6,8 @@ 
 #ifndef _CEC_CTL_H_
 #define _CEC_CTL_H_
 
+#include "linux/compiler.h"
+
 #include <cec-info.h>
 
 // cec-ctl.cpp
diff --git a/utils/cec-ctl/cec-pin.cpp b/utils/cec-ctl/cec-pin.cpp
index f3500555..0cdc19f7 100644
--- a/utils/cec-ctl/cec-pin.cpp
+++ b/utils/cec-ctl/cec-pin.cpp
@@ -3,6 +3,8 @@ 
  * Copyright 2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  */
 
+#include "linux/compiler.h"
+
 #include <string>
 
 #include <linux/cec.h>
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index 14ee211b..3b5c3ce5 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -3,6 +3,8 @@ 
  * Copyright 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
  */
 
+#include "linux/compiler.h"
+
 #include <cerrno>
 #include <ctime>
 #include <string>
diff --git a/utils/common/v4l2-info.h b/utils/common/v4l2-info.h
index ac227971..eeb7bc6b 100644
--- a/utils/common/v4l2-info.h
+++ b/utils/common/v4l2-info.h
@@ -8,6 +8,8 @@ 
 
 #include <string>
 
+#include "linux/compiler.h"
+
 #include <linux/videodev2.h>
 #include <linux/v4l2-subdev.h>
 
diff --git a/utils/cx18-ctl/cx18-ctl.c b/utils/cx18-ctl/cx18-ctl.c
index 8586f72d..7c13b1a3 100644
--- a/utils/cx18-ctl/cx18-ctl.c
+++ b/utils/cx18-ctl/cx18-ctl.c
@@ -34,6 +34,8 @@ 
 #include <sys/time.h>
 #include <math.h>
 
+#include "linux/compiler.h"
+
 #include <linux/videodev2.h>
 #include <v4l-getsubopt.h>
 
diff --git a/utils/ivtv-ctl/ivtv-ctl.c b/utils/ivtv-ctl/ivtv-ctl.c
index b42b3489..bf36f40b 100644
--- a/utils/ivtv-ctl/ivtv-ctl.c
+++ b/utils/ivtv-ctl/ivtv-ctl.c
@@ -34,6 +34,8 @@ 
 #include <sys/time.h>
 #include <math.h>
 
+#include "linux/compiler.h"
+
 #include <linux/videodev2.h>
 #include <v4l-getsubopt.h>
 
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index b6474d5c..a726921a 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -12,6 +12,8 @@ 
    GNU General Public License for more details.
  */
 
+#include "linux/compiler.h"
+
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
index 1a9e393a..b180185f 100644
--- a/utils/media-ctl/media-ctl.c
+++ b/utils/media-ctl/media-ctl.c
@@ -34,6 +34,8 @@ 
 #include <string.h>
 #include <unistd.h>
 
+#include "linux/compiler.h"
+
 #include <linux/media.h>
 #include <linux/types.h>
 #include <linux/v4l2-mediabus.h>
diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h
index 3517bd07..2c2b2158 100644
--- a/utils/v4l2-compliance/v4l2-compliance.h
+++ b/utils/v4l2-compliance/v4l2-compliance.h
@@ -26,6 +26,8 @@ 
 #include <string>
 #include <cstdint>
 
+#include "linux/compiler.h"
+
 #include <linux/videodev2.h>
 #include <linux/v4l2-subdev.h>
 #include <linux/media.h>
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 1f9cd0fb..ea120eb8 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -9,6 +9,8 @@ 
 #include <sys/stat.h>
 #include <sys/sysmacros.h>
 
+#include "linux/compiler.h"
+
 #include <linux/media.h>
 
 #include "v4l2-ctl.h"
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 13bc057d..7af62ec8 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -3,6 +3,8 @@ 
 #include <netdb.h>
 #include <sys/types.h>
 
+#include "linux/compiler.h"
+
 #include <linux/media.h>
 
 #include "compiler.h"
diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index a64fa514..d8a6c617 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -27,6 +27,8 @@ 
 #include <getopt.h>
 #include <sys/epoll.h>
 
+#include "linux/compiler.h"
+
 #include <linux/media.h>
 
 #include "v4l2-ctl.h"
diff --git a/utils/v4l2-ctl/v4l2-ctl.h b/utils/v4l2-ctl/v4l2-ctl.h
index a1911e80..fd1bd24a 100644
--- a/utils/v4l2-ctl/v4l2-ctl.h
+++ b/utils/v4l2-ctl/v4l2-ctl.h
@@ -1,6 +1,8 @@ 
 #ifndef _V4L2_CTL_H
 #define _V4L2_CTL_H
 
+#include "linux/compiler.h"
+
 #include <cstdint>
 #include <linux/videodev2.h>
 #include <linux/v4l2-subdev.h>
diff --git a/utils/v4l2-dbg/v4l2-dbg.cpp b/utils/v4l2-dbg/v4l2-dbg.cpp
index bd08b4cf..1b0d278a 100644
--- a/utils/v4l2-dbg/v4l2-dbg.cpp
+++ b/utils/v4l2-dbg/v4l2-dbg.cpp
@@ -31,6 +31,8 @@ 
 #include <sys/klog.h>
 #endif
 
+#include "linux/compiler.h"
+
 #include <linux/videodev2.h>
 #include <v4l-getsubopt.h>