Date: Tue, 2 May 2023 12:20:42 GMT From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 485005801104 - stable/12 - mpr: don't use hardcoded value in debug branch Message-ID: <202305021220.342CKgHs067631@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=4850058011041b5e3b1956cd76016f6cc50dc979 commit 4850058011041b5e3b1956cd76016f6cc50dc979 Author: Mariusz Zaborski <oshogbo@FreeBSD.org> AuthorDate: 2023-04-21 07:57:38 +0000 Commit: Mariusz Zaborski <oshogbo@FreeBSD.org> CommitDate: 2023-05-02 12:19:35 +0000 mpr: don't use hardcoded value in debug branch Pointed out by: imp Sponsored by: Klara Inc. (cherry picked from commit 444c6615459efe2b015deb1cffc54fcaa3ea1fca) --- sys/dev/mpr/mpr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 33afb7adf852..562d629c7afa 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2790,9 +2790,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, evtreq->SASBroadcastPrimitiveMasks = 0; #ifdef MPR_DEBUG_ALL_EVENTS { - u_char fullmask[16]; - memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + u_char fullmask[sizeof(evtreq->EventMasks)]; + memset(fullmask, 0x00, sizeof(fullmask)); + bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, sizeof(fullmask)); } #else bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); @@ -2846,9 +2846,9 @@ mpr_reregister_events(struct mpr_softc *sc) evtreq->SASBroadcastPrimitiveMasks = 0; #ifdef MPR_DEBUG_ALL_EVENTS { - u_char fullmask[16]; - memset(fullmask, 0x00, 16); - bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); + u_char fullmask[sizeof(evtreq->EventMasks)]; + memset(fullmask, 0x00, sizeof(fullmask)); + bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, sizeof(fullmask)); } #else bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305021220.342CKgHs067631>