Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 May 2023 12:22:07 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: 834fdebb56fb - stable/13 - mpr: don't use hardcoded value in debug branch
Message-ID:  <202305021222.342CM7DA073146@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by oshogbo:

URL: https://cgit.FreeBSD.org/src/commit/?id=834fdebb56fbf9ae111f5da91683fea5ddcebe08

commit 834fdebb56fbf9ae111f5da91683fea5ddcebe08
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:21:48 +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 c105174b0e21..35d59b43a011 100644
--- a/sys/dev/mpr/mpr.c
+++ b/sys/dev/mpr/mpr.c
@@ -2759,9 +2759,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));
@@ -2815,9 +2815,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?202305021222.342CM7DA073146>