master - cleanup: avoid double assign
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=24df01f7352e0cf525528000c2026a9a6571b733 Commit: 24df01f7352e0cf525528000c2026a9a6571b733 Parent: 94786a3bbf0b68883a2618c9bc25fc88e367f9f8 Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Aug 19 14:19:11 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Aug 19 14:33:06 2014 +0200
cleanup: avoid double assign
Skip setting a value to a variable which is never
used and overwritten/set afterwards.
--- lib/activate/activate.c | 2 +- lib/display/display.c | 2 +- lib/locking/cluster_locking.c | 2 +- lib/misc/lvm-flock.c | 2 +- libdaemon/server/daemon-server.c | 2 +- libdm/libdm-report.c | 2 +- tools/dmsetup.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-)
lib/activate/activate.c +1 -1
@@ -2325,7 +2325,7 @@ int lv_activate_with_filter(struct cmd_context *cmd, const char *lvid_s, int excint lv_mknodes (struct cmd_context *cmd,const struct logical_volume *lv) { -int r =1 ; +int r;if (!lv) { r =dm_mknodes (NULL );
lib/display/display.c +1 -1
@@ -113,7 +113,7 @@ static const char *_display_size(const struct cmd_context *cmd, {unsigned base =BASE_UNKNOWN ;unsigned s; -int suffix =1 , precision; +int suffix, precision;uint64_t byte =UINT64_C (0 );uint64_t units =UINT64_C (1024 );char *size_buf =NULL ;
lib/locking/cluster_locking.c +1 -1
@@ -419,7 +419,7 @@ static int _lock_resource(struct cmd_context *cmd, const char *resource,char lockname[PATH_MAX ];int clvmd_cmd =0 ;const char *lock_scope; -const char *lock_type ="" ; +const char *lock_type;assert (strlen (resource) <sizeof (lockname));assert (resource);
lib/misc/lvm-flock.c +1 -1
@@ -93,7 +93,7 @@ void release_flocks(int unlock)static int _do_flock (const char *file,int *fd,int operation,uint32_t nonblock) { -int r =1 ; +int r;int old_errno;struct stat buf1, buf2;
libdaemon/server/daemon-server.c +1 -1
@@ -205,7 +205,7 @@ out:static int _open_socket (daemon_state s) { -int fd =-1 ; +int fd;int file_created =0 ;struct sockaddr_un sockaddr = { .sun_family =AF_UNIX };struct stat buf;
libdm/libdm-report.c +1 -1
@@ -1278,7 +1278,7 @@ static int _cmp_field_string_list_subset_all(const struct str_list_sort_value *v const struct selection_str_list *sel) {struct dm_str_list *sel_item; -unsigned int i =1 , last_found =1 ;; +unsigned int i, last_found =1 ;;int r =0 ;/* if value has no items and selection has@leas one, it's clear there's no match */
tools/dmsetup.c +1 -1
@@ -897,7 +897,7 @@ static int _setgeometry(CMD_ARGS)static int _splitname (CMD_ARGS ) {struct dmsetup_report_obj obj; -int r =1 ; +int r; obj.task =NULL ; obj.info =NULL ;