From: deraadt Date: Wed, 2 Apr 1997 18:28:09 +0000 (+0000) Subject: warn about MAXPARTITIONS != 16, grr@shandakor.tharsis.com X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2158c0f82a9d7e64fe980c9a0c8061c34b996155;p=openbsd warn about MAXPARTITIONS != 16, grr@shandakor.tharsis.com --- diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c index 7475b2bf7e8..725fcadb30a 100644 --- a/sys/arch/sparc/sparc/disksubr.c +++ b/sys/arch/sparc/sparc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.11 1997/01/02 06:28:43 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.12 1997/04/02 18:28:09 deraadt Exp $ */ /* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */ /* @@ -53,6 +53,10 @@ #include +#if MAXPARTITIONS != 16 +#warn beware: Sun disklabel compatibility assumes MAXPARTITIONS == 16 +#endif + static char *disklabel_sun_to_bsd __P((char *, struct disklabel *)); static int disklabel_bsd_to_sun __P((struct disklabel *, char *)); @@ -293,7 +297,7 @@ bounds_check_with_label(bp, lp, wlabel) struct disklabel *lp; int wlabel; { -#define dkpart(dev) (minor(dev) & (MAXPARTITIONS-1)) +#define dkpart(dev) DISKPART(dev) struct partition *p = lp->d_partitions + dkpart(bp->b_dev); int maxsz = p->p_size;