From nobody Fri Apr 21 08:02:13 2023 X-Original-To: dev-commits-src-all@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 4Q2n794WH6z464cX; Fri, 21 Apr 2023 08:02:13 +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 4Q2n793zdkz47Rh; Fri, 21 Apr 2023 08:02:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682064133; 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=s//Qv4tFBsOFq6mjoHCjfH6yjUZDgfZKhdezerJjkPs=; b=PaE+nGcxcHPEp7UWLMhe64pmvY6gN+snTWq5/UeIt4oLDnod4Ve+0mdG3v3eZ7CXwwYHxO stmTReVGHsVdlb/ec7BqdkZJWyBgLBE0tD+iay1o5hSx3yrfI95p4u4YeIq4iiMqk24PwE zXez2JwwOUTEv855SIraOkd2ObXFol28K53t5R9T2PETVYrJeOBHRTfn9uYqZ97kWn155b 2RGUQKAHhdLS7DRd/Yy3evaAvdkLpI4jsaTdR4pGdQt0Vu2LHQ4b4oNXxgEyeXc5apKk7a bRUBvYXfkLEO8IfPeknS/HKSkPdeZDtGN5Ym+UYtNK2sBy44SBTb311PTp4JdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682064133; 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=s//Qv4tFBsOFq6mjoHCjfH6yjUZDgfZKhdezerJjkPs=; b=q4t098PFcCnRJJ++BwarRVquWidLrn08DJwRyMMTTx9lVVEMSSsTzbxQfMYDh2fmgYb9bF +bK31xEAxnoEtsaU97txGPO8+GXixQphS/uidkJWfSzo9/etbhJJzPLiaHEm4qhnxHZjD5 5vVfUjWk8qzQQ/jN5h84grqwys0npLqhvwlc4rmW1KfMipqQQe/zXgX7Hou5xv5/4YisGR Xv7h4dIs9altR3y4lCpZarrKzFgz/XVUZiPTDcCm4RMMrCOGnI3wo9Zz9qIdCPW6eCtH29 /tXmYbHKJjh1LcnojR/WrIwj6S4qKvaBilXnbbml5pXUMEp3jtC+VQcMyLI3Fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682064133; a=rsa-sha256; cv=none; b=LaLsaQ2XG+XeD8v2eT5hObxPrz9lTa/Ro9J1vlPFLPxYiZsxzyBvcEEA5j/BelG3SbnFgR fawiDqKYCNZ2Cf1vVybrYewQTxZQ4U0utZRgNkIMK7sJMlA5DILpWOtSfgF7pakEl8q6FG lEsamCLM48eJcvooXs+Q8gZSQ35CLizutnVLlP68dwGNou1sfYwDL+AeB6jCuHx4h4CX9C I6SEHaX8wPWirc0gfZFjvESvXyUD0wTZRcUA21F2GxzB5l0xi+7huYq758damcA7eBEnel l6Ul14twqUWSpHmE65x3zBMd5mbQmVI3VyeYvAFYApY/fNr9eGxsmjMRq+hhQw== 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 4Q2n7934dcz1Bb9; Fri, 21 Apr 2023 08:02:13 +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 33L82DEA009856; Fri, 21 Apr 2023 08:02:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33L82DVQ009855; Fri, 21 Apr 2023 08:02:13 GMT (envelope-from git) Date: Fri, 21 Apr 2023 08:02:13 GMT Message-Id: <202304210802.33L82DVQ009855@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: ea6597c38c77 - main - mpr: fix copying of event_mask List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: ea6597c38c77c7bfaae71259d8636cbb89add6a3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=ea6597c38c77c7bfaae71259d8636cbb89add6a3 commit ea6597c38c77c7bfaae71259d8636cbb89add6a3 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:50:16 +0000 Commit: Mariusz Zaborski CommitDate: 2023-04-21 08:01:38 +0000 mpr: fix copying of event_mask Before the commit 6cc44223cb6717795afdac4348bbe7e2a968a07d the field event_mask was fully copied to the EventMasks field. After this commit the event_mask (uint8_t) is 4 times casted to EventMask (uint32_t). Because of that 24 bits of each event_mask array is lost. This commits brings back simple copying of field, and after words converting 32 bits field to the requested endian. I don't think we need more sophisticated method, as the array is of size 4 (for 32 bits version). Reviewed by: imp MFC after: 1 week Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D39562 --- sys/dev/mpr/mpr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 8450ef9900b0..b9996806f213 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2764,8 +2764,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -2819,8 +2820,9 @@ mpr_reregister_events(struct mpr_softc *sc) bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL;