From nobody Sun May 21 23:14:27 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 4QPbxw10XPz4Cc0l; Sun, 21 May 2023 23:14:28 +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 4QPbxv6JTQz3FXB; Sun, 21 May 2023 23:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684710867; 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=jeZfjF5oXhSdZ/Ixt+XHzh9U72xnB0ZokYAHsQJyZIk=; b=SYLTaTmJcxNPJpsF31R3PsGGx4rNRYP7Ksvt6fDn16ibTvWXW6IR7l1OUSU/TkPLHNv6z9 inZHzAPGAC8ZFhb6dUnbnfvIOJhIwiR6PcuQmwLbUrJkT20WCMoVaBJldyhcsNft1j2mbL zGMLFVF6R6RESQm9Gi+UFMssBbq6je0k35Q6RxhfRkefYt0Truu5G4lq0skwaligyX3kI8 72B8SHDHgatAenfFL1h1Ts8Ukg/nS/MR0nclNrWuA+CZ973ErPyiWH6b1FCvSQN047vamB ekrXaP4SWlB2ThreRBYfIjNSmroCv9hnWZpG7TqW/DKc4ABJl4ZQI+tAb7tuvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684710867; 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=jeZfjF5oXhSdZ/Ixt+XHzh9U72xnB0ZokYAHsQJyZIk=; b=ieUbnj6VhI/Y8vZukpp7xUxVQF3vQhsuiXELW+fwEr5rHyKTEBer16temYvMOVTHezhhBS Rn3Xo/YPwKxXdld1XVAreVcSlJR1WGjXvigZnihQChHXhISv4F6YFbblLPwNs3YP3Gxgtk WbfFUXV2pGXSNFK8uXAjgeh98AWDu8IQGxElSeIkzJZVHi7+cv/+1niitsWbIoL7asc1eG B8dBRR1gnas9Awjyji2Bpl6t5VPrS9x0uZmdrqZD7HrZUNHP18/p9517BxZZGyRD7XhMcz 0fb4rf8wahj3Mvn7D5oxQKda60tm4Ij3ukQcptFNnoUFP1NcLiwiuP/zF5PqfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684710867; a=rsa-sha256; cv=none; b=ZH3JJjirxzdSDZig0IpVd0WygLJsWvrdXCHX2UMxYtJj9WDVQ4bXDbUURotzfGdQH+njcn LMWuhQh3eKvhFE5qMVS+3lDetXe9JwsaUB00jO/i2VoV67AaY5ZNiyKXwBnvFULOHizBGx 8kTtA8f6Inv6hHkH/JsG66/NxmhhYBq2aZn4qJSOwii2GARuNgYVnaKCDds2vfFpUa6lOJ gX3IEU111vzRsucwC+265Q/LWGrWA/R0wvunaSRv8M07mxtdhp8mc6/BlVWjeZ8g0Ax8b6 KTD0BS8gUgjapJFNXwj7wx0UvAbEorPl/OLhF+mcetXaDxXQtphOEqi/Hbmu6g== 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 4QPbxv5Ltzz19Qy; Sun, 21 May 2023 23:14:27 +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 34LNERu9042021; Sun, 21 May 2023 23:14:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34LNER0S042020; Sun, 21 May 2023 23:14:27 GMT (envelope-from git) Date: Sun, 21 May 2023 23:14:27 GMT Message-Id: <202305212314.34LNER0S042020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 046d8d89ed19 - main - LinuxKPI: fix WRITE_ONCE(), remove ACCESS_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/main X-Git-Reftype: branch X-Git-Commit: 046d8d89ed1956944b12ec4f0580c30bc202bbfb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=046d8d89ed1956944b12ec4f0580c30bc202bbfb commit 046d8d89ed1956944b12ec4f0580c30bc202bbfb Author: Bjoern A. Zeeb AuthorDate: 2023-05-13 15:17:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-05-21 23:14:05 +0000 LinuxKPI: fix WRITE_ONCE(), remove ACCESS_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(). ACCESS_ONCE() seems to be an obsolete KPI these days in Linux and FreeBSD does not use it either directly so we can entirely remove it now. Sponsored by: The FreeBSD Foundation Suggested by: jhb Reviewed by: hselasky MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D40084 --- sys/compat/linuxkpi/common/include/linux/compiler.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index b2c835ad808d..323a583860b4 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -88,11 +88,9 @@ #define ___PASTE(a,b) a##b #define __PASTE(a,b) ___PASTE(a,b) -#define ACCESS_ONCE(x) (*(volatile __typeof(x) *)&(x)) - #define WRITE_ONCE(x,v) do { \ barrier(); \ - ACCESS_ONCE(x) = (v); \ + (*(volatile __typeof(x) *)(uintptr_t)&(x)) = (v); \ barrier(); \ } while (0)