summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2016-01-28 13:09:21 +0000
committerkrw <krw@openbsd.org>2016-01-28 13:09:21 +0000
commitd5ffcd0aa5bd9a05ca844e8b6af619238f4a8837 (patch)
tree674aeb61408770e62490d806df8b770bd5d83ae5
parentUse consistent 'return' idiom -- no parenthesis since that was the style (diff)
downloadwireguard-openbsd-d5ffcd0aa5bd9a05ca844e8b6af619238f4a8837.tar.xz
wireguard-openbsd-d5ffcd0aa5bd9a05ca844e8b6af619238f4a8837.zip
Since we don't allow maps to be created or opened with an invalid
block0, there is no point in checking later if block0 has magically become invalid.
-rw-r--r--sbin/pdisk/dump.c8
-rw-r--r--sbin/pdisk/partition_map.c14
2 files changed, 5 insertions, 17 deletions
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c
index 8085890fe32..f0dc022b175 100644
--- a/sbin/pdisk/dump.c
+++ b/sbin/pdisk/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.60 2016/01/27 20:34:27 krw Exp $ */
+/* $OpenBSD: dump.c,v 1.61 2016/01/28 13:09:21 krw Exp $ */
/*
* dump.c - dumping partition maps
@@ -52,8 +52,6 @@ dump_block_zero(struct partition_map_header *map)
int i, prefix;
p = map->block0;
- if (p->sbSig != BLOCK0_SIGNATURE)
- return;
value = ((double) p->sbBlkCount) * p->sbBlkSize;
adjust_value_and_compute_prefix(&value, &prefix);
@@ -165,10 +163,6 @@ show_data_structures(struct partition_map_header *map)
printf("Block0:\n");
printf("signature 0x%x", zp->sbSig);
- if (zp->sbSig == BLOCK0_SIGNATURE)
- printf("\n");
- else
- printf(" should be 0x%x\n", BLOCK0_SIGNATURE);
printf("Block size=%u, Number of Blocks=%u\n", zp->sbBlkSize,
zp->sbBlkCount);
printf("DeviceType=0x%x, DeviceId=0x%x, sbData=0x%x\n", zp->sbDevType,
diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c
index 877a754754c..33dee16d4da 100644
--- a/sbin/pdisk/partition_map.c
+++ b/sbin/pdisk/partition_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.c,v 1.74 2016/01/28 13:01:33 krw Exp $ */
+/* $OpenBSD: partition_map.c,v 1.75 2016/01/28 13:09:21 krw Exp $ */
/*
* partition_map.c - partition map routines
@@ -620,8 +620,6 @@ contains_driver(struct partition_map *entry)
map = entry->the_map;
p = map->block0;
- if (p->sbSig != BLOCK0_SIGNATURE)
- return 0;
if (p->sbDrvrCount > 0) {
m = p->sbDDMap;
@@ -966,16 +964,12 @@ doit:
void
remove_driver(struct partition_map *entry)
{
- struct partition_map_header *map;
- struct block0 *p;
- struct ddmap *m;
+ struct block0 *p;
+ struct ddmap *m;
int i, j;
uint32_t start;
- map = entry->the_map;
- p = map->block0;
- if (p->sbSig != BLOCK0_SIGNATURE)
- return;
+ p = entry->the_map->block0;
/*
* compute the factor to convert the block numbers in block0