diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-01-04 11:50:15 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2008-01-04 11:50:15 +0000 |
commit | efcce6e22456896ff127ba3a382fa4bcfdce5948 (patch) | |
tree | d87ee6c995d443489a22d41b5aa99807bf92c6a8 /sys/dev/usb/if_upgt.c | |
parent | dd3a287295ba9072c4c55175101fd3244caa7a24 (diff) |
Fix wrong sizeof(). Makes driver work on amd64, too.
Diffstat (limited to 'sys/dev/usb/if_upgt.c')
-rw-r--r-- | sys/dev/usb/if_upgt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index dd9d94652cf..619a6c0655b 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgt.c,v 1.15 2008/01/04 10:04:07 mglocker Exp $ */ +/* $OpenBSD: if_upgt.c,v 1.16 2008/01/04 11:50:14 mglocker Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -619,12 +619,12 @@ upgt_fw_verify(struct upgt_softc *sc) /* * Seek to beginning of Boot Record Area (BRA). */ - for (offset = 0; offset < sc->sc_fw_size; offset += sizeof(uc)) { + for (offset = 0; offset < sc->sc_fw_size; offset += sizeof(*uc)) { uc = (uint32_t *)(sc->sc_fw + offset); if (*uc == 0) break; } - for (; offset < sc->sc_fw_size; offset += sizeof(uc)) { + for (; offset < sc->sc_fw_size; offset += sizeof(*uc)) { uc = (uint32_t *)(sc->sc_fw + offset); if (*uc != 0) break; @@ -644,7 +644,7 @@ upgt_fw_verify(struct upgt_softc *sc) /* get current BRA option */ bra_option = (struct upgt_fw_bra_option *)(sc->sc_fw + offset); bra_option_type = letoh32(bra_option->type); - bra_option_len = letoh32(bra_option->len) * sizeof(uc); + bra_option_len = letoh32(bra_option->len) * sizeof(*uc); switch (bra_option_type) { case UPGT_BRA_TYPE_FW: |