summaryrefslogtreecommitdiff
path: root/sbin/pdisk
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-01-24 15:18:51 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-01-24 15:18:51 +0000
commitdf22297ecb2be6a87bfb7065ea3bd3532b2e3b39 (patch)
treede8bc7eed60b5c59865d38255a13b902ba046904 /sbin/pdisk
parent0544d14c5e0780b1e5974a264bbd72eac7bfda76 (diff)
Nuke get_align_long() and put_align_long() #define's. They don't do
anything according to gcc & cmp. cmp suggested by & ok stefan@.
Diffstat (limited to 'sbin/pdisk')
-rw-r--r--sbin/pdisk/dump.c15
-rw-r--r--sbin/pdisk/partition_map.c14
2 files changed, 11 insertions, 18 deletions
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c
index 8cac84de7a7..219def367d1 100644
--- a/sbin/pdisk/dump.c
+++ b/sbin/pdisk/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.48 2016/01/24 01:38:32 krw Exp $ */
+/* $OpenBSD: dump.c,v 1.49 2016/01/24 15:18:50 krw Exp $ */
/*
* dump.c - dumping partition maps
@@ -37,8 +37,6 @@
#include "dump.h"
#include "io.h"
-#define get_align_long(x) (*(x))
-
void adjust_value_and_compute_prefix(double *, int *);
void dump_block_zero(struct partition_map_header *);
void dump_partition_entry(struct partition_map *, int, int, int);
@@ -70,14 +68,14 @@ dump_block_zero(struct partition_map_header *map)
printf("Drivers-\n");
m = (struct ddmap *) p->sbMap;
for (i = 0; i < p->sbDrvrCount; i++) {
- printf("%d: %3u @ %u, ", i + 1,
- m[i].ddSize, get_align_long(&m[i].ddBlock));
+ printf("%d: %3u @ %u, ", i + 1, m[i].ddSize,
+ m[i].ddBlock);
if (map->logical_block != p->sbBlkSize) {
t = (m[i].ddSize * p->sbBlkSize) /
map->logical_block;
printf("(%lu@", t);
- t = (get_align_long(&m[i].ddBlock) *
- p->sbBlkSize) / map->logical_block;
+ t = m[i].ddBlock * p->sbBlkSize /
+ map->logical_block;
printf("%lu) ", t);
}
printf("type=0x%x\n", m[i].ddType);
@@ -208,8 +206,7 @@ show_data_structures(struct partition_map_header *map)
m = (struct ddmap *) zp->sbMap;
for (i = 0; i < zp->sbDrvrCount; i++) {
printf("%u: @ %u for %u, type=0x%x\n", i + 1,
- get_align_long(&m[i].ddBlock), m[i].ddSize,
- m[i].ddType);
+ m[i].ddBlock, m[i].ddSize, m[i].ddType);
}
}
printf("\n");
diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c
index eef0808fae3..83f728014f3 100644
--- a/sbin/pdisk/partition_map.c
+++ b/sbin/pdisk/partition_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.c,v 1.61 2016/01/24 01:38:32 krw Exp $ */
+/* $OpenBSD: partition_map.c,v 1.62 2016/01/24 15:18:50 krw Exp $ */
/*
* partition_map.c - partition map routines
@@ -41,8 +41,6 @@
#include "file_media.h"
#define APPLE_HFS_FLAGS_VALUE 0x4000037f
-#define get_align_long(x) (*(x))
-#define put_align_long(y, x) ((*(x)) = (y))
const char *kFreeType = "Apple_Free";
const char *kMapType = "Apple_partition_map";
@@ -627,7 +625,7 @@ contains_driver(struct partition_map *entry)
if (p->sbDrvrCount > 0) {
m = (struct ddmap *) p->sbMap;
for (i = 0; i < p->sbDrvrCount; i++) {
- start = get_align_long(&m[i].ddBlock);
+ start = m[i].ddBlock;
if (entry->dpme->dpme_pblock_start <= f * start &&
f * (start + m[i].ddSize) <=
(entry->dpme->dpme_pblock_start +
@@ -986,7 +984,7 @@ remove_driver(struct partition_map *entry)
if (p->sbDrvrCount > 0) {
m = (struct ddmap *) p->sbMap;
for (i = 0; i < p->sbDrvrCount; i++) {
- start = get_align_long(&m[i].ddBlock);
+ start = m[i].ddBlock;
/*
* zap the driver if it is wholly contained in the
@@ -1002,12 +1000,11 @@ remove_driver(struct partition_map *entry)
* last
*/
for (j = i + 1; j < p->sbDrvrCount; j++, i++) {
- put_align_long(get_align_long(
- &m[j].ddBlock), &m[i].ddBlock);
+ m[i].ddBlock = m[i].ddBlock;
m[i].ddSize = m[j].ddSize;
m[i].ddType = m[j].ddType;
}
- put_align_long(0, &m[i].ddBlock);
+ m[i].ddBlock = 0;
m[i].ddSize = 0;
m[i].ddType = 0;
p->sbDrvrCount -= 1;
@@ -1017,4 +1014,3 @@ remove_driver(struct partition_map *entry)
}
}
}
-