summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-19 11:23:58 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-10-19 11:23:58 +0000
commita7a5a186672eb7551af3e7f9c8077ce66d124a9c (patch)
tree9cf7abf6fb570b355ad7e5bba0f78f7d08dc61e1 /sys/arch
parentf0e82a207901467b958af03dab3f0c5ea9b54fca (diff)
EEPROM_SIZE -> sizeof(struct eeprom)
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/sparc/clock.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/arch/sparc/sparc/clock.c b/sys/arch/sparc/sparc/clock.c
index 15f6b1c4f6c..43fe2528964 100644
--- a/sys/arch/sparc/sparc/clock.c
+++ b/sys/arch/sparc/sparc/clock.c
@@ -1063,14 +1063,15 @@ eeprom_uio(uio)
return (ENODEV);
off = uio->uio_offset;
- if (off > EEPROM_SIZE)
+ if (off > sizeof(struct eeprom))
return (EFAULT);
cnt = uio->uio_resid;
- if (cnt > (EEPROM_SIZE - off))
- cnt = (EEPROM_SIZE - off);
+ if (cnt > sizeof(struct eeprom) - off)
+ cnt = sizeof(struct eeprom) - off;
- if ((error = eeprom_take()) != 0)
+ error = eeprom_take();
+ if (error != 0)
return (error);
if (eeprom_va == NULL) {
@@ -1084,14 +1085,14 @@ eeprom_uio(uio)
* this, we byte-by-byte copy the eeprom contents into a
* temporary buffer.
*/
- buf = malloc(EEPROM_SIZE, M_DEVBUF, M_WAITOK);
+ buf = malloc(sizeof(struct eeprom), M_DEVBUF, M_WAITOK);
if (buf == NULL) {
error = EAGAIN;
goto out;
}
if (uio->uio_rw == UIO_READ)
- for (bcnt = 0; bcnt < EEPROM_SIZE; ++bcnt)
+ for (bcnt = 0; bcnt < sizeof(struct eeprom); ++bcnt)
*(char *)(buf + bcnt) = *(char *)(eeprom_va + bcnt);
if ((error = uiomove(buf + off, (int)cnt, uio)) != 0)