History

media: v4l: fix uapi mpeg slice params definition

We get a headers_check warning about the newly defined ioctl command structures: ./usr/include/linux/v4l2-controls.h:1105: found __[us]{8,16,32,64} type without #include <linux/types.h> This is resolved by including linux/types.h, as suggested by the warning, but there is another problem: Three of the four structures have an odd number of __u8 headers, but are aligned to 32 bit in the v4l2_ctrl_mpeg2_slice_params, so we get an implicit padding byte for each one. To solve that, let's add explicit padding that can be set to zero and verified in the kernel. Fixes: c27bb30e7b6d ("media: v4l: Add definitions for MPEG-2 slice format and metadata")

Arnd Bergmann committed 8 years ago

Commit df18bfd1 parent dafb7f92 files · +10 −2Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/v4l2-controls.h+5−2
@@ -47,11 +47,11 @@ · 46 unmodified lines
47 * videodev2.h.47 * videodev2.h.
48 */48 */
49 49
50#include <linux/types.h>
51
52#ifndef __LINUX_V4L2_CONTROLS_H50#ifndef __LINUX_V4L2_CONTROLS_H
53#define __LINUX_V4L2_CONTROLS_H51#define __LINUX_V4L2_CONTROLS_H
54 52
53#include <linux/types.h>
54
55/* Control classes */55/* Control classes */
56#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */56#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
57#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */57#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
@@ -1112,6 +1112,7 @@ struct v4l2_mpeg2_sequence { · 1054 unmodified lines
1112 __u8 profile_and_level_indication;1112 __u8 profile_and_level_indication;
1113 __u8 progressive_sequence;1113 __u8 progressive_sequence;
1114 __u8 chroma_format;1114 __u8 chroma_format;
1115 __u8 pad;
1115};1116};
1116 1117
1117struct v4l2_mpeg2_picture {1118struct v4l2_mpeg2_picture {
@@ -1130,6 +1131,7 @@ struct v4l2_mpeg2_picture { · 12 unmodified lines
1130 __u8 alternate_scan;1131 __u8 alternate_scan;
1131 __u8 repeat_first_field;1132 __u8 repeat_first_field;
1132 __u8 progressive_frame;1133 __u8 progressive_frame;
1134 __u8 pad;
1133};1135};
1134 1136
1135struct v4l2_ctrl_mpeg2_slice_params {1137struct v4l2_ctrl_mpeg2_slice_params {
@@ -1144,6 +1146,7 @@ struct v4l2_ctrl_mpeg2_slice_params { · 8 unmodified lines
1144 1146
1145 __u8 backward_ref_index;1147 __u8 backward_ref_index;
1146 __u8 forward_ref_index;1148 __u8 forward_ref_index;
1149 __u8 pad;
1147};1150};
1148 1151
1149struct v4l2_ctrl_mpeg2_quantization {1152struct v4l2_ctrl_mpeg2_quantization {