History

[media] cec.h/cec-funcs.h: don't use bool in public headers

Replace bool by int or __u8 (when used in a struct).

Hans Verkuil committed 10 years ago

Commit 3145c751 parent 7ae2a882 files · +54 −53Browse files

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

Unified · Split

2 files
  1. include/uapi/linux/cec-funcs.h +35 −35
  2. include/uapi/linux/cec.h +19 −18
include/uapi/linux/cec-funcs.h+35−35
@@ -84,7 +84,7 @@ static inline void cec_ops_inactive_source(const struct cec_msg *msg, · 83 unmodified lines
8484 }
8585
8686 static inline void cec_msg_request_active_source(struct cec_msg *msg,
87− bool reply)
87+ int reply)
8888 {
8989 msg->len = 2;
9090 msg->msg[0] |= 0xf; /* broadcast */
@@ -109,7 +109,7 @@ static inline void cec_ops_routing_information(const struct cec_msg *msg, · 18 unmodified lines
109109 }
110110
111111 static inline void cec_msg_routing_change(struct cec_msg *msg,
112− bool reply,
112+ int reply,
113113 __u16 orig_phys_addr,
114114 __u16 new_phys_addr)
115115 {
@@ -156,7 +156,7 @@ static inline void cec_msg_standby(struct cec_msg *msg) · 40 unmodified lines
156156
157157
158158 /* One Touch Record Feature */
159−static inline void cec_msg_record_off(struct cec_msg *msg, bool reply)
159+static inline void cec_msg_record_off(struct cec_msg *msg, int reply)
160160 {
161161 msg->len = 2;
162162 msg->msg[1] = CEC_MSG_RECORD_OFF;
@@ -318,7 +318,7 @@ static inline void cec_msg_record_on_phys_addr(struct cec_msg *msg, · 155 unmodified lines
318318 }
319319
320320 static inline void cec_msg_record_on(struct cec_msg *msg,
321− bool reply,
321+ int reply,
322322 const struct cec_op_record_src *rec_src)
323323 {
324324 switch (rec_src->type) {
@@ -385,7 +385,7 @@ static inline void cec_ops_record_status(const struct cec_msg *msg, · 60 unmodified lines
385385 }
386386
387387 static inline void cec_msg_record_tv_screen(struct cec_msg *msg,
388− bool reply)
388+ int reply)
389389 {
390390 msg->len = 2;
391391 msg->msg[1] = CEC_MSG_RECORD_TV_SCREEN;
@@ -459,7 +459,7 @@ static inline void cec_ops_timer_cleared_status(const struct cec_msg *msg, · 67 unmodified lines
459459 }
460460
461461 static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg,
462− bool reply,
462+ int reply,
463463 __u8 day,
464464 __u8 month,
465465 __u8 start_hr,
@@ -514,7 +514,7 @@ static inline void cec_ops_clear_analogue_timer(const struct cec_msg *msg, · 48 unmodified lines
514514 }
515515
516516 static inline void cec_msg_clear_digital_timer(struct cec_msg *msg,
517− bool reply,
517+ int reply,
518518 __u8 day,
519519 __u8 month,
520520 __u8 start_hr,
@@ -560,7 +560,7 @@ static inline void cec_ops_clear_digital_timer(const struct cec_msg *msg, · 39 unmodified lines
560560 }
561561
562562 static inline void cec_msg_clear_ext_timer(struct cec_msg *msg,
563− bool reply,
563+ int reply,
564564 __u8 day,
565565 __u8 month,
566566 __u8 start_hr,
@@ -615,7 +615,7 @@ static inline void cec_ops_clear_ext_timer(const struct cec_msg *msg, · 48 unmodified lines
615615 }
616616
617617 static inline void cec_msg_set_analogue_timer(struct cec_msg *msg,
618− bool reply,
618+ int reply,
619619 __u8 day,
620620 __u8 month,
621621 __u8 start_hr,
@@ -670,7 +670,7 @@ static inline void cec_ops_set_analogue_timer(const struct cec_msg *msg, · 48 unmodified lines
670670 }
671671
672672 static inline void cec_msg_set_digital_timer(struct cec_msg *msg,
673− bool reply,
673+ int reply,
674674 __u8 day,
675675 __u8 month,
676676 __u8 start_hr,
@@ -716,7 +716,7 @@ static inline void cec_ops_set_digital_timer(const struct cec_msg *msg, · 39 unmodified lines
716716 }
717717
718718 static inline void cec_msg_set_ext_timer(struct cec_msg *msg,
719− bool reply,
719+ int reply,
720720 __u8 day,
721721 __u8 month,
722722 __u8 start_hr,
@@ -808,7 +808,7 @@ static inline void cec_ops_cec_version(const struct cec_msg *msg, · 85 unmodified lines
808808 }
809809
810810 static inline void cec_msg_get_cec_version(struct cec_msg *msg,
811− bool reply)
811+ int reply)
812812 {
813813 msg->len = 2;
814814 msg->msg[1] = CEC_MSG_GET_CEC_VERSION;
@@ -834,7 +834,7 @@ static inline void cec_ops_report_physical_addr(const struct cec_msg *msg, · 19 unmodified lines
834834 }
835835
836836 static inline void cec_msg_give_physical_addr(struct cec_msg *msg,
837− bool reply)
837+ int reply)
838838 {
839839 msg->len = 2;
840840 msg->msg[1] = CEC_MSG_GIVE_PHYSICAL_ADDR;
@@ -858,7 +858,7 @@ static inline void cec_ops_set_menu_language(const struct cec_msg *msg, · 17 unmodified lines
858858 }
859859
860860 static inline void cec_msg_get_menu_language(struct cec_msg *msg,
861− bool reply)
861+ int reply)
862862 {
863863 msg->len = 2;
864864 msg->msg[1] = CEC_MSG_GET_MENU_LANGUAGE;
@@ -907,7 +907,7 @@ static inline void cec_ops_report_features(const struct cec_msg *msg, · 42 unmodified lines
907907 }
908908
909909 static inline void cec_msg_give_features(struct cec_msg *msg,
910− bool reply)
910+ int reply)
911911 {
912912 msg->len = 2;
913913 msg->msg[1] = CEC_MSG_GIVE_FEATURES;
@@ -944,7 +944,7 @@ static inline void cec_ops_deck_status(const struct cec_msg *msg, · 30 unmodified lines
944944 }
945945
946946 static inline void cec_msg_give_deck_status(struct cec_msg *msg,
947− bool reply,
947+ int reply,
948948 __u8 status_req)
949949 {
950950 msg->len = 3;
@@ -978,7 +978,7 @@ static inline void cec_ops_play(const struct cec_msg *msg, · 27 unmodified lines
978978 struct cec_op_tuner_device_info {
979979 __u8 rec_flag;
980980 __u8 tuner_display_info;
981− bool is_analog;
981+ __u8 is_analog;
982982 union {
983983 struct cec_op_digital_service_id digital;
984984 struct {
@@ -1048,7 +1048,7 @@ static inline void cec_ops_tuner_device_status(const struct cec_msg *msg, · 63 unmodified lines
10481048 }
10491049
10501050 static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg,
1051− bool reply,
1051+ int reply,
10521052 __u8 status_req)
10531053 {
10541054 msg->len = 3;
@@ -1131,7 +1131,7 @@ static inline void cec_ops_device_vendor_id(const struct cec_msg *msg, · 76 unmodified lines
11311131 }
11321132
11331133 static inline void cec_msg_give_device_vendor_id(struct cec_msg *msg,
1134− bool reply)
1134+ int reply)
11351135 {
11361136 msg->len = 2;
11371137 msg->msg[1] = CEC_MSG_GIVE_DEVICE_VENDOR_ID;
@@ -1267,7 +1267,7 @@ static inline void cec_ops_set_osd_name(const struct cec_msg *msg, · 129 unmodified lines
12671267 }
12681268
12691269 static inline void cec_msg_give_osd_name(struct cec_msg *msg,
1270− bool reply)
1270+ int reply)
12711271 {
12721272 msg->len = 2;
12731273 msg->msg[1] = CEC_MSG_GIVE_OSD_NAME;
@@ -1291,7 +1291,7 @@ static inline void cec_ops_menu_status(const struct cec_msg *msg, · 17 unmodified lines
12911291 }
12921292
12931293 static inline void cec_msg_menu_request(struct cec_msg *msg,
1294− bool reply,
1294+ int reply,
12951295 __u8 menu_req)
12961296 {
12971297 msg->len = 3;
@@ -1308,7 +1308,7 @@ static inline void cec_ops_menu_request(const struct cec_msg *msg, · 10 unmodified lines
13081308
13091309 struct cec_op_ui_command {
13101310 __u8 ui_cmd;
1311− bool has_opt_arg;
1311+ __u8 has_opt_arg;
13121312 union {
13131313 struct cec_op_channel_data channel_identifier;
13141314 __u8 ui_broadcast_type;
@@ -1354,7 +1354,7 @@ static inline void cec_ops_user_control_pressed(const struct cec_msg *msg, · 39 unmodified lines
13541354 struct cec_op_ui_command *ui_cmd)
13551355 {
13561356 ui_cmd->ui_cmd = msg->msg[2];
1357− ui_cmd->has_opt_arg = false;
1357+ ui_cmd->has_opt_arg = 0;
13581358 if (msg->len == 3)
13591359 return;
13601360 switch (ui_cmd->ui_cmd) {
@@ -1366,12 +1366,12 @@ static inline void cec_ops_user_control_pressed(const struct cec_msg *msg, · 5 unmodified lines
13661366 case 0x6a:
13671367 /* The optional operand is one byte for all these ui commands */
13681368 ui_cmd->play_mode = msg->msg[3];
1369− ui_cmd->has_opt_arg = true;
1369+ ui_cmd->has_opt_arg = 1;
13701370 break;
13711371 case 0x67:
13721372 if (msg->len < 7)
13731373 break;
1374− ui_cmd->has_opt_arg = true;
1374+ ui_cmd->has_opt_arg = 1;
13751375 ui_cmd->channel_identifier.channel_number_fmt = msg->msg[3] >> 2;
13761376 ui_cmd->channel_identifier.major = ((msg->msg[3] & 3) << 6) | msg->msg[4];
13771377 ui_cmd->channel_identifier.minor = (msg->msg[5] << 8) | msg->msg[6];
@@ -1403,7 +1403,7 @@ static inline void cec_ops_report_power_status(const struct cec_msg *msg, · 25 unmodified lines
14031403 }
14041404
14051405 static inline void cec_msg_give_device_power_status(struct cec_msg *msg,
1406− bool reply)
1406+ int reply)
14071407 {
14081408 msg->len = 2;
14091409 msg->msg[1] = CEC_MSG_GIVE_DEVICE_POWER_STATUS;
@@ -1463,7 +1463,7 @@ static inline void cec_ops_report_audio_status(const struct cec_msg *msg, · 53 unmodified lines
14631463 }
14641464
14651465 static inline void cec_msg_give_audio_status(struct cec_msg *msg,
1466− bool reply)
1466+ int reply)
14671467 {
14681468 msg->len = 2;
14691469 msg->msg[1] = CEC_MSG_GIVE_AUDIO_STATUS;
@@ -1485,7 +1485,7 @@ static inline void cec_ops_set_system_audio_mode(const struct cec_msg *msg, · 15 unmodified lines
14851485 }
14861486
14871487 static inline void cec_msg_system_audio_mode_request(struct cec_msg *msg,
1488− bool reply,
1488+ int reply,
14891489 __u16 phys_addr)
14901490 {
14911491 msg->len = phys_addr == 0xffff ? 2 : 4;
@@ -1520,7 +1520,7 @@ static inline void cec_ops_system_audio_mode_status(const struct cec_msg *msg, · 28 unmodified lines
15201520 }
15211521
15221522 static inline void cec_msg_give_system_audio_mode_status(struct cec_msg *msg,
1523− bool reply)
1523+ int reply)
15241524 {
15251525 msg->len = 2;
15261526 msg->msg[1] = CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS;
@@ -1560,7 +1560,7 @@ static inline void cec_ops_report_short_audio_descriptor(const struct cec_msg *m · 33 unmodified lines
15601560 }
15611561
15621562 static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg,
1563− bool reply,
1563+ int reply,
15641564 __u8 num_descriptors,
15651565 const __u8 *audio_format_id,
15661566 const __u8 *audio_format_code)
@@ -1618,7 +1618,7 @@ static inline void cec_msg_report_arc_initiated(struct cec_msg *msg) · 51 unmodified lines
16181618 }
16191619
16201620 static inline void cec_msg_initiate_arc(struct cec_msg *msg,
1621− bool reply)
1621+ int reply)
16221622 {
16231623 msg->len = 2;
16241624 msg->msg[1] = CEC_MSG_INITIATE_ARC;
@@ -1626,7 +1626,7 @@ static inline void cec_msg_initiate_arc(struct cec_msg *msg, · 1 unmodified line
16261626 }
16271627
16281628 static inline void cec_msg_request_arc_initiation(struct cec_msg *msg,
1629− bool reply)
1629+ int reply)
16301630 {
16311631 msg->len = 2;
16321632 msg->msg[1] = CEC_MSG_REQUEST_ARC_INITIATION;
@@ -1640,7 +1640,7 @@ static inline void cec_msg_report_arc_terminated(struct cec_msg *msg) · 7 unmodified lines
16401640 }
16411641
16421642 static inline void cec_msg_terminate_arc(struct cec_msg *msg,
1643− bool reply)
1643+ int reply)
16441644 {
16451645 msg->len = 2;
16461646 msg->msg[1] = CEC_MSG_TERMINATE_ARC;
@@ -1648,7 +1648,7 @@ static inline void cec_msg_terminate_arc(struct cec_msg *msg, · 1 unmodified line
16481648 }
16491649
16501650 static inline void cec_msg_request_arc_termination(struct cec_msg *msg,
1651− bool reply)
1651+ int reply)
16521652 {
16531653 msg->len = 2;
16541654 msg->msg[1] = CEC_MSG_REQUEST_ARC_TERMINATION;
@@ -1690,7 +1690,7 @@ static inline void cec_ops_report_current_latency(const struct cec_msg *msg, · 35 unmodified lines
16901690 }
16911691
16921692 static inline void cec_msg_request_current_latency(struct cec_msg *msg,
1693− bool reply,
1693+ int reply,
16941694 __u16 phys_addr)
16951695 {
16961696 msg->len = 4;
include/uapi/linux/cec.h+19−18
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #define _CEC_UAPI_H
3838
3939 #include <linux/types.h>
40+#include <linux/string.h>
4041
4142 #define CEC_MAX_MSG_SIZE 16
4243
@@ -129,7 +130,7 @@ static inline int cec_msg_opcode(const struct cec_msg *msg) · 86 unmodified lines
129130 * cec_msg_is_broadcast - return true if this is a broadcast message.
130131 * @msg: the message structure
131132 */
132−static inline bool cec_msg_is_broadcast(const struct cec_msg *msg)
133+static inline int cec_msg_is_broadcast(const struct cec_msg *msg)
133134 {
134135 return (msg->msg[0] & 0xf) == 0xf;
135136 }
@@ -184,14 +185,14 @@ static inline void cec_msg_set_reply_to(struct cec_msg *msg, · 48 unmodified lines
184185 #define CEC_RX_STATUS_TIMEOUT (1 << 1)
185186 #define CEC_RX_STATUS_FEATURE_ABORT (1 << 2)
186187
187−static inline bool cec_msg_status_is_ok(const struct cec_msg *msg)
188+static inline int cec_msg_status_is_ok(const struct cec_msg *msg)
188189 {
189190 if (msg->tx_status && !(msg->tx_status & CEC_TX_STATUS_OK))
190− return false;
191+ return 0;
191192 if (msg->rx_status && !(msg->rx_status & CEC_RX_STATUS_OK))
192− return false;
193+ return 0;
193194 if (!msg->tx_status && !msg->rx_status)
194− return false;
195+ return 0;
195196 return !(msg->rx_status & CEC_RX_STATUS_FEATURE_ABORT);
196197 }
197198
@@ -254,47 +255,47 @@ static inline bool cec_msg_status_is_ok(const struct cec_msg *msg) · 56 unmodified lines
254255 #define CEC_LOG_ADDR_MASK_SPECIFIC (1 << CEC_LOG_ADDR_SPECIFIC)
255256 #define CEC_LOG_ADDR_MASK_UNREGISTERED (1 << CEC_LOG_ADDR_UNREGISTERED)
256257
257−static inline bool cec_has_tv(__u16 log_addr_mask)
258+static inline int cec_has_tv(__u16 log_addr_mask)
258259 {
259260 return log_addr_mask & CEC_LOG_ADDR_MASK_TV;
260261 }
261262
262−static inline bool cec_has_record(__u16 log_addr_mask)
263+static inline int cec_has_record(__u16 log_addr_mask)
263264 {
264265 return log_addr_mask & CEC_LOG_ADDR_MASK_RECORD;
265266 }
266267
267−static inline bool cec_has_tuner(__u16 log_addr_mask)
268+static inline int cec_has_tuner(__u16 log_addr_mask)
268269 {
269270 return log_addr_mask & CEC_LOG_ADDR_MASK_TUNER;
270271 }
271272
272−static inline bool cec_has_playback(__u16 log_addr_mask)
273+static inline int cec_has_playback(__u16 log_addr_mask)
273274 {
274275 return log_addr_mask & CEC_LOG_ADDR_MASK_PLAYBACK;
275276 }
276277
277−static inline bool cec_has_audiosystem(__u16 log_addr_mask)
278+static inline int cec_has_audiosystem(__u16 log_addr_mask)
278279 {
279280 return log_addr_mask & CEC_LOG_ADDR_MASK_AUDIOSYSTEM;
280281 }
281282
282−static inline bool cec_has_backup(__u16 log_addr_mask)
283+static inline int cec_has_backup(__u16 log_addr_mask)
283284 {
284285 return log_addr_mask & CEC_LOG_ADDR_MASK_BACKUP;
285286 }
286287
287−static inline bool cec_has_specific(__u16 log_addr_mask)
288+static inline int cec_has_specific(__u16 log_addr_mask)
288289 {
289290 return log_addr_mask & CEC_LOG_ADDR_MASK_SPECIFIC;
290291 }
291292
292−static inline bool cec_is_unregistered(__u16 log_addr_mask)
293+static inline int cec_is_unregistered(__u16 log_addr_mask)
293294 {
294295 return log_addr_mask & CEC_LOG_ADDR_MASK_UNREGISTERED;
295296 }
296297
297−static inline bool cec_is_unconfigured(__u16 log_addr_mask)
298+static inline int cec_is_unconfigured(__u16 log_addr_mask)
298299 {
299300 return log_addr_mask == 0;
300301 }
@@ -1016,7 +1017,7 @@ struct cec_event { · 715 unmodified lines
10161017
10171018 /* Helper functions to identify the 'special' CEC devices */
10181019
1019−static inline bool cec_is_2nd_tv(const struct cec_log_addrs *las)
1020+static inline int cec_is_2nd_tv(const struct cec_log_addrs *las)
10201021 {
10211022 /*
10221023 * It is a second TV if the logical address is 14 or 15 and the
@@ -1027,7 +1028,7 @@ static inline bool cec_is_2nd_tv(const struct cec_log_addrs *las) · 4 unmodified lines
10271028 las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_TV;
10281029 }
10291030
1030−static inline bool cec_is_processor(const struct cec_log_addrs *las)
1031+static inline int cec_is_processor(const struct cec_log_addrs *las)
10311032 {
10321033 /*
10331034 * It is a processor if the logical address is 12-15 and the
@@ -1038,7 +1039,7 @@ static inline bool cec_is_processor(const struct cec_log_addrs *las) · 4 unmodified lines
10381039 las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_PROCESSOR;
10391040 }
10401041
1041−static inline bool cec_is_switch(const struct cec_log_addrs *las)
1042+static inline int cec_is_switch(const struct cec_log_addrs *las)
10421043 {
10431044 /*
10441045 * It is a switch if the logical address is 15 and the
@@ -1050,7 +1051,7 @@ static inline bool cec_is_switch(const struct cec_log_addrs *las) · 5 unmodified lines
10501051 !(las->flags & CEC_LOG_ADDRS_FL_CDC_ONLY);
10511052 }
10521053
1053−static inline bool cec_is_cdc_only(const struct cec_log_addrs *las)
1054+static inline int cec_is_cdc_only(const struct cec_log_addrs *las)
10541055 {
10551056 /*
10561057 * It is a CDC-only device if the logical address is 15 and the