Module Name: src Committed By: rin Date: Tue Feb 28 04:39:58 UTC 2017
Modified Files: src/sys/dev/dkwedge: dkwedge_rdb.c Log Message: Remove PARANOID macro; we should always update secsize if necessary. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/dkwedge/dkwedge_rdb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/dkwedge/dkwedge_rdb.c diff -u src/sys/dev/dkwedge/dkwedge_rdb.c:1.1 src/sys/dev/dkwedge/dkwedge_rdb.c:1.2 --- src/sys/dev/dkwedge/dkwedge_rdb.c:1.1 Sun Feb 26 11:56:49 2017 +++ src/sys/dev/dkwedge/dkwedge_rdb.c Tue Feb 28 04:39:58 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dkwedge_rdb.c,v 1.1 2017/02/26 11:56:49 rin Exp $ */ +/* $NetBSD: dkwedge_rdb.c,v 1.2 2017/02/28 04:39:58 rin Exp $ */ /* * Adapted from arch/amiga/amiga/disksubr.c: @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dkwedge_rdb.c,v 1.1 2017/02/26 11:56:49 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dkwedge_rdb.c,v 1.2 2017/02/28 04:39:58 rin Exp $"); #include <sys/param.h> #include <sys/disklabel_rdb.h> @@ -96,9 +96,6 @@ __KERNEL_RCSID(0, "$NetBSD: dkwedge_rdb. #define ADJUST_NR(x) (x) #endif -/* XXX */ -#define PARANOID - #ifdef _KERNEL #define DKW_MALLOC(SZ) malloc((SZ), M_DEVBUF, M_WAITOK) #define DKW_FREE(PTR) free((PTR), M_DEVBUF) @@ -121,7 +118,7 @@ dkwedge_discover_rdb(struct disk *pdk, s struct rdblock *rbp; void *bp; int error; - unsigned blk_per_cyl, bufsize, nextb, secsize, tabsize; + unsigned blk_per_cyl, bufsize, newsecsize, nextb, secsize, tabsize; const char *ptype; unsigned char archtype; bool found, root, swap; @@ -159,8 +156,7 @@ dkwedge_discover_rdb(struct disk *pdk, s goto done; } -#ifdef PARANOID - unsigned newsecsize = be32toh(rbp->nbytes); + newsecsize = be32toh(rbp->nbytes); if (secsize != newsecsize) { aprint_verbose("secsize changed from %u to %u\n", secsize, newsecsize); @@ -170,7 +166,6 @@ dkwedge_discover_rdb(struct disk *pdk, s bufsize *= 2; bp = DKW_REALLOC(bp, bufsize); } -#endif strlcpy(dkw.dkw_parent, pdk->dk_name, sizeof(dkw.dkw_parent));