From patchwork Mon Jul 12 15:59:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 473134 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp3071496jao; Mon, 12 Jul 2021 08:59:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzDnZ54yQonyN32JNA+BBb5Bx6wDEOfl6BJb/MLOO3jYtDGCzG5r9+jZ3BCjReggi4M5Ek X-Received: by 2002:a67:e8cf:: with SMTP id y15mr6388180vsn.47.1626105585560; Mon, 12 Jul 2021 08:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626105585; cv=none; d=google.com; s=arc-20160816; b=l+Z8Am/biYQDX7bsiC+F4S+bBX15QAWkMNApTAN5mwqU3UnbIq2RzAM8+UwiCgPwTt Vcnr7cFjBP0Nb8/qvOgUh0rE3+kn4aMrY5Mx9nh+IbVQDglGGBNTrhdyllL95wd1EjlP XuZXXPuX+KTOjrleBR/BQ5D08rK6aSxTMr8CmOIFg7Nza6etJBgWx5dtc3uGYuE62UP7 BW/vkvpwFqDHPIU2td3cLcf0+6PBDIIpBXKBhe/G0rdZEjLAZBwdTrSOdwBuHWKBR0tl lj/tf7mQgaztQf7kyYOMw8G3L3cgeNUveFcy/Jy1OEci71V5wBrOUdmHSvUianODQ/pG DHGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=L/58asou9sVz0CWQlJ3eJYnasOlqmgcxUQzFR2mZ0sk=; b=vMCHBTMfh1y/57T5+mhoZUMTt4mmnK9eIhqpkYQY2GycMUvYM+bebYX0pPhnGyqSqi 1QQeWFro4j9PhPyHR/ix9SpCbRA5d/jhapw2vX0eFy1d4u0yYAqflM8IjeihJnnystBR sOV7Ltsyr6rdTNozNd1X4jUhggrMdVakTKVpaWI/kBqh/tC/RAqMqxYHjSsRFiKgReaw E8FYjCEbD7hjKJxg6OVr1JmgZKtQ/ZvMp1pvc8hz8ROmGsUxBFqHDx28ZgvXf2XLOL9x Ih3Z093pUD2tyuPE3kusGEeDWN5tM/aHvCqYbFthdw3PKpDc4QvAWxH28CaxyLyyfvdg +Rhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Rr4l8Pq0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d125si12692093vkf.26.2021.07.12.08.59.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jul 2021 08:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Rr4l8Pq0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2yLQ-0000Ro-U9 for patch@linaro.org; Mon, 12 Jul 2021 11:59:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2yL5-0000MS-Ms for qemu-devel@nongnu.org; Mon, 12 Jul 2021 11:59:27 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:39605) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2yL4-00074i-4F for qemu-devel@nongnu.org; Mon, 12 Jul 2021 11:59:23 -0400 Received: by mail-pg1-x52d.google.com with SMTP id a2so18711313pgi.6 for ; Mon, 12 Jul 2021 08:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L/58asou9sVz0CWQlJ3eJYnasOlqmgcxUQzFR2mZ0sk=; b=Rr4l8Pq0Fru7J1aM6DENrUZ3knxuIUnxPuYfR+bOhE9P5T44c+aIwtoNyGvqJE+K4c ZDXFGVrHPHJf34K9PqfxXNv7U9+KQjJEtqVyTl1IFYOglKuhH6YKKLM8sii4YOrphBL/ 4nG4ne69zYgkwRKErlSmkWw04nQYoq5U+19I5R6TDH62+QjdbwBN6C5cMcQR7TPQgNlf TUC0oOta5NMOtm72W/TXcl1zeoRGey8HPuUcBnuPbK/dZlwHGoyUAfC0gWA3RPAG2Qd2 5Qt8+MmAbkKZ0+/W3+diOw7S92G7Q59uLu7IhMFPra30XY3TjnVYYHP//qLKKNuqy/aw gqEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L/58asou9sVz0CWQlJ3eJYnasOlqmgcxUQzFR2mZ0sk=; b=VGJDp/yT1DNfypaCufVWRCwnd6LdLx6GWAzbtlSzUb/iLxW6DdE6aI1M1Ij6NFlLYU qOPCkVn48PuccycLqIhgjtpU3m2XBySnHW8ihU173LfPUCXNvN39ewF4nt9QjxFNxHam Wi9V+Gv4fJXVbp3gIxWfuVMhPuxEIKsiHrcpD8SueqL7/oCO7foKMqxlK7oTJXLHQycO JgKSAn/NgBT9kSyPsAW4tAom4pJ5v+iJH1YYd3c0/kFjfg3R7/oc5/MfQMFLe0LX9fan uJ31LIJwAwd8I/CaMDlh6c7u2mFQ1YSw5jIOfjxz0qJiZ+g6uA3BmFT5VZVbWK9VMXUu zn+w== X-Gm-Message-State: AOAM532NfYUMp8G8Pzr8pl2NoFFjTR3kfTSqVk54RXF6A7dihiigskk+ pbKgL0+tAkMoYFb2fDSy5Gs8XDomCkWP7w== X-Received: by 2002:a05:6a00:2403:b029:309:8a37:2d51 with SMTP id z3-20020a056a002403b02903098a372d51mr54062484pfh.79.1626105560566; Mon, 12 Jul 2021 08:59:20 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id j16sm16745021pfi.165.2021.07.12.08.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 08:59:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/3] qemu/atomic: Use macros for CONFIG_ATOMIC64 Date: Mon, 12 Jul 2021 08:59:17 -0700 Message-Id: <20210712155918.1422519-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210712155918.1422519-1-richard.henderson@linaro.org> References: <20210712155918.1422519-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, pbonzini@redhat.com, crobinso@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Clang warnings about questionable atomic usage get localized to the inline function in atomic.h. By using a macro, we get the full traceback to the original use that caused the warning. Signed-off-by: Richard Henderson --- include/qemu/atomic.h | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) -- 2.25.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index c5d6df6bf8..bf89855209 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -273,26 +273,11 @@ /* Abstractions to access atomically (i.e. "once") i64/u64 variables */ #ifdef CONFIG_ATOMIC64 -static inline int64_t qatomic_read_i64(const int64_t *ptr) -{ - /* use __nocheck because sizeof(void *) might be < sizeof(u64) */ - return qatomic_read__nocheck(ptr); -} - -static inline uint64_t qatomic_read_u64(const uint64_t *ptr) -{ - return qatomic_read__nocheck(ptr); -} - -static inline void qatomic_set_i64(int64_t *ptr, int64_t val) -{ - qatomic_set__nocheck(ptr, val); -} - -static inline void qatomic_set_u64(uint64_t *ptr, uint64_t val) -{ - qatomic_set__nocheck(ptr, val); -} +/* Use __nocheck because sizeof(void *) might be < sizeof(u64) */ +#define qatomic_read_i64 qatomic_read__nocheck +#define qatomic_read_u64 qatomic_read__nocheck +#define qatomic_set_i64 qatomic_set__nocheck +#define qatomic_set_u64 qatomic_set__nocheck static inline void qatomic64_init(void) {