From nobody Tue May 2 12:22:07 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9fMz4RRnz48wj8; Tue, 2 May 2023 12:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9fMz3mJ0z3vML; Tue, 2 May 2023 12:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7p0xH60o2FgIxavuNVRqmRDMdOh9qtrBBiNYgBFhyLU=; b=QQWfP/bYmFpN+Ckgs2hkx915/iDMi8JwU+M9JsadniO+KIQ46VgXYN+7Ihkk5nqu5x+qdC 3h8qNwsqb2o8hbj0d0ujZZDyTF2oTBWI5vdU3FaxpjZImyLqF2c/8JtTmDpSon895F51I9 j5Tv/Rnzad/DXe1aDv89/iRXW2W1/Sf2mXIMbdzNcon5iBm6OMRKtue2raa5R/YOb+64Of co00TxHslG9I0Hl2p9z/hwmRuCMBSAD35hKgesy/cbYANnh4y+L1Bp6QzMSYxYeR/wbd2T BtLouSa6qhKKw3wYCmIaleupz4LWTpCPCDs+qM/1wUSGK0zHxAQdQsDDl5hMcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7p0xH60o2FgIxavuNVRqmRDMdOh9qtrBBiNYgBFhyLU=; b=OvS3XzUeqCq0mNGQNtaE4Ejck9dmSy99AcH/wbfjgdnMvvWmB1xp5/2wYXh+wEDaJn6qIV BjnUDOQK/2sTwTVApc+T99ATAzKN02HfNeyc0ytI06skA1pSoD62YJoSjlnI97h4X3ocXR w+i6XK8X42iRSJZRTjszw9Fei3L1rgWRRwCw5+Ie96i48W3fmoTW6Z671lRxyJGUsTjB7D 2YYjCEEXwYSQiefGW6TAavZNy8fTgZJsof6S35DWHtV3C15w3AnXMaxSJjg3Kamz5inhpN NQax0hEzsDPe3n2awoqXs6S3kYsnH5D9N9S5oYb+wOw0W/Pw3Lix+BTf+cxf5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683030127; a=rsa-sha256; cv=none; b=L+gLs/TbQKQsWz/FqNCABQARZav8OvIrMi806HuS/YwVnkEmbPumJ8rCMgMnWBIt4bwIbM CI89qnwcrFzuaso4S89fXTbBkep3WauzbBjHSXraljaw6Nw5Son1JvmXfvZvneLLmtIbdx DsF7GcQRKnRLF515M7kBIpL9jlB5iWmfpg1NSQ/gm5kXwr1KycS/WiK0Q7HCm6rRSDsySs ZES61LStNqCziHIM6pohkcgfJtqRIKOsE/dlG1NIWGXDjxGU0X69GJpBW1plA8JycmQLLl C0nKW42P00UgO7i3PJO428lu3AD5vHXbb5xgmPy4SwF0288qw2+i4ftgrG9I5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9fMz2kBwzn6y; Tue, 2 May 2023 12:22:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 342CM7XP073147; Tue, 2 May 2023 12:22:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342CM7DA073146; Tue, 2 May 2023 12:22:07 GMT (envelope-from git) Date: Tue, 2 May 2023 12:22:07 GMT Message-Id: <202305021222.342CM7DA073146@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 834fdebb56fb - stable/13 - mpr: don't use hardcoded value in debug branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 834fdebb56fbf9ae111f5da91683fea5ddcebe08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=834fdebb56fbf9ae111f5da91683fea5ddcebe08 commit 834fdebb56fbf9ae111f5da91683fea5ddcebe08 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:57:38 +0000 Commit: Mariusz Zaborski 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));