mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tidy: drop unneeded cast
Avoid casting to the same type.
This commit is contained in:
parent
4a2994b7b1
commit
48ce8c7a49
@ -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) {
|
||||
/*
|
||||
|
@ -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",
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user