From: Zdenek Kabelac Date: Tue, 23 Feb 2016 18:57:56 +0000 (+0100) Subject: coverity: drop unused assignments X-Git-Tag: v2_02_144~58 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=9b92cb27609ed239814d1e0d36f77d41464b23bd;p=lvm2.git coverity: drop unused assignments --- diff --git a/tools/lvrename.c b/tools/lvrename.c index 1f6e82924..e37d8aa0f 100644 --- a/tools/lvrename.c +++ b/tools/lvrename.c @@ -81,7 +81,7 @@ int lvrename(struct cmd_context *cmd, int argc, char **argv) char *lv_name_old, *lv_name_new; const char *vg_name, *vg_name_new, *vg_name_old; char *st; - int ret = ECMD_FAILED; + int ret; if (argc == 3) { vg_name = skip_dev_dir(cmd, argv[0], NULL); @@ -169,6 +169,6 @@ int lvrename(struct cmd_context *cmd, int argc, char **argv) _lvrename_single); destroy_processing_handle(cmd, handle); - return ret; + return ret; } diff --git a/tools/lvresize.c b/tools/lvresize.c index af6ce07b7..2c2df366c 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -199,10 +199,12 @@ int lvresize(struct cmd_context *cmd, int argc, char **argv) { struct processing_handle *handle; struct lvresize_params lp = { 0 }; - int ret = ECMD_FAILED; + int ret; - if (!_lvresize_params(cmd, argc, argv, &lp)) + if (!_lvresize_params(cmd, argc, argv, &lp)) { + stack; return EINVALID_CMD_LINE; + } if (!(handle = init_processing_handle(cmd))) { log_error("Failed to initialize processing handle."); diff --git a/tools/vgrename.c b/tools/vgrename.c index 633999e69..e5af82088 100644 --- a/tools/vgrename.c +++ b/tools/vgrename.c @@ -38,7 +38,6 @@ static int _vgrename_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, struct processing_handle *handle) { struct vgrename_params *vp = (struct vgrename_params *) handle->custom_handle; - struct lvmcache_vginfo *vginfo; char old_path[NAME_LEN]; char new_path[NAME_LEN]; struct id id; @@ -72,7 +71,7 @@ static int _vgrename_single(struct cmd_context *cmd, const char *vg_name, */ lvmcache_seed_infos_from_lvmetad(cmd); - if ((vginfo = lvmcache_vginfo_from_vgname(vp->vg_name_new, NULL))) { + if (lvmcache_vginfo_from_vgname(vp->vg_name_new, NULL)) { log_error("New VG name \"%s\" already exists", vp->vg_name_new); return ECMD_FAILED; }