From patchwork Wed Oct 11 14:31:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 9999781 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 B4E77602BF for ; Wed, 11 Oct 2017 14:31:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4494289F7 for ; Wed, 11 Oct 2017 14:31:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9944228A09; Wed, 11 Oct 2017 14:31: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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FB9728A04 for ; Wed, 11 Oct 2017 14:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751814AbdJKObv (ORCPT ); Wed, 11 Oct 2017 10:31:51 -0400 Received: from s3.sipsolutions.net ([144.76.63.242]:48818 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbdJKObv (ORCPT ); Wed, 11 Oct 2017 10:31:51 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1e2I34-0005BU-36; Wed, 11 Oct 2017 16:31:50 +0200 From: Johannes Berg To: backports@vger.kernel.org Cc: Johannes Berg Subject: [PATCH 4/5] backports: add OPTIMIZER_HIDE_VAR Date: Wed, 11 Oct 2017 16:31:46 +0200 Message-Id: <20171011143147.3337-4-johannes@sipsolutions.net> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171011143147.3337-1-johannes@sipsolutions.net> References: <20171011143147.3337-1-johannes@sipsolutions.net> Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Berg Signed-off-by: Johannes Berg --- backport/backport-include/linux/compiler-gccN.h | 4 ++++ backport/backport-include/linux/compiler.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/backport/backport-include/linux/compiler-gccN.h b/backport/backport-include/linux/compiler-gccN.h index 23ad803dce0b..97e7541d1ab1 100644 --- a/backport/backport-include/linux/compiler-gccN.h +++ b/backport/backport-include/linux/compiler-gccN.h @@ -120,3 +120,7 @@ #endif #endif /* gcc version >= 40000 specific checks */ + +#ifndef OPTIMIZER_HIDE_VAR +#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) +#endif diff --git a/backport/backport-include/linux/compiler.h b/backport/backport-include/linux/compiler.h index e5af565b13dc..53c069df10a8 100644 --- a/backport/backport-include/linux/compiler.h +++ b/backport/backport-include/linux/compiler.h @@ -88,4 +88,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s }) #endif +#ifndef OPTIMIZER_HIDE_VAR +#define OPTIMIZER_HIDE_VAR(var) barrier() +#endif + #endif /* __BACKPORT_LINUX_COMPILER_H */