From f74250732895549b7c85a7f9636f38b94475e920 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 12 Aug 2006 13:53:45 +0000 Subject: Setting d_secsize to DEV_BSIZE (or 1 << DEV_BSHIFT, or 512) and then setting RAW_PART's p_size to d_secperunit * (d_secsize / DEV_BSIZE) is a waste of a few ops. And p_size should be in sectors anyway. Just set RAW_PART's p_size to d_secperunit to make usage consistant across the tree. Should be a no-op. --- sys/arch/armish/stand/boot/wd.c | 5 ++--- sys/arch/hp300/dev/hd.c | 8 +++----- sys/arch/sparc/dev/presto.c | 5 ++--- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/armish/stand/boot/wd.c b/sys/arch/armish/stand/boot/wd.c index 662a246edb8..4ef15f789a2 100644 --- a/sys/arch/armish/stand/boot/wd.c +++ b/sys/arch/armish/stand/boot/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.3 2006/07/30 20:46:30 drahn Exp $ */ +/* $OpenBSD: wd.c,v 1.4 2006/08/12 13:53:44 krw Exp $ */ /* $NetBSD: wd.c,v 1.5 2005/12/11 12:17:06 christos Exp $ */ /*- @@ -143,8 +143,7 @@ wdgetdefaultlabel(wd, lp) lp->d_flags = 0; lp->d_partitions[RAW_PART].p_offset = 0; - lp->d_partitions[RAW_PART].p_size = - lp->d_secperunit * (lp->d_secsize / DEV_BSIZE); + lp->d_partitions[RAW_PART].p_size = lp->d_secperunit; lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED; lp->d_npartitions = MAXPARTITIONS; /* RAW_PART + 1 ??? */ diff --git a/sys/arch/hp300/dev/hd.c b/sys/arch/hp300/dev/hd.c index d4c437cd61b..9d3ecb0eb78 100644 --- a/sys/arch/hp300/dev/hd.c +++ b/sys/arch/hp300/dev/hd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hd.c,v 1.40 2006/03/15 20:20:39 miod Exp $ */ +/* $OpenBSD: hd.c,v 1.41 2006/08/12 13:53:44 krw Exp $ */ /* $NetBSD: rd.c,v 1.33 1997/07/10 18:14:08 kleink Exp $ */ /* @@ -506,8 +506,7 @@ hdgetinfo(dev, rs, lp, spoofonly) lp->d_sbsize = SBSIZE; lp->d_partitions[RAW_PART].p_offset = 0; - lp->d_partitions[RAW_PART].p_size = - lp->d_secperunit * (lp->d_secsize / DEV_BSIZE); + lp->d_partitions[RAW_PART].p_size = lp->d_secperunit; lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED; lp->d_npartitions = RAW_PART + 1; @@ -524,8 +523,7 @@ hdgetinfo(dev, rs, lp, spoofonly) /* XXX reset partition info as readdisklabel screws with it */ lp->d_partitions[0].p_size = 0; lp->d_partitions[RAW_PART].p_offset = 0; - lp->d_partitions[RAW_PART].p_size = - lp->d_secperunit * (lp->d_secsize / DEV_BSIZE); + lp->d_partitions[RAW_PART].p_size = lp->d_secperunit; lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED; lp->d_npartitions = RAW_PART + 1; lp->d_checksum = dkcksum(lp); diff --git a/sys/arch/sparc/dev/presto.c b/sys/arch/sparc/dev/presto.c index 007db1a6503..6035b04682d 100644 --- a/sys/arch/sparc/dev/presto.c +++ b/sys/arch/sparc/dev/presto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: presto.c,v 1.3 2006/06/02 20:00:54 miod Exp $ */ +/* $OpenBSD: presto.c,v 1.4 2006/08/12 13:53:44 krw Exp $ */ /* * Copyright (c) 2003, Miodrag Vallat. * All rights reserved. @@ -390,8 +390,7 @@ presto_getdisklabel(struct presto_softc *sc) lp->d_flags = D_RAMDISK; lp->d_partitions[RAW_PART].p_offset = 0; - lp->d_partitions[RAW_PART].p_size = - lp->d_secperunit * (lp->d_secsize / DEV_BSIZE); + lp->d_partitions[RAW_PART].p_size = lp->d_secperunit; lp->d_partitions[RAW_PART].p_fstype = FS_UNUSED; lp->d_npartitions = RAW_PART + 1; -- cgit v1.2.3