From nobody Fri Nov 11 18:37:04 2022 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 4N86r06sRrz4dbtJ; Fri, 11 Nov 2022 18:37:04 +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 4N86r059vdz3wkP; Fri, 11 Nov 2022 18:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668191824; 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=+6ge/LwrIfKZPJs6y0X1OViiakX46jjrcwUm9N08rEA=; b=RehBCKLw2sKy2pI/wM3pH4rs+V6T3RZLkPuUyrxzeX1jpD/yw54vhJSYReGH8INRirEl3t VMyCbK6OGsFC4C0++96Y91ADm2629ehRbfJvOgxJT6Ir2frCbeB41vHy/nie0WVJkP/70n oJ02ykx0ZVgxmS5a8BPxhYz1J62Z4kIthd4CjkxqWKo4etBfeg+KHNSodtOPAgCtT2AsBE nPoJHE+Z9aaSDa0/DIKOugKxrBWxRMqzmCZcWVHtVV7E2vqwPUN48WbSK+a9R7BbJ9F0qv x03lZcV/1XeRwf8O2RmAuS0YtvYDb7iorGBCj2IA6PMl5FGcxa8k7k0FDl29rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668191824; 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=+6ge/LwrIfKZPJs6y0X1OViiakX46jjrcwUm9N08rEA=; b=fxImEqhwYaKrJxT5prYKchb+Gy1/KM8yawv0HQDz0WLbSXwv1y412GJLzdTfF/taGabYkR 0a4Ma2XbSB9+bEvAEx5OPvn4pN4rLrp7XTW63hPWjXU3RcMUu7zrMOInfpJf98cmH+RI4V 7+/R/pjudlCG+KYuib8205cWhj6MMvvlZOndHTemlOu6NuRyQTFqh9d8y7PE3ZNxL3BMTK 3+NZhcra+MIdhc65szXIlGfdIkYc+w/0HKLweSrwy9K+WF3QMj9gmL4YXdTAy/Ma2siS9+ wU9aaeQ1+Qnv0jE+zYpEn+82oamLZmGoqo+QkJ/XhpOIP57bIJKuv0g/3S0Edw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668191824; a=rsa-sha256; cv=none; b=g03IWAWorMG5VIcFG/Liw5kxizgo/i8Q6+WnLTtPqzep6e36fX5DtPyr0KkBkXwNuSgQDP i1nSEiouo8SleoZrrzuPi5Con/ZdRQukuhjr8ITIxVf0SFMaHKwFDZs5w8QWHbOyORrvmD Q27ncxFyv2IiaYkbtGQbyO/haWXYuH+2W5Eguat5H8JltYHDF2VMH096NnnxYtwjZd04f7 ZXn2tjMeIvXcUkejmS9EbO4JODbZd/RRTeHWvZnRpZBcUh43D32MyjoQVYfdY1LWr7fIfJ A/N/SGQ1uLLTwXz0KTj2d4kQhQBQWem/U0NGsuVYd0N+UFsaZO6OotQG0J1VLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N86r04GcCzt2w; Fri, 11 Nov 2022 18:37:04 +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 2ABIb4Xx004445; Fri, 11 Nov 2022 18:37:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ABIb4F3004444; Fri, 11 Nov 2022 18:37:04 GMT (envelope-from git) Date: Fri, 11 Nov 2022 18:37:04 GMT Message-Id: <202211111837.2ABIb4F3004444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 587ab8e01930 - stable/13 - msk: Use a void cast to mark values of dummy reads as unused. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 587ab8e01930bb7196f55227cec263827165fc3f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=587ab8e01930bb7196f55227cec263827165fc3f commit 587ab8e01930bb7196f55227cec263827165fc3f Author: John Baldwin AuthorDate: 2022-10-05 23:46:01 +0000 Commit: John Baldwin CommitDate: 2022-11-11 18:18:54 +0000 msk: Use a void cast to mark values of dummy reads as unused. Note that this required adding missing ()'s around the outermost level of MSK_READ_MIB*. Otherwise, the void cast was only applied to the first register read. This also meant that MSK_READ_MIB64 was pretty broken as the uint64_t cast only applied to the first 16-bit register read in each MSK_READ_MIB32 invocation and the 32-bit shift was only applied to the second register read of the pair. Reviewed by: imp, emaste Reported by: GCC -Wunused-value Differential Revision: https://reviews.freebsd.org/D36777 (cherry picked from commit ae70e8838c6673850098530f23ce1521328f983c) --- sys/dev/msk/if_msk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 729d8383e9c1..857cfb9a0975 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -4301,11 +4301,11 @@ msk_stop(struct msk_if_softc *sc_if) * lower 16 bits should be the last operation. */ #define MSK_READ_MIB32(x, y) \ - (((uint32_t)GMAC_READ_2(sc, x, (y) + 4)) << 16) + \ - (uint32_t)GMAC_READ_2(sc, x, y) + ((((uint32_t)GMAC_READ_2(sc, x, (y) + 4)) << 16) + \ + (uint32_t)GMAC_READ_2(sc, x, y)) #define MSK_READ_MIB64(x, y) \ - (((uint64_t)MSK_READ_MIB32(x, (y) + 8)) << 32) + \ - (uint64_t)MSK_READ_MIB32(x, y) + ((((uint64_t)MSK_READ_MIB32(x, (y) + 8)) << 32) + \ + (uint64_t)MSK_READ_MIB32(x, y)) static void msk_stats_clear(struct msk_if_softc *sc_if) @@ -4322,7 +4322,7 @@ msk_stats_clear(struct msk_if_softc *sc_if) GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac | GM_PAR_MIB_CLR); /* Read all MIB Counters with Clear Mode set. */ for (i = GM_RXF_UC_OK; i <= GM_TXE_FIFO_UR; i += sizeof(uint32_t)) - MSK_READ_MIB32(sc_if->msk_port, i); + (void)MSK_READ_MIB32(sc_if->msk_port, i); /* Clear MIB Clear Counter Mode. */ gmac &= ~GM_PAR_MIB_CLR; GMAC_WRITE_2(sc, sc_if->msk_port, GM_PHY_ADDR, gmac);