Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
3145c754 7ae2a888

+54 -53
+35 -35
include/uapi/linux/cec-funcs.h
··· 84 84 } 85 85 86 86 static inline void cec_msg_request_active_source(struct cec_msg *msg, 87 - bool reply) 87 + int reply) 88 88 { 89 89 msg->len = 2; 90 90 msg->msg[0] |= 0xf; /* broadcast */ ··· 109 109 } 110 110 111 111 static inline void cec_msg_routing_change(struct cec_msg *msg, 112 - bool reply, 112 + int reply, 113 113 __u16 orig_phys_addr, 114 114 __u16 new_phys_addr) 115 115 { ··· 156 156 157 157 158 158 /* 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) 160 160 { 161 161 msg->len = 2; 162 162 msg->msg[1] = CEC_MSG_RECORD_OFF; ··· 318 318 } 319 319 320 320 static inline void cec_msg_record_on(struct cec_msg *msg, 321 - bool reply, 321 + int reply, 322 322 const struct cec_op_record_src *rec_src) 323 323 { 324 324 switch (rec_src->type) { ··· 385 385 } 386 386 387 387 static inline void cec_msg_record_tv_screen(struct cec_msg *msg, 388 - bool reply) 388 + int reply) 389 389 { 390 390 msg->len = 2; 391 391 msg->msg[1] = CEC_MSG_RECORD_TV_SCREEN; ··· 459 459 } 460 460 461 461 static inline void cec_msg_clear_analogue_timer(struct cec_msg *msg, 462 - bool reply, 462 + int reply, 463 463 __u8 day, 464 464 __u8 month, 465 465 __u8 start_hr, ··· 514 514 } 515 515 516 516 static inline void cec_msg_clear_digital_timer(struct cec_msg *msg, 517 - bool reply, 517 + int reply, 518 518 __u8 day, 519 519 __u8 month, 520 520 __u8 start_hr, ··· 560 560 } 561 561 562 562 static inline void cec_msg_clear_ext_timer(struct cec_msg *msg, 563 - bool reply, 563 + int reply, 564 564 __u8 day, 565 565 __u8 month, 566 566 __u8 start_hr, ··· 615 615 } 616 616 617 617 static inline void cec_msg_set_analogue_timer(struct cec_msg *msg, 618 - bool reply, 618 + int reply, 619 619 __u8 day, 620 620 __u8 month, 621 621 __u8 start_hr, ··· 670 670 } 671 671 672 672 static inline void cec_msg_set_digital_timer(struct cec_msg *msg, 673 - bool reply, 673 + int reply, 674 674 __u8 day, 675 675 __u8 month, 676 676 __u8 start_hr, ··· 716 716 } 717 717 718 718 static inline void cec_msg_set_ext_timer(struct cec_msg *msg, 719 - bool reply, 719 + int reply, 720 720 __u8 day, 721 721 __u8 month, 722 722 __u8 start_hr, ··· 808 808 } 809 809 810 810 static inline void cec_msg_get_cec_version(struct cec_msg *msg, 811 - bool reply) 811 + int reply) 812 812 { 813 813 msg->len = 2; 814 814 msg->msg[1] = CEC_MSG_GET_CEC_VERSION; ··· 834 834 } 835 835 836 836 static inline void cec_msg_give_physical_addr(struct cec_msg *msg, 837 - bool reply) 837 + int reply) 838 838 { 839 839 msg->len = 2; 840 840 msg->msg[1] = CEC_MSG_GIVE_PHYSICAL_ADDR; ··· 858 858 } 859 859 860 860 static inline void cec_msg_get_menu_language(struct cec_msg *msg, 861 - bool reply) 861 + int reply) 862 862 { 863 863 msg->len = 2; 864 864 msg->msg[1] = CEC_MSG_GET_MENU_LANGUAGE; ··· 907 907 } 908 908 909 909 static inline void cec_msg_give_features(struct cec_msg *msg, 910 - bool reply) 910 + int reply) 911 911 { 912 912 msg->len = 2; 913 913 msg->msg[1] = CEC_MSG_GIVE_FEATURES; ··· 944 944 } 945 945 946 946 static inline void cec_msg_give_deck_status(struct cec_msg *msg, 947 - bool reply, 947 + int reply, 948 948 __u8 status_req) 949 949 { 950 950 msg->len = 3; ··· 978 978 struct cec_op_tuner_device_info { 979 979 __u8 rec_flag; 980 980 __u8 tuner_display_info; 981 - bool is_analog; 981 + __u8 is_analog; 982 982 union { 983 983 struct cec_op_digital_service_id digital; 984 984 struct { ··· 1048 1048 } 1049 1049 1050 1050 static inline void cec_msg_give_tuner_device_status(struct cec_msg *msg, 1051 - bool reply, 1051 + int reply, 1052 1052 __u8 status_req) 1053 1053 { 1054 1054 msg->len = 3; ··· 1131 1131 } 1132 1132 1133 1133 static inline void cec_msg_give_device_vendor_id(struct cec_msg *msg, 1134 - bool reply) 1134 + int reply) 1135 1135 { 1136 1136 msg->len = 2; 1137 1137 msg->msg[1] = CEC_MSG_GIVE_DEVICE_VENDOR_ID; ··· 1267 1267 } 1268 1268 1269 1269 static inline void cec_msg_give_osd_name(struct cec_msg *msg, 1270 - bool reply) 1270 + int reply) 1271 1271 { 1272 1272 msg->len = 2; 1273 1273 msg->msg[1] = CEC_MSG_GIVE_OSD_NAME; ··· 1291 1291 } 1292 1292 1293 1293 static inline void cec_msg_menu_request(struct cec_msg *msg, 1294 - bool reply, 1294 + int reply, 1295 1295 __u8 menu_req) 1296 1296 { 1297 1297 msg->len = 3; ··· 1308 1308 1309 1309 struct cec_op_ui_command { 1310 1310 __u8 ui_cmd; 1311 - bool has_opt_arg; 1311 + __u8 has_opt_arg; 1312 1312 union { 1313 1313 struct cec_op_channel_data channel_identifier; 1314 1314 __u8 ui_broadcast_type; ··· 1354 1354 struct cec_op_ui_command *ui_cmd) 1355 1355 { 1356 1356 ui_cmd->ui_cmd = msg->msg[2]; 1357 - ui_cmd->has_opt_arg = false; 1357 + ui_cmd->has_opt_arg = 0; 1358 1358 if (msg->len == 3) 1359 1359 return; 1360 1360 switch (ui_cmd->ui_cmd) { ··· 1366 1366 case 0x6a: 1367 1367 /* The optional operand is one byte for all these ui commands */ 1368 1368 ui_cmd->play_mode = msg->msg[3]; 1369 - ui_cmd->has_opt_arg = true; 1369 + ui_cmd->has_opt_arg = 1; 1370 1370 break; 1371 1371 case 0x67: 1372 1372 if (msg->len < 7) 1373 1373 break; 1374 - ui_cmd->has_opt_arg = true; 1374 + ui_cmd->has_opt_arg = 1; 1375 1375 ui_cmd->channel_identifier.channel_number_fmt = msg->msg[3] >> 2; 1376 1376 ui_cmd->channel_identifier.major = ((msg->msg[3] & 3) << 6) | msg->msg[4]; 1377 1377 ui_cmd->channel_identifier.minor = (msg->msg[5] << 8) | msg->msg[6]; ··· 1403 1403 } 1404 1404 1405 1405 static inline void cec_msg_give_device_power_status(struct cec_msg *msg, 1406 - bool reply) 1406 + int reply) 1407 1407 { 1408 1408 msg->len = 2; 1409 1409 msg->msg[1] = CEC_MSG_GIVE_DEVICE_POWER_STATUS; ··· 1463 1463 } 1464 1464 1465 1465 static inline void cec_msg_give_audio_status(struct cec_msg *msg, 1466 - bool reply) 1466 + int reply) 1467 1467 { 1468 1468 msg->len = 2; 1469 1469 msg->msg[1] = CEC_MSG_GIVE_AUDIO_STATUS; ··· 1485 1485 } 1486 1486 1487 1487 static inline void cec_msg_system_audio_mode_request(struct cec_msg *msg, 1488 - bool reply, 1488 + int reply, 1489 1489 __u16 phys_addr) 1490 1490 { 1491 1491 msg->len = phys_addr == 0xffff ? 2 : 4; ··· 1520 1520 } 1521 1521 1522 1522 static inline void cec_msg_give_system_audio_mode_status(struct cec_msg *msg, 1523 - bool reply) 1523 + int reply) 1524 1524 { 1525 1525 msg->len = 2; 1526 1526 msg->msg[1] = CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS; ··· 1560 1560 } 1561 1561 1562 1562 static inline void cec_msg_request_short_audio_descriptor(struct cec_msg *msg, 1563 - bool reply, 1563 + int reply, 1564 1564 __u8 num_descriptors, 1565 1565 const __u8 *audio_format_id, 1566 1566 const __u8 *audio_format_code) ··· 1618 1618 } 1619 1619 1620 1620 static inline void cec_msg_initiate_arc(struct cec_msg *msg, 1621 - bool reply) 1621 + int reply) 1622 1622 { 1623 1623 msg->len = 2; 1624 1624 msg->msg[1] = CEC_MSG_INITIATE_ARC; ··· 1626 1626 } 1627 1627 1628 1628 static inline void cec_msg_request_arc_initiation(struct cec_msg *msg, 1629 - bool reply) 1629 + int reply) 1630 1630 { 1631 1631 msg->len = 2; 1632 1632 msg->msg[1] = CEC_MSG_REQUEST_ARC_INITIATION; ··· 1640 1640 } 1641 1641 1642 1642 static inline void cec_msg_terminate_arc(struct cec_msg *msg, 1643 - bool reply) 1643 + int reply) 1644 1644 { 1645 1645 msg->len = 2; 1646 1646 msg->msg[1] = CEC_MSG_TERMINATE_ARC; ··· 1648 1648 } 1649 1649 1650 1650 static inline void cec_msg_request_arc_termination(struct cec_msg *msg, 1651 - bool reply) 1651 + int reply) 1652 1652 { 1653 1653 msg->len = 2; 1654 1654 msg->msg[1] = CEC_MSG_REQUEST_ARC_TERMINATION; ··· 1690 1690 } 1691 1691 1692 1692 static inline void cec_msg_request_current_latency(struct cec_msg *msg, 1693 - bool reply, 1693 + int reply, 1694 1694 __u16 phys_addr) 1695 1695 { 1696 1696 msg->len = 4;
+19 -18
include/uapi/linux/cec.h
··· 37 37 #define _CEC_UAPI_H 38 38 39 39 #include <linux/types.h> 40 + #include <linux/string.h> 40 41 41 42 #define CEC_MAX_MSG_SIZE 16 42 43 ··· 130 129 * cec_msg_is_broadcast - return true if this is a broadcast message. 131 130 * @msg: the message structure 132 131 */ 133 - static inline bool cec_msg_is_broadcast(const struct cec_msg *msg) 132 + static inline int cec_msg_is_broadcast(const struct cec_msg *msg) 134 133 { 135 134 return (msg->msg[0] & 0xf) == 0xf; 136 135 } ··· 185 184 #define CEC_RX_STATUS_TIMEOUT (1 << 1) 186 185 #define CEC_RX_STATUS_FEATURE_ABORT (1 << 2) 187 186 188 - static inline bool cec_msg_status_is_ok(const struct cec_msg *msg) 187 + static inline int cec_msg_status_is_ok(const struct cec_msg *msg) 189 188 { 190 189 if (msg->tx_status && !(msg->tx_status & CEC_TX_STATUS_OK)) 191 - return false; 190 + return 0; 192 191 if (msg->rx_status && !(msg->rx_status & CEC_RX_STATUS_OK)) 193 - return false; 192 + return 0; 194 193 if (!msg->tx_status && !msg->rx_status) 195 - return false; 194 + return 0; 196 195 return !(msg->rx_status & CEC_RX_STATUS_FEATURE_ABORT); 197 196 } 198 197 ··· 255 254 #define CEC_LOG_ADDR_MASK_SPECIFIC (1 << CEC_LOG_ADDR_SPECIFIC) 256 255 #define CEC_LOG_ADDR_MASK_UNREGISTERED (1 << CEC_LOG_ADDR_UNREGISTERED) 257 256 258 - static inline bool cec_has_tv(__u16 log_addr_mask) 257 + static inline int cec_has_tv(__u16 log_addr_mask) 259 258 { 260 259 return log_addr_mask & CEC_LOG_ADDR_MASK_TV; 261 260 } 262 261 263 - static inline bool cec_has_record(__u16 log_addr_mask) 262 + static inline int cec_has_record(__u16 log_addr_mask) 264 263 { 265 264 return log_addr_mask & CEC_LOG_ADDR_MASK_RECORD; 266 265 } 267 266 268 - static inline bool cec_has_tuner(__u16 log_addr_mask) 267 + static inline int cec_has_tuner(__u16 log_addr_mask) 269 268 { 270 269 return log_addr_mask & CEC_LOG_ADDR_MASK_TUNER; 271 270 } 272 271 273 - static inline bool cec_has_playback(__u16 log_addr_mask) 272 + static inline int cec_has_playback(__u16 log_addr_mask) 274 273 { 275 274 return log_addr_mask & CEC_LOG_ADDR_MASK_PLAYBACK; 276 275 } 277 276 278 - static inline bool cec_has_audiosystem(__u16 log_addr_mask) 277 + static inline int cec_has_audiosystem(__u16 log_addr_mask) 279 278 { 280 279 return log_addr_mask & CEC_LOG_ADDR_MASK_AUDIOSYSTEM; 281 280 } 282 281 283 - static inline bool cec_has_backup(__u16 log_addr_mask) 282 + static inline int cec_has_backup(__u16 log_addr_mask) 284 283 { 285 284 return log_addr_mask & CEC_LOG_ADDR_MASK_BACKUP; 286 285 } 287 286 288 - static inline bool cec_has_specific(__u16 log_addr_mask) 287 + static inline int cec_has_specific(__u16 log_addr_mask) 289 288 { 290 289 return log_addr_mask & CEC_LOG_ADDR_MASK_SPECIFIC; 291 290 } 292 291 293 - static inline bool cec_is_unregistered(__u16 log_addr_mask) 292 + static inline int cec_is_unregistered(__u16 log_addr_mask) 294 293 { 295 294 return log_addr_mask & CEC_LOG_ADDR_MASK_UNREGISTERED; 296 295 } 297 296 298 - static inline bool cec_is_unconfigured(__u16 log_addr_mask) 297 + static inline int cec_is_unconfigured(__u16 log_addr_mask) 299 298 { 300 299 return log_addr_mask == 0; 301 300 } ··· 1017 1016 1018 1017 /* Helper functions to identify the 'special' CEC devices */ 1019 1018 1020 - static inline bool cec_is_2nd_tv(const struct cec_log_addrs *las) 1019 + static inline int cec_is_2nd_tv(const struct cec_log_addrs *las) 1021 1020 { 1022 1021 /* 1023 1022 * It is a second TV if the logical address is 14 or 15 and the ··· 1028 1027 las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_TV; 1029 1028 } 1030 1029 1031 - static inline bool cec_is_processor(const struct cec_log_addrs *las) 1030 + static inline int cec_is_processor(const struct cec_log_addrs *las) 1032 1031 { 1033 1032 /* 1034 1033 * It is a processor if the logical address is 12-15 and the ··· 1039 1038 las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_PROCESSOR; 1040 1039 } 1041 1040 1042 - static inline bool cec_is_switch(const struct cec_log_addrs *las) 1041 + static inline int cec_is_switch(const struct cec_log_addrs *las) 1043 1042 { 1044 1043 /* 1045 1044 * It is a switch if the logical address is 15 and the ··· 1051 1050 !(las->flags & CEC_LOG_ADDRS_FL_CDC_ONLY); 1052 1051 } 1053 1052 1054 - static inline bool cec_is_cdc_only(const struct cec_log_addrs *las) 1053 + static inline int cec_is_cdc_only(const struct cec_log_addrs *las) 1055 1054 { 1056 1055 /* 1057 1056 * It is a CDC-only device if the logical address is 15 and the