From patchwork Tue Nov 1 14:33:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 9407481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 110DD60585 for ; Tue, 1 Nov 2016 14:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE96E29951 for ; Tue, 1 Nov 2016 14:33:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E346529953; Tue, 1 Nov 2016 14:33:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8E91B29951 for ; Tue, 1 Nov 2016 14:33:52 +0000 (UTC) Received: from localhost ([::1]:48235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1a8N-0005jK-Ej for patchwork-qemu-devel@patchwork.kernel.org; Tue, 01 Nov 2016 10:33:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1a7y-0005hB-NP for qemu-devel@nongnu.org; Tue, 01 Nov 2016 10:33:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1a7v-0003J9-MH for qemu-devel@nongnu.org; Tue, 01 Nov 2016 10:33:26 -0400 Received: from mail-yw0-x242.google.com ([2607:f8b0:4002:c05::242]:33414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1a7v-0003Iw-GS for qemu-devel@nongnu.org; Tue, 01 Nov 2016 10:33:23 -0400 Received: by mail-yw0-x242.google.com with SMTP id s68so1094983ywg.0 for ; Tue, 01 Nov 2016 07:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=vC+j44MePBrWBSj1yA1f+9Esw4DDZcTwyTU6VuJrcdE=; b=hS48Z4lI3t3oFUlvfdhmFc4n4sPlzLm9GM0U+qoR53MK1nIfR4ejY4SlFS0Szhnlmu 4JfTprzkPFqKZiLVbd/NQ/gimMg5L/eEw5kQd2jjAM+km05Nj9p1UjBeAiHEkJWgY7v0 xxFBVXGziCgsVyXqVjeb4k3sk4fEXQhgS57Jf1y+eC3Q2uDsK45f8WfUu2D9lLfBDvsl IPHNS0BvqKtF8bvQHUPRespOyMH8QAJ5kX83SnWiKHWLLIyKXK2BCJD6NwUMG9ilJyjp kjw9NSeG9CJ5DxdRzdahHS0vtfuNKradsQ1vcYJWLQJ1Lrg2lSwKSQFgi+pd7Rs/nDfx kX9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=vC+j44MePBrWBSj1yA1f+9Esw4DDZcTwyTU6VuJrcdE=; b=M9KC42/r+52h7YCxd16y0VIIU3aqf/+u1SaAYYy44hgKtis41uKf01LveLjVwVppVC ucZBveR17wKPbUfD9PYfYFMUq9VyG0oR1lw8+zzvthR+GUYwNLR9aHQp/Z8iVRcX/IyA 9EuF8Di1M1qR8jj8Ful3ccGVGvxvZF9IPYIc6pUVi40X69gknE8c9DiGKGI5UpUMTWf/ gaTSDRzVOA4tBs9ct8Cz6LuiD5fboDZJuOFXm76M80Pb4mp9yFMKKQtpwFWglvh+BXdv bapuDS0tAkoVuuXHpajODyJ2KDARaTwkYEEvAyDV/q1vstiCZBuauM6UT7q8eIYNUuLH 8bwQ== X-Gm-Message-State: ABUngvdAla8UaDQCIUsjet64pKv1EtQfGkadZJjoUTiCcACZudM99X2RKarZTsUbCnJbIw== X-Received: by 10.13.217.9 with SMTP id b9mr3281214ywe.44.1478010802849; Tue, 01 Nov 2016 07:33:22 -0700 (PDT) Received: from localhost.localdomain (c-73-207-178-95.hsd1.ga.comcast.net. [73.207.178.95]) by smtp.gmail.com with ESMTPSA id t77sm9336862ywg.38.2016.11.01.07.33.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Nov 2016 07:33:22 -0700 (PDT) From: Pranith Kumar To: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org (open list:All patches CC here) Date: Tue, 1 Nov 2016 10:33:03 -0400 Message-Id: <20161101143303.19657-1-bobby.prani@gmail.com> X-Mailer: git-send-email 2.10.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c05::242 Subject: [Qemu-devel] [PATCH] atomic.h: Use __atomic_load_n() for acquire X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We can use __atomic_load_n() saving a store and load from the _val. Signed-off-by: Pranith Kumar --- include/qemu/atomic.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 878fa07..6775603 100644 --- a/include/qemu/atomic.h +++ b/include/qemu/atomic.h @@ -144,9 +144,7 @@ #define atomic_load_acquire(ptr) \ ({ \ QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \ - typeof_strip_qual(*ptr) _val; \ - __atomic_load(ptr, &_val, __ATOMIC_ACQUIRE); \ - _val; \ + __atomic_load_n(ptr, __ATOMIC_ACQUIRE); \ }) #define atomic_store_release(ptr, i) do { \