diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c index aa22e3b0f..05e5bef63 100644 --- a/lib/device/dev-type.c +++ b/lib/device/dev-type.c @@ -76,7 +76,7 @@ struct dev_types *create_dev_types(const char *proc_dir, i++; /* If it's not a number it may be name of section */ - line_maj = atoi(((char *) (line + i))); + line_maj = atoi(line + i); if (line_maj < 0 || line_maj >= NUMBER_OF_MAJORS) { /* diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 91f88162b..7db4637d4 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -2291,9 +2291,9 @@ static int _text_pv_add_metadata_area(const struct format_type *fmt, } /* Wipe metadata area with zeroes. */ - if (!dev_set((struct device *) pv->dev, mda_start, - (size_t) ((mda_size > wipe_size) ? - wipe_size : mda_size), 0)) { + if (!dev_set(pv->dev, mda_start, + (size_t) ((mda_size > wipe_size) ? + wipe_size : mda_size), 0)) { log_error("Failed to wipe new metadata area " "at the %s of the %s", mda_index ? "end" : "start", diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index ce2e3cc82..bbbf7d068 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -1294,7 +1294,7 @@ static dm_bitset_t _bitset_with_random_bits(struct dm_pool *mem, uint32_t num_bi char buf[32]; uint32_t i = num_bits - num_set_bits; - if (!(bs = dm_bitset_create(mem, (unsigned) num_bits))) { + if (!(bs = dm_bitset_create(mem, num_bits))) { log_error("Failed to allocate bitset for setting random bits."); return NULL; } diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c index de6644e6b..f37bc4c59 100644 --- a/lib/metadata/pv_manip.c +++ b/lib/metadata/pv_manip.c @@ -648,23 +648,23 @@ int pv_resize_single(struct cmd_context *cmd, log_warn("WARNING: %s: Overriding real size %s. You could lose data.", pv_name, display_size(cmd, (uint64_t) size)); if (!yes && yes_no_prompt("%s: Requested size %s exceeds real size %s. Proceed? [y/n]: ", - pv_name, display_size(cmd, (uint64_t) new_size), - display_size(cmd, (uint64_t) size)) == 'n') { + pv_name, display_size(cmd, new_size), + display_size(cmd, size)) == 'n') { log_error("Physical Volume %s not resized.", pv_name); goto_out; } } else if (new_size < size) if (!yes && yes_no_prompt("%s: Requested size %s is less than real size %s. Proceed? [y/n]: ", - pv_name, display_size(cmd, (uint64_t) new_size), - display_size(cmd, (uint64_t) size)) == 'n') { + pv_name, display_size(cmd, new_size), + display_size(cmd, size)) == 'n') { log_error("Physical Volume %s not resized.", pv_name); goto_out; } if (new_size == size) log_verbose("%s: Size is already %s (%" PRIu64 " sectors).", - pv_name, display_size(cmd, (uint64_t) new_size), new_size); + pv_name, display_size(cmd, new_size), new_size); else log_warn("WARNING: %s: Pretending size is %" PRIu64 " not %" PRIu64 " sectors.", pv_name, new_size, size); diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index d96ecebc5..895bb734b 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -1834,7 +1834,7 @@ static int _reshape_adjust_to_size(struct logical_volume *lv, /* Externally visible LV size w/o reshape space */ lv->le_count = seg->len = new_le_count; - lv->size = (uint64_t) (lv->le_count - new_image_count * (uint32_t) _reshape_len_per_dev(seg)) * lv->vg->extent_size; + lv->size = (uint64_t) (lv->le_count - new_image_count * _reshape_len_per_dev(seg)) * lv->vg->extent_size; /* seg->area_len does not change */ if (old_image_count < new_image_count) { diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c index 13d6cbfe4..580e942fe 100644 --- a/liblvm/lvm_lv.c +++ b/liblvm/lvm_lv.c @@ -65,8 +65,7 @@ const char *lvm_lv_get_name(const lv_t lv) { const char *rc; struct saved_env e = store_user_env(lv->vg->cmd); - rc = dm_pool_strndup(lv->vg->vgmem, (const char *)lv->name, - NAME_LEN+1); + rc = dm_pool_strndup(lv->vg->vgmem, lv->name, NAME_LEN+1); restore_user_env(&e); return rc; } diff --git a/liblvm/lvm_vg.c b/liblvm/lvm_vg.c index 8f83230cc..559357953 100644 --- a/liblvm/lvm_vg.c +++ b/liblvm/lvm_vg.c @@ -444,7 +444,7 @@ const char *lvm_vg_get_name(const vg_t vg) { const char *rc; struct saved_env e = store_user_env(vg->cmd); - rc = dm_pool_strndup(vg->vgmem, (const char *)vg->name, NAME_LEN+1); + rc = dm_pool_strndup(vg->vgmem, vg->name, NAME_LEN+1); restore_user_env(&e); return rc; } diff --git a/tools/command.c b/tools/command.c index a37d64dda..b4e5e76a1 100644 --- a/tools/command.c +++ b/tools/command.c @@ -1337,8 +1337,8 @@ int command_has_alternate_extents(const char *name) static int long_name_compare(const void *on1, const void *on2) { - const struct opt_name * const *optname1 = (const void *)on1; - const struct opt_name * const *optname2 = (const void *)on2; + const struct opt_name * const *optname1 = on1; + const struct opt_name * const *optname2 = on2; return strcmp((*optname1)->long_opt + 2, (*optname2)->long_opt + 2); } diff --git a/tools/toollib.c b/tools/toollib.c index 5e3feddd2..c2807b8dc 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -4871,8 +4871,8 @@ static void _check_pvcreate_prompt(struct cmd_context *cmd, } else if (ask) { if (prompt->new_size != prompt->size) { if (yes_no_prompt("WARNING: %s: device size %s does not match requested size %s. Proceed? [y/n]: ", pvname, - display_size(cmd, (uint64_t)prompt->size), - display_size(cmd, (uint64_t)prompt->new_size)) == 'n') { + display_size(cmd, prompt->size), + display_size(cmd, prompt->new_size)) == 'n') { answer_no = 1; } else { answer_yes = 1;