Module Name:    src
Committed By:   martin
Date:           Fri Jul  4 08:51:15 UTC 2014

Modified Files:
        src/sys/arch/playstation2/playstation2: disksubr.c

Log Message:
Adapt to struct buf changes


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/playstation2/playstation2/disksubr.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/arch/playstation2/playstation2/disksubr.c
diff -u src/sys/arch/playstation2/playstation2/disksubr.c:1.18 src/sys/arch/playstation2/playstation2/disksubr.c:1.19
--- src/sys/arch/playstation2/playstation2/disksubr.c:1.18	Mon Mar 31 11:25:49 2014
+++ src/sys/arch/playstation2/playstation2/disksubr.c	Fri Jul  4 08:51:15 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: disksubr.c,v 1.18 2014/03/31 11:25:49 martin Exp $	*/
+/*	$NetBSD: disksubr.c,v 1.19 2014/07/04 08:51:15 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.18 2014/03/31 11:25:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.19 2014/07/04 08:51:15 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -57,12 +57,12 @@ mbr_findslice(struct mbr_partition *dp, 
 	int i;
 
 	/* Note: Magic number is little-endian. */
-	mbrmagicp = (u_int16_t *)(bp->b_data + MBR_MAGIC_OFFSET);
+	mbrmagicp = (u_int16_t *)((char*)bp->b_data + MBR_MAGIC_OFFSET);
 	if (*mbrmagicp != MBR_MAGIC)
 		return (NO_MBR_SIGNATURE);
 
 	/* XXX how do we check veracity/bounds of this? */
-	memcpy(dp, bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp));
+	memcpy(dp, (char*)bp->b_data + MBR_PART_OFFSET, MBR_PART_COUNT * sizeof(*dp));
 
 	/* look for NetBSD partition */
 	for (i = 0; i < MBR_PART_COUNT; i++) {
@@ -198,7 +198,7 @@ nombrpart:
 		goto done;
 	}
 	for (dlp = (struct disklabel *)bp->b_data;
-	    dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));
+	    dlp <= (struct disklabel *)((char*)bp->b_data + lp->d_secsize - sizeof(*dlp));
 	    dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
 		if (dlp->d_magic != DISKMAGIC || dlp->d_magic2 != DISKMAGIC) {
 			if (msg == NULL)
@@ -371,7 +371,7 @@ nombrpart:
 	if ((error = biowait(bp)) != 0)
 		goto done;
 	for (dlp = (struct disklabel *)bp->b_data;
-	    dlp <= (struct disklabel *)(bp->b_data + lp->d_secsize - sizeof(*dlp));
+	    dlp <= (struct disklabel *)((char*)bp->b_data + lp->d_secsize - sizeof(*dlp));
 	    dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
 		if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC &&
 		    dkcksum(dlp) == 0) {

Reply via email to