Skip to content

Commit 9495c01

Browse files
lyakhlgirdwood
authored andcommitted
rimage: (cosmetic) no need to use "const" in sizeof()
Size of constant and writable objects of the same type is the same, drop the "const" qualifier from sizeof() type specification. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent fa5a57d commit 9495c01

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

tools/rimage/src/adsp_config.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ static int parse_scheduling(const toml_table_t *mod_entry, struct parse_ctx *ctx
16801680
ext_mod_config->sched_caps.multiples_supported.ul = val;
16811681

16821682
ext_mod_config->header.num_scheduling_capabilities = 1;
1683-
*ext_length = sizeof(const struct mod_scheduling_caps);
1683+
*ext_length = sizeof(struct mod_scheduling_caps);
16841684

16851685
return 0;
16861686
}
@@ -1708,7 +1708,7 @@ static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx,
17081708
ctx->array_cnt++;
17091709

17101710
ext_mod_config->header.num_pin_entries = toml_array_nelem(arr) / 6;
1711-
ext_mod_config->pin_desc = calloc(sizeof(const struct fw_pin_description),
1711+
ext_mod_config->pin_desc = calloc(sizeof(struct fw_pin_description),
17121712
toml_array_nelem(arr) / 6);
17131713

17141714
if(!ext_mod_config->pin_desc)
@@ -1756,8 +1756,7 @@ static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx,
17561756
ext_mod_config->pin_desc[j].ch_cfg.ul = (uint32_t)val;
17571757
}
17581758

1759-
*ext_length = ext_mod_config->header.num_pin_entries *
1760-
sizeof(const struct fw_pin_description);
1759+
*ext_length = ext_mod_config->header.num_pin_entries * sizeof(struct fw_pin_description);
17611760

17621761
return 0;
17631762
}
@@ -1866,14 +1865,14 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx,
18661865
return err_key_parse("entry", "wrong array type or length != %d", entry_count);
18671866

18681867
modules->mod_ext.mod_conf_count = entry_count;
1869-
modules->mod_man = calloc(sizeof(const struct sof_man_module), entry_count);
1868+
modules->mod_man = calloc(sizeof(struct sof_man_module), entry_count);
18701869
if (!modules->mod_man)
18711870
return -ENOMEM;
18721871

18731872
modules->mod_man_count = toml_array_nelem(mod_entry_array);
18741873

18751874
tmp_cfg_count = entry_count * 32;
1876-
modules->mod_cfg = calloc(sizeof(const struct sof_man_mod_config), tmp_cfg_count);
1875+
modules->mod_cfg = calloc(sizeof(struct sof_man_mod_config), tmp_cfg_count);
18771876

18781877
/* parse entry array elements */
18791878
for (i = 0; i < toml_array_nelem(mod_entry_array); ++i) {

0 commit comments

Comments
 (0)