From 6907f677115d658f96697233281fa35048ac586a Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Mon, 8 Mar 2010 17:05:31 +0200 Subject: [PATCH] osd-target: Avoid definition of FALSE/TRUE just use stdbool.h and the lower-case false/true Signed-off-by: Boaz Harrosh --- osd-target/cdb.c | 11 ++++++----- osd-target/osd-types.h | 6 +----- osd-target/osd.c | 24 ++++++++++++------------ 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/osd-target/cdb.c b/osd-target/cdb.c index 227376e..016d79e 100644 --- a/osd-target/cdb.c +++ b/osd-target/cdb.c @@ -505,13 +505,13 @@ static int get_attributes(struct command *cmd, uint64_t pid, uint64_t oid, uint16_t numoid, uint32_t cdb_cont_len) { int ret = 0; - uint8_t isembedded = TRUE; + uint8_t isembedded = true; if (numoid < 1) goto out_cdb_err; if (cmd->action == OSD_GET_ATTRIBUTES) - isembedded = FALSE; + isembedded = true; if (cmd->getset_cdbfmt == GETPAGE_SETVALUE) { return get_attr_page(cmd, pid, oid, isembedded, numoid, cdb_cont_len); @@ -537,13 +537,13 @@ static int set_attributes(struct command *cmd, uint64_t pid, uint64_t oid, uint32_t numoid, uint32_t cdb_cont_len) { int ret = 0; - uint8_t isembedded = TRUE; + uint8_t isembedded = true; if (numoid < 1) goto out_cdb_err; if (cmd->action == OSD_SET_ATTRIBUTES) - isembedded = FALSE; + isembedded = true; if (cmd->getset_cdbfmt == GETPAGE_SETVALUE) { return set_attr_value(cmd, pid, oid, isembedded, numoid, cdb_cont_len); @@ -1094,7 +1094,8 @@ static int exec_cas_setattr(struct command *cmd, uint64_t pid, uint64_t oid, pad = 0; ret = osd_set_attributes(cmd->osd, pid, oid, page, number, - &list[10], len, TRUE, cdb_cont_len, cmd->sense); + &list[10], len, true, cdb_cont_len, + cmd->sense); if (ret != 0) { cmd->senselen = ret; goto out_err; diff --git a/osd-target/osd-types.h b/osd-target/osd-types.h index aaa1cfd..ceaff29 100644 --- a/osd-target/osd-types.h +++ b/osd-target/osd-types.h @@ -19,6 +19,7 @@ #define __OSD_TYPES_H #include +#include #include #include @@ -198,11 +199,6 @@ struct osd_device { struct id_list idl; }; -enum { - FALSE = 0, - TRUE = 1 -}; - enum { GATHER_VAL = 1, GATHER_ATTR = 2, diff --git a/osd-target/osd.c b/osd-target/osd.c index 524020d..f476df1 100644 --- a/osd-target/osd.c +++ b/osd-target/osd.c @@ -136,7 +136,7 @@ static inline int check_valid_pg(uint8_t obj_type, uint32_t page) case ROOT: return (ROOT_PG <= page && page < RESERVED_PG); default: - return FALSE; + return false; } } @@ -147,17 +147,17 @@ static int issettable_page(uint8_t obj_type, uint32_t page) if (!valid_pg) { if (page >= ANY_PG) - return TRUE; + return true; else - return FALSE; + return false; } rel_page = get_rel_page(obj_type, page); if ((STD_PG_LB <= rel_page && rel_page <= STD_PG_UB) || (LUN_PG_LB <= rel_page && rel_page <= LUN_PG_UB)) - return TRUE; + return true; else - return FALSE; + return false; } static int isgettable_page(uint8_t obj_type, uint32_t page) @@ -167,17 +167,17 @@ static int isgettable_page(uint8_t obj_type, uint32_t page) if (!valid_pg) { if (page >= ANY_PG) - return TRUE; + return true; else - return FALSE; + return false; } rel_page = get_rel_page(obj_type, page); if ((RSRV_PG_LB <= rel_page && rel_page <= RSRV_PG_UB) || rel_page > VEND_PG_UB) - return FALSE; + return false; else - return TRUE; + return true; } @@ -2246,7 +2246,7 @@ int osd_getattr_list(struct osd_device *osd, uint64_t pid, uint64_t oid, if (obj_type == ILLEGAL_OBJ) goto out_cdb_err; - if (isgettable_page(obj_type, page) == FALSE) + if (isgettable_page(obj_type, page) == false) goto out_param_list; ret = lazy_init_attr(osd, pid, oid, page, number); @@ -2356,7 +2356,7 @@ int osd_getattr_page(struct osd_device *osd, uint64_t pid, uint64_t oid, if (obj_type == ILLEGAL_OBJ) goto out_cdb_err; - if (isgettable_page(obj_type, page) == FALSE) + if (isgettable_page(obj_type, page) == false) goto out_param_list; if (!isembedded) @@ -3452,7 +3452,7 @@ int osd_set_attributes(struct osd_device *osd, uint64_t pid, uint64_t oid, if (obj_type == ILLEGAL_OBJ) goto out_cdb_err; - if (issettable_page(obj_type, page) == FALSE) + if (issettable_page(obj_type, page) == false) goto out_param_list; if (number == ATTRNUM_UNMODIFIABLE)