[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>
This commit is contained in:
Hans Verkuil 2016-11-04 08:23:27 -02:00 committed by Mauro Carvalho Chehab
parent 7ae2a888ee
commit 3145c754ac
2 changed files with 54 additions and 53 deletions

View file

@ -37,6 +37,7 @@
#define _CEC_UAPI_H
#include <linux/types.h>
#include <linux/string.h>
#define CEC_MAX_MSG_SIZE 16
@ -129,7 +130,7 @@ static inline int cec_msg_opcode(const struct cec_msg *msg)
* cec_msg_is_broadcast - return true if this is a broadcast message.
* @msg: the message structure
*/
static inline bool cec_msg_is_broadcast(const struct cec_msg *msg)
static inline int cec_msg_is_broadcast(const struct cec_msg *msg)
{
return (msg->msg[0] & 0xf) == 0xf;
}
@ -184,14 +185,14 @@ static inline void cec_msg_set_reply_to(struct cec_msg *msg,
#define CEC_RX_STATUS_TIMEOUT (1 << 1)
#define CEC_RX_STATUS_FEATURE_ABORT (1 << 2)
static inline bool cec_msg_status_is_ok(const struct cec_msg *msg)
static inline int cec_msg_status_is_ok(const struct cec_msg *msg)
{
if (msg->tx_status && !(msg->tx_status & CEC_TX_STATUS_OK))
return false;
return 0;
if (msg->rx_status && !(msg->rx_status & CEC_RX_STATUS_OK))
return false;
return 0;
if (!msg->tx_status && !msg->rx_status)
return false;
return 0;
return !(msg->rx_status & CEC_RX_STATUS_FEATURE_ABORT);
}
@ -254,47 +255,47 @@ static inline bool cec_msg_status_is_ok(const struct cec_msg *msg)
#define CEC_LOG_ADDR_MASK_SPECIFIC (1 << CEC_LOG_ADDR_SPECIFIC)
#define CEC_LOG_ADDR_MASK_UNREGISTERED (1 << CEC_LOG_ADDR_UNREGISTERED)
static inline bool cec_has_tv(__u16 log_addr_mask)
static inline int cec_has_tv(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_TV;
}
static inline bool cec_has_record(__u16 log_addr_mask)
static inline int cec_has_record(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_RECORD;
}
static inline bool cec_has_tuner(__u16 log_addr_mask)
static inline int cec_has_tuner(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_TUNER;
}
static inline bool cec_has_playback(__u16 log_addr_mask)
static inline int cec_has_playback(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_PLAYBACK;
}
static inline bool cec_has_audiosystem(__u16 log_addr_mask)
static inline int cec_has_audiosystem(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_AUDIOSYSTEM;
}
static inline bool cec_has_backup(__u16 log_addr_mask)
static inline int cec_has_backup(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_BACKUP;
}
static inline bool cec_has_specific(__u16 log_addr_mask)
static inline int cec_has_specific(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_SPECIFIC;
}
static inline bool cec_is_unregistered(__u16 log_addr_mask)
static inline int cec_is_unregistered(__u16 log_addr_mask)
{
return log_addr_mask & CEC_LOG_ADDR_MASK_UNREGISTERED;
}
static inline bool cec_is_unconfigured(__u16 log_addr_mask)
static inline int cec_is_unconfigured(__u16 log_addr_mask)
{
return log_addr_mask == 0;
}
@ -1016,7 +1017,7 @@ struct cec_event {
/* Helper functions to identify the 'special' CEC devices */
static inline bool cec_is_2nd_tv(const struct cec_log_addrs *las)
static inline int cec_is_2nd_tv(const struct cec_log_addrs *las)
{
/*
* 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)
las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_TV;
}
static inline bool cec_is_processor(const struct cec_log_addrs *las)
static inline int cec_is_processor(const struct cec_log_addrs *las)
{
/*
* 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)
las->primary_device_type[0] == CEC_OP_PRIM_DEVTYPE_PROCESSOR;
}
static inline bool cec_is_switch(const struct cec_log_addrs *las)
static inline int cec_is_switch(const struct cec_log_addrs *las)
{
/*
* 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)
!(las->flags & CEC_LOG_ADDRS_FL_CDC_ONLY);
}
static inline bool cec_is_cdc_only(const struct cec_log_addrs *las)
static inline int cec_is_cdc_only(const struct cec_log_addrs *las)
{
/*
* It is a CDC-only device if the logical address is 15 and the