From nobody Mon Jun 26 12:08:34 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 4QqRSy4Y4Fz4k6dN; Mon, 26 Jun 2023 12:08:34 +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 4QqRSy3dwxz3j83; Mon, 26 Jun 2023 12:08:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687781314; 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=KdaL9ggY6b7u5YNbDqO+9fTNCpG5vqvktqfkO9wGQ14=; b=mAKPd+pMWUnAWl0hPIUv5DJu7Fc32V4Gzlt5IPgnMZ95XP9y7h9Hxs/0peGykfDvkafmVh AmyIlinM8CIHH/EIRHJyOzbdVx9k7fADDfw4mxy2VzLLCV8PTAkyxMZIpksdioAoUDmG4M G4vtZPFLEliScHyBI/RNhUP7nVtogRNZa7fqeCbQNDOb+4pZk4/yM8inj4gSIDadaWzO7W 9m/mbK8AOgIZkdOmgAKq0dk38FXozQ7V4eRCBS1DzmYgDLIyIZLK6DNLHYb5Nw+akWu1+n xY68Nrc+/vXK3S+PjJ+Abs/al5iCQpG2wSpooh6fDdhPvpwceQ0I25BSgK8ZvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687781314; 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=KdaL9ggY6b7u5YNbDqO+9fTNCpG5vqvktqfkO9wGQ14=; b=Vw0Z0kZBRovkea7sRdkZ87H5vgyaFEV1oXuG/HBfCHE6z/yCT87i10NP/tTwpcEAkvsCjb auHqHx5iY09KHgm+UgWoD+YpVSi2NAac2h+qvPkwnXjHpv5ZLXePYNkwzJvkz+9xoyp6eX i3xKJnQbH8UyyurntHmEKliHBIa4Lnsq0wOJMOfJnRcDYgO/kDSpJeiUbA2Ow86vqNFyao 5IORFQS9PpZiSj4dbuS1ZxzKMAFV3wG2cWs2hrV1ygGnUjHt0hOuvLE5xGlh9Dhlybv0Km tofhhDGOPHbl9z44MDiQE90CPdR8WWz103IxOyowgfMzzf3HceXMoFKt9vIe+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687781314; a=rsa-sha256; cv=none; b=IS1/BoNsIyysLqUiLgR9XmnXKC6dbgvoY0LL+f8LITsldClgUjZf9i3YMw3E2f1mck6xb7 c9gQdmtaLOjVcj8NNlMYEAvEOOjdYvc4YPNDAd6KVU6x9ZnpEeDBEMnf9S1/FV/PhO/aNl 0YiCjW4d8MrRVSR+ZihKcHx7RGnZbix8hiZyEXEH/yzoKmmOdmDyl2BELoAUC09iuFTZ1e PFT5867SZ7lJjYpwFHsuHn8gIMXxVCOkKcUP6uSGeI4S59SLqQMwDnNmbdZAuPXfPGsvu8 JjJtOd2vsEeGhoyTZd7W2kXqD5iVVhNNAaH9Zg81MnIkkwX3OJ0bP7E9RrG4Dw== 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 4QqRSy2YqSz18RP; Mon, 26 Jun 2023 12:08:34 +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 35QC8Y0E083046; Mon, 26 Jun 2023 12:08:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35QC8YmQ083045; Mon, 26 Jun 2023 12:08:34 GMT (envelope-from git) Date: Mon, 26 Jun 2023 12:08:34 GMT Message-Id: <202306261208.35QC8YmQ083045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 584bd868b4e4 - stable/13 - LinuxKPI: fix WRITE_ONCE() 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 584bd868b4e41ae909fa0a51bc969be567272427 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=584bd868b4e41ae909fa0a51bc969be567272427 commit 584bd868b4e41ae909fa0a51bc969be567272427 Author: Bjoern A. Zeeb AuthorDate: 2023-05-13 15:17:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-06-26 09:11:49 +0000 LinuxKPI: fix WRITE_ONCE() Fix a gcc warning: "to be safe all intermediate pointers in cast from '...' to '...' must be 'const' qualified [-Wcast-qual]". Doing what is essentially a __DECONST() adding the uintptr_t gets rid of the massive amount of warnings we get in LinuxKPI and lets us see the actual problems a lot better. This is a follow-up to 74e908b3c63b28de1d590dc42502fbe959a6da2e which fixed READ_ONCE(). Sponsored by: The FreeBSD Foundation Suggested by: jhb Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D40084 (cherry picked from commit 046d8d89ed1956944b12ec4f0580c30bc202bbfb) --- sys/compat/linuxkpi/common/include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index 801618e15f9f..a918b6b76371 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -91,7 +91,7 @@ #define WRITE_ONCE(x,v) do { \ barrier(); \ - ACCESS_ONCE(x) = (v); \ + (*(volatile __typeof(x) *)(uintptr_t)&(x)) = (v); \ barrier(); \ } while (0)