summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2019-11-08 16:13:29 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2019-11-08 16:13:29 +0000
commitc3937f6821ed230f6cf5e9589bbd5460d5242eb1 (patch)
tree742d2e89a85d1e6f732a4d10c8254591dee1982d /sys
parent9d0b43a105f2da209266b7273188850aef414305 (diff)
The u_long fields in struct disk_parms (secsize, heads, cyls, sectors)
are always initializd to u_int32_t values. And are then copied into u_int32_t fields in the disklabel. Switch them to u_int32_t. Cluebats and ok deraadt@ jca@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/sd.c4
-rw-r--r--sys/scsi/sdvar.h10
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 59050150d4b..d88d379580b 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.293 2019/11/07 17:45:22 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.294 2019/11/08 16:13:28 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -218,7 +218,7 @@ sdattach(struct device *parent, struct device *self, void *aux)
scsi_prevent(link, PR_ALLOW, sd_autoconf);
if (error == 0) {
- printf("%s: %lluMB, %lu bytes/sector, %llu sectors",
+ printf("%s: %lluMB, %u bytes/sector, %llu sectors",
sc->sc_dev.dv_xname,
dp->disksize / (1048576 / dp->secsize), dp->secsize,
dp->disksize);
diff --git a/sys/scsi/sdvar.h b/sys/scsi/sdvar.h
index 6cd99951394..635bee43989 100644
--- a/sys/scsi/sdvar.h
+++ b/sys/scsi/sdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdvar.h,v 1.44 2019/10/23 13:50:50 krw Exp $ */
+/* $OpenBSD: sdvar.h,v 1.45 2019/11/08 16:13:28 krw Exp $ */
/* $NetBSD: sdvar.h,v 1.7 1998/08/17 00:49:03 mycroft Exp $ */
/*-
@@ -64,10 +64,10 @@ struct sd_softc {
#define SDF_THIN 0x01 /* disk is thin provisioned */
struct scsi_link *sc_link; /* contains our targ, lun, etc. */
struct disk_parms {
- u_long heads; /* number of heads */
- u_long cyls; /* number of cylinders */
- u_long sectors; /* number of sectors/track */
- u_long secsize; /* number of bytes/sector */
+ u_int32_t heads; /* number of heads */
+ u_int32_t cyls; /* number of cylinders */
+ u_int32_t sectors; /* number of sectors/track */
+ u_int32_t secsize; /* number of bytes/sector */
u_int64_t disksize; /* total number sectors */
u_int32_t unmap_sectors; /* maximum sectors/unmap */
u_int32_t unmap_descs; /* maximum descriptors/unmap */