Skip to content

Commit 3256b36

Browse files
committed
media: dmx.h: split typedefs from structs
Using typedefs inside the Kernel is against CodingStyle, and there's no good usage here. Just like we did at frontend.h, at commit 0df289a ("[media] dvb: Get rid of typedev usage for enums"), let's keep those typedefs only to provide userspace backward compatibility. No functional changes. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1 parent c93022a commit 3256b36

2 files changed

Lines changed: 35 additions & 25 deletions

File tree

‎drivers/media/dvb-core/dmxdev.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev,
562562
{
563563
ktime_t timeout = 0;
564564
struct dmx_pes_filter_params *para = &filter->params.pes;
565-
dmx_output_t otype;
565+
enum dmx_output otype;
566566
int ret;
567567
int ts_type;
568568
enum dmx_ts_pes ts_pes;
@@ -787,7 +787,7 @@ static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev,
787787
return 0;
788788
}
789789

790-
static inline void invert_mode(dmx_filter_t *filter)
790+
static inline void invert_mode(struct dmx_filter *filter)
791791
{
792792
int i;
793793

‎include/uapi/linux/dvb/dmx.h‎

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,14 @@ enum dmx_output
4343
DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */
4444
};
4545

46-
typedef enum dmx_output dmx_output_t;
47-
48-
typedef enum dmx_input
46+
enum dmx_input
4947
{
5048
DMX_IN_FRONTEND, /* Input from a front-end device. */
5149
DMX_IN_DVR /* Input from the logical DVR device. */
52-
} dmx_input_t;
50+
};
5351

5452

55-
typedef enum dmx_ts_pes
53+
enum dmx_ts_pes
5654
{
5755
DMX_PES_AUDIO0,
5856
DMX_PES_VIDEO0,
@@ -79,7 +77,7 @@ typedef enum dmx_ts_pes
7977
DMX_PES_PCR3,
8078

8179
DMX_PES_OTHER
82-
} dmx_pes_type_t;
80+
};
8381

8482
#define DMX_PES_AUDIO DMX_PES_AUDIO0
8583
#define DMX_PES_VIDEO DMX_PES_VIDEO0
@@ -88,20 +86,20 @@ typedef enum dmx_ts_pes
8886
#define DMX_PES_PCR DMX_PES_PCR0
8987

9088

91-
typedef struct dmx_filter
89+
struct dmx_filter
9290
{
9391
__u8 filter[DMX_FILTER_SIZE];
9492
__u8 mask[DMX_FILTER_SIZE];
9593
__u8 mode[DMX_FILTER_SIZE];
96-
} dmx_filter_t;
94+
};
9795

9896

9997
struct dmx_sct_filter_params
10098
{
101-
__u16 pid;
102-
dmx_filter_t filter;
103-
__u32 timeout;
104-
__u32 flags;
99+
__u16 pid;
100+
struct dmx_filter filter;
101+
__u32 timeout;
102+
__u32 flags;
105103
#define DMX_CHECK_CRC 1
106104
#define DMX_ONESHOT 2
107105
#define DMX_IMMEDIATE_START 4
@@ -111,19 +109,19 @@ struct dmx_sct_filter_params
111109

112110
struct dmx_pes_filter_params
113111
{
114-
__u16 pid;
115-
dmx_input_t input;
116-
dmx_output_t output;
117-
dmx_pes_type_t pes_type;
118-
__u32 flags;
112+
__u16 pid;
113+
enum dmx_input input;
114+
enum dmx_output output;
115+
enum dmx_ts_pes pes_type;
116+
__u32 flags;
119117
};
120118

121-
typedef struct dmx_caps {
119+
struct dmx_caps {
122120
__u32 caps;
123121
int num_decoders;
124-
} dmx_caps_t;
122+
};
125123

126-
typedef enum dmx_source {
124+
enum dmx_source {
127125
DMX_SOURCE_FRONT0 = 0,
128126
DMX_SOURCE_FRONT1,
129127
DMX_SOURCE_FRONT2,
@@ -132,7 +130,7 @@ typedef enum dmx_source {
132130
DMX_SOURCE_DVR1,
133131
DMX_SOURCE_DVR2,
134132
DMX_SOURCE_DVR3
135-
} dmx_source_t;
133+
};
136134

137135
struct dmx_stc {
138136
unsigned int num; /* input : which STC? 0..N */
@@ -146,10 +144,22 @@ struct dmx_stc {
146144
#define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params)
147145
#define DMX_SET_BUFFER_SIZE _IO('o', 45)
148146
#define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5])
149-
#define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t)
150-
#define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t)
147+
#define DMX_GET_CAPS _IOR('o', 48, struct dmx_caps)
148+
#define DMX_SET_SOURCE _IOW('o', 49, enum dmx_source)
151149
#define DMX_GET_STC _IOWR('o', 50, struct dmx_stc)
152150
#define DMX_ADD_PID _IOW('o', 51, __u16)
153151
#define DMX_REMOVE_PID _IOW('o', 52, __u16)
154152

153+
#if !defined (__KERNEL__)
154+
155+
/* This is needed for legacy userspace support */
156+
typedef enum dmx_output dmx_output_t;
157+
typedef enum dmx_input dmx_input_t;
158+
typedef enum dmx_ts_pes dmx_pes_type_t;
159+
typedef struct dmx_filter dmx_filter_t;
160+
typedef struct dmx_caps dmx_caps_t;
161+
typedef enum dmx_source dmx_source_t;
162+
163+
#endif
164+
155165
#endif /* _UAPI_DVBDMX_H_ */

0 commit comments

Comments
 (0)