1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cleanup: avoid double assign

Skip setting a value to a variable which is never
used and overwritten/set afterwards.
This commit is contained in:
Zdenek Kabelac 2014-08-19 14:19:11 +02:00
parent 94786a3bbf
commit 24df01f735
7 changed files with 7 additions and 7 deletions

View File

@ -2325,7 +2325,7 @@ int lv_activate_with_filter(struct cmd_context *cmd, const char *lvid_s, int exc
int lv_mknodes(struct cmd_context *cmd, const struct logical_volume *lv)
{
int r = 1;
int r;
if (!lv) {
r = dm_mknodes(NULL);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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 at leas one, it's clear there's no match */

View File

@ -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;