Skip to content

Commit

Permalink
res: ucmd-mod: rename sid_ucmd_dev_reserved_t to sid_dev_reserved_t
Browse files Browse the repository at this point in the history
  • Loading branch information
prajnoha committed Nov 18, 2024
1 parent 0a2db51 commit ba358ef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions src/include/resource/ucmd-mod.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ typedef enum {
SID_DEV_RES_RESERVED, /* reserved by a layer above */
SID_DEV_RES_USED, /* used by a layer above */
SID_DEV_RES_FREE, /* not yet reserved or used by a layer above */
} sid_ucmd_dev_reserved_t;
} sid_dev_reserved_t;

int sid_ucmd_dev_set_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_dev_ready_t ready);
sid_dev_ready_t sid_ucmd_dev_get_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive);

int sid_ucmd_dev_set_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_ucmd_dev_reserved_t reserved);
sid_ucmd_dev_reserved_t sid_ucmd_dev_get_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive);
int sid_ucmd_dev_set_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_dev_reserved_t reserved);
sid_dev_reserved_t sid_ucmd_dev_get_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive);

int sid_ucmd_dev_alias_add(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, const char *alias_key, const char *alias);

Expand Down
40 changes: 20 additions & 20 deletions src/resource/ubr.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ struct sid_ucmd_ctx {
/* cmd specific context */
union {
struct {
sid_res_iter_t *block_mod_iter;
sid_res_t *type_mod_res_current;
sid_res_t *type_mod_res_next;
cmd_scan_phase_t phase; /* current scan phase */
sid_dev_ready_t dev_ready;
sid_ucmd_dev_reserved_t dev_reserved;
sid_res_iter_t *block_mod_iter;
sid_res_t *type_mod_res_current;
sid_res_t *type_mod_res_next;
cmd_scan_phase_t phase; /* current scan phase */
sid_dev_ready_t dev_ready;
sid_dev_reserved_t dev_reserved;
} scan;

struct {
Expand Down Expand Up @@ -2892,7 +2892,7 @@ const char *sid_ucmd_dev_ready_to_str(sid_dev_ready_t ready)
return dev_ready_str[ready];
}

const char *sid_ucmd_dev_reserved_to_str(sid_ucmd_dev_reserved_t reserved)
const char *sid_ucmd_dev_reserved_to_str(sid_dev_reserved_t reserved)
{
return dev_reserved_str[reserved];
}
Expand Down Expand Up @@ -3042,14 +3042,14 @@ sid_dev_ready_t sid_ucmd_dev_get_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *
return _do_sid_ucmd_dev_get_ready(mod_res, ucmd_ctx, _owner_name(mod_res), archive);
}

static int _do_sid_ucmd_dev_set_reserved(sid_res_t *res,
struct sid_ucmd_ctx *ucmd_ctx,
const char *owner,
sid_ucmd_dev_reserved_t reserved,
bool is_sync)
static int _do_sid_ucmd_dev_set_reserved(sid_res_t *res,
struct sid_ucmd_ctx *ucmd_ctx,
const char *owner,
sid_dev_reserved_t reserved,
bool is_sync)
{
sid_ucmd_dev_reserved_t old_reserved = ucmd_ctx->scan.dev_reserved;
int r;
sid_dev_reserved_t old_reserved = ucmd_ctx->scan.dev_reserved;
int r;

if (!(_cmd_scan_phase_regs[ucmd_ctx->scan.phase].flags & CMD_SCAN_CAP_RES)) {
r = -EPERM;
Expand Down Expand Up @@ -3114,7 +3114,7 @@ static int _do_sid_ucmd_dev_set_reserved(sid_res_t *res,
return r;
}

int sid_ucmd_dev_set_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_ucmd_dev_reserved_t reserved)
int sid_ucmd_dev_set_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_dev_reserved_t reserved)
{
if (!mod_res || !ucmd_ctx)
return -EINVAL;
Expand All @@ -3126,11 +3126,11 @@ int sid_ucmd_dev_set_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx,
return _do_sid_ucmd_dev_set_reserved(mod_res, ucmd_ctx, _owner_name(mod_res), reserved, false);
}

static sid_ucmd_dev_reserved_t
static sid_dev_reserved_t
_do_sid_ucmd_dev_get_reserved(sid_res_t *res, struct sid_ucmd_ctx *ucmd_ctx, const char *owner, unsigned int archive)
{
const void *val;
sid_ucmd_dev_reserved_t reserved_arch;
const void *val;
sid_dev_reserved_t reserved_arch;

if (archive) {
if ((val = _do_sid_ucmd_get_kv(res,
Expand Down Expand Up @@ -3160,7 +3160,7 @@ static sid_ucmd_dev_reserved_t
return ucmd_ctx->scan.dev_reserved;
}

sid_ucmd_dev_reserved_t sid_ucmd_dev_get_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive)
sid_dev_reserved_t sid_ucmd_dev_get_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive)
{
if (!mod_res || !ucmd_ctx)
return SID_DEV_RES_UNDEFINED;
Expand Down Expand Up @@ -4162,7 +4162,7 @@ static const char *_sval_to_dev_ready_str(kv_scalar_t *val)

static const char *_sval_to_dev_reserved_str(kv_scalar_t *val)
{
sid_ucmd_dev_reserved_t reserved;
sid_dev_reserved_t reserved;

memcpy(&reserved, val->data + _svalue_ext_data_offset(val), sizeof(reserved));
return dev_reserved_str[reserved];
Expand Down

0 comments on commit ba358ef

Please sign in to comment.