From patchwork Sat Jul 17 01:41:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 479218 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp1942019jao; Fri, 16 Jul 2021 18:41:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/z/ZuFf/iBJokt3sJLZCpz6PRNYlR+MfH2uO+3hxv57KpQLkyXvcmHnRUMpEzN6aejN4T X-Received: by 2002:ae9:f447:: with SMTP id z7mr6184049qkl.453.1626486099809; Fri, 16 Jul 2021 18:41:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626486099; cv=none; d=google.com; s=arc-20160816; b=EdkFB+oinmji9G+O78fo0xG2AKro7w10ujs/FyQovGbpVuRKXkIlL9LH3QC7Rtb12h HTExhhvOXouxb9TafzkoR7wYTIsjrgAuqiuYjzX/Os/g5DykMOj4RQj+TRmwqm15jpiJ LL0KcQVn+jFHgrBmSH4GUGQTElbj9Q5OsKb7AGFvG6XtOpIwrhjsnq+EDqrHDQlVx7HM KMDN/HWDcphe1t6TqxpusDR2eaConbzEQJuKDoRySTNQRa0JOcicMGJOyjOY9gJO/+S2 f13fwPxicA9lLr2fGAW3Sur7cOn24VfQlnv+L6jcZ9ZHNyAdUMBG+Z+AwW7VzGdSroNY hgvg== 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=hkNtyJzCYzqtjt8V71dL+rrY3uqGt0BkEX6PS4grnDc=; b=wDetn3PPG8PDAHmjMTiTsAzfgXaWsUUhOHGAq/o38lccPPv15px6iYmBWX3fIFPau/ uM4Y2+rzt+axnBgMA9aLum33qcSe0IKcUJHUcdqBo+RXK6ZLrnbMqaBziyBxu+0vwpig rHrC4F+4rQWzmX3q8elbUuaMIEnNOF5C7Pz949pWt86qyAcbUAegU4IZL2tnNLuwTd6r 1UNQoYMFL3AHQW7FD0TquBmRofSIrsHfoC4u4Kup9dPITSmrdkAbI3bXIe3KXMBFLDzZ fS65aQSqdWdYNi2PRgclEOWmpzNX3t68LT4Wee/toyT81/1qU3QXv4dKCO+H3MBuSKUk u8ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XGNLwTtP; 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 jo13si4672366qvb.11.2021.07.16.18.41.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Jul 2021 18:41:39 -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=XGNLwTtP; 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]:39318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4ZKl-0000qQ-4w for patch@linaro.org; Fri, 16 Jul 2021 21:41:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4ZKY-0000pF-Pv for qemu-devel@nongnu.org; Fri, 16 Jul 2021 21:41:26 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:34735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4ZKX-0000wZ-At for qemu-devel@nongnu.org; Fri, 16 Jul 2021 21:41:26 -0400 Received: by mail-pg1-x532.google.com with SMTP id 62so11745904pgf.1 for ; Fri, 16 Jul 2021 18:41:24 -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=hkNtyJzCYzqtjt8V71dL+rrY3uqGt0BkEX6PS4grnDc=; b=XGNLwTtPuQKhQjnLFPgi5T5c+4h19z61fglsJUzuHYQkXJ/v/IPsbDnsHUHrsWjsIW Sv69omc+ht0eowkh8ez0WAbZcmfps2zyuCI9q1YftymMnA2S5+sZpchjSGtedKCnylwh cnELDrOiqfnUSqYBPy8KG33smClUdjpAUoHLttU2Hp733klBhLOZDA/B2ZNdHVppH7lK rxPKRixdwESaNBI947O2nXqNaRrHrEqUm0ftAz34aaGBIb5tFwR80nFaNCCMECck7otH JCXPaOdTbpmnc5ZYQtrieVLJLkW6KvunUgP/6PqjQt1gGBiLXHVGET9TskQplWHCT27G c7Aw== 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=hkNtyJzCYzqtjt8V71dL+rrY3uqGt0BkEX6PS4grnDc=; b=F5TPn1XOhGGfYkvW9RlBEqIwGpdxGSZ0dYqbWNdUo9WpB1nXUGq7urPRKnCchusgme KG/A0zQwQKfwBKhKj+MPF8AlGqfpyEx57zhRRGCfaAB4HN1sZz7HAoe6nYx/FNqyNxU2 d3MGlFoFQj5CBJlpxEFAuL4yE1I8cwB7QNnyN5BRDEYYVvcnOYB1Lnx808+ozfWQEO+N D27BlbngAJ5CZ+wpjiKqYQv6dxjt+8l7VSuri0Es/i3HK/aiAdu+v5j24aSlB9xczPl+ lR33/Xm/liuqxmJmnt1BqKhWJpi8oym7xNrF9XnXSKen/W5NDss/yXBDAWunMcpeCe0A CgjA== X-Gm-Message-State: AOAM532e4c7ObuQ+iLbi1TdKTj8NJzBEZc3O/Jifw+zuALWwu5HuxpQp us8cct5dmuq1+tvSFhYoErOZANbWBUIXqQ== X-Received: by 2002:a63:1656:: with SMTP id 22mr12760416pgw.163.1626486084041; Fri, 16 Jul 2021 18:41:24 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id q18sm12812738pgj.8.2021.07.16.18.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jul 2021 18:41:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 01/11] qemu/atomic: Use macros for CONFIG_ATOMIC64 Date: Fri, 16 Jul 2021 18:41:11 -0700 Message-Id: <20210717014121.1784956-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210717014121.1784956-1-richard.henderson@linaro.org> References: <20210717014121.1784956-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) 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 3ccf84fd46..99d6030095 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -457,26 +457,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) {