[PATCH 2/2] s390: avoid warnings

Jim Meyering meyering at redhat.com
Thu Nov 25 14:57:00 GMT 2010


* libparted/labels/vtoc.c (vtoc_read_volume_label): Remove decl
of unused var.
* libparted/labels/fdasd.c (fdasd_valid_vtoc_pointer): Return
a value also when successful.
* libparted/labels/dasd.c (dasd_alloc_metadata): Initialize "part"
to NULL solely to avoid a spurious used-uninitialized warning.
---
 libparted/labels/dasd.c  |    2 +-
 libparted/labels/fdasd.c |    1 +
 libparted/labels/vtoc.c  |    1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index 8114347..bca1662 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -906,7 +906,7 @@ dasd_alloc_metadata (PedDisk* disk)
 	PedSector vtoc_end;
 	LinuxSpecific* arch_specific;
 	DasdDiskSpecific* disk_specific;
-	PedPartition* part;
+	PedPartition* part = NULL; /* initialize solely to placate gcc */
 	PedPartition* new_part2;
 	PedSector trailing_meta_start, trailing_meta_end;
 	struct fdasd_anchor anchor;
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index 8da7b1f..6d708f6 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -707,6 +707,7 @@ fdasd_valid_vtoc_pointer(fdasd_anchor_t *anc, unsigned long b, int fd)
 		return 0;

 	fdasd_error(anc, wrong_disk_format, _("Invalid VTOC."));
+	return 1;
 }

 /*
diff --git a/libparted/labels/vtoc.c b/libparted/labels/vtoc.c
index dab5181..cf2990e 100644
--- a/libparted/labels/vtoc.c
+++ b/libparted/labels/vtoc.c
@@ -290,7 +290,6 @@ vtoc_read_volume_label (int f, unsigned long vlabel_start,
 	bogus_label_t *bogus_ptr = &mybogus;
 	vollabel_t *union_ptr = &bogus_ptr->actual_label;
 	volume_label_t *cdl_ptr = &union_ptr->cdl;
-	cms_volume_label_t *cms_ptr = &union_ptr->cms;

 	PDEBUG
 	int rc;
--
1.7.3.2.765.g642a8





More information about the Parted-maintainers mailing list