master - tidy: drop unneeded cast
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=48ce8c7a49a963a3d1357ad2b964f46902a2c163 Commit: 48ce8c7a49a963a3d1357ad2b964f46902a2c163 Parent: 4a2994b7b1ff4a09f250f6389894a3072d7e3acd Author: Zdenek Kabelac <[email protected]> AuthorDate: Thu Jul 20 09:57:09 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Thu Jul 20 11:20:44 2017 +0200
tidy: drop unneeded cast
Avoid casting to the same type.
--- lib/device/dev-type.c | 2 +- lib/format_text/format-text.c | 6 +++--- lib/metadata/metadata.c | 2 +- lib/metadata/pv_manip.c | 10 +++++----- lib/metadata/raid_manip.c | 2 +- liblvm/lvm_lv.c | 3 +-- liblvm/lvm_vg.c | 2 +- tools/command.c | 4 ++-- tools/toollib.c | 4 ++-- 9 files changed, 17 insertions(+), 18 deletions(-)
lib/device/dev-type.c +1 -1
@@ -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 ) {/*
lib/format_text/format-text.c +3 -3
@@ -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",
lib/metadata/metadata.c +1 -1
@@ -1294,7 +1294,7 @@ static dm_bitset_t _bitset_with_random_bits(struct dm_pool *mem, uint32_t num_bichar 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 ; }
lib/metadata/pv_manip.c +5 -5
@@ -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);
lib/metadata/raid_manip.c +1 -1
@@ -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) {
liblvm/lvm_lv.c +1 -2
@@ -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; }
liblvm/lvm_vg.c +1 -1
@@ -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; }
tools/command.c +2 -2
@@ -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 ); }
tools/toollib.c +2 -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 ;