All of lore.kernel.org
 help / color / mirror / Atom feed
* master - cleanup: gcc warning
@ 2014-08-15 13:33 Peter Rajnoha
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Rajnoha @ 2014-08-15 13:33 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8e449ebd63228bb8728d7e62989dc1254138b153
Commit:        8e449ebd63228bb8728d7e62989dc1254138b153
Parent:        d213758e5720f47d3a5781d958431c8d80afdda7
Author:        Peter Rajnoha <prajnoha@redhat.com>
AuthorDate:    Fri Aug 15 15:32:04 2014 +0200
Committer:     Peter Rajnoha <prajnoha@redhat.com>
CommitterDate: Fri Aug 15 15:32:04 2014 +0200

cleanup: gcc warning

metadata/lv_manip.c:269: warning: declaration of "snapshot_count" shadows a global declaration

There's existing function called "snapshot_count" so rename the
variable to "snap_count".
---
 lib/metadata/lv_manip.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 35b898f..d86bdc1 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -266,7 +266,7 @@ static int _lv_type_list_thin(struct dm_pool *mem,
 			      struct dm_list *type)
 {
 	int top_level = 1;
-	unsigned snapshot_count;
+	unsigned snap_count;
 
 	if (lv_is_thin_pool(lv)) {
 		if (!str_list_add_no_dup_check(mem, type, _lv_type_names[LV_TYPE_THIN]) ||
@@ -286,10 +286,10 @@ static int _lv_type_list_thin(struct dm_pool *mem,
 	} else if (lv_is_thin_volume(lv)) {
 		if (!str_list_add_no_dup_check(mem, type, _lv_type_names[LV_TYPE_THIN]))
 			goto_bad;
-		if (lv_is_thin_origin(lv, &snapshot_count) &&
+		if (lv_is_thin_origin(lv, &snap_count) &&
 		    !str_list_add_no_dup_check(mem, type, _lv_type_names[LV_TYPE_ORIGIN]))
 				goto_bad;
-		if (snapshot_count > 1 &&
+		if (snap_count > 1 &&
 		    !str_list_add_no_dup_check(mem, type, _lv_type_names[LV_TYPE_MULTIPLE]))
 			goto_bad;
 		if (first_seg(lv)->origin)



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* master - cleanup: gcc warning
@ 2014-08-15 13:44 Peter Rajnoha
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Rajnoha @ 2014-08-15 13:44 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8af23092310aeb02282f5082fba447586a1da0d3
Commit:        8af23092310aeb02282f5082fba447586a1da0d3
Parent:        8e449ebd63228bb8728d7e62989dc1254138b153
Author:        Peter Rajnoha <prajnoha@redhat.com>
AuthorDate:    Fri Aug 15 15:43:42 2014 +0200
Committer:     Peter Rajnoha <prajnoha@redhat.com>
CommitterDate: Fri Aug 15 15:43:42 2014 +0200

cleanup: gcc warning

One more:

metadata/thin_manip.c:503: warning: declaration of "snapshot_count" shadows a global declaration
---
 lib/metadata/thin_manip.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index b4da500..ae42da1 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -500,13 +500,13 @@ const char *get_pool_discards_name(thin_discards_t discards)
 	return "unknown";
 }
 
-int lv_is_thin_origin(const struct logical_volume *lv, unsigned int *snapshot_count)
+int lv_is_thin_origin(const struct logical_volume *lv, unsigned int *snap_count)
 {
 	struct seg_list *segl;
 	int r = 0;
 
-	if (snapshot_count)
-		*snapshot_count = 0;
+	if (snap_count)
+		*snap_count = 0;
 
 	if (!lv_is_thin_volume(lv) ||
 	    dm_list_empty(&lv->segs_using_this_lv))
@@ -515,8 +515,8 @@ int lv_is_thin_origin(const struct logical_volume *lv, unsigned int *snapshot_co
 	dm_list_iterate_items(segl, &lv->segs_using_this_lv) {
 		if (segl->seg->origin == lv) {
 			r = 1;
-			if (snapshot_count)
-				(*snapshot_count)++;
+			if (snap_count)
+				(*snap_count)++;
 			else
 				/* not interested in number of snapshots */
 				break;



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-15 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-15 13:44 master - cleanup: gcc warning Peter Rajnoha
  -- strict thread matches above, loose matches on Subject: below --
2014-08-15 13:33 Peter Rajnoha

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.