From patchwork Wed Jul 27 15:32:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xenia Ragiadakou X-Patchwork-Id: 12930477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 896F5C3F6B0 for ; Wed, 27 Jul 2022 15:33:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.376267.608922 (Exim 4.92) (envelope-from ) id 1oGj2F-0000h9-4l; Wed, 27 Jul 2022 15:33:19 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 376267.608922; Wed, 27 Jul 2022 15:33:19 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oGj2F-0000h2-27; Wed, 27 Jul 2022 15:33:19 +0000 Received: by outflank-mailman (input) for mailman id 376267; Wed, 27 Jul 2022 15:33:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oGj2D-0000Po-13 for xen-devel@lists.xenproject.org; Wed, 27 Jul 2022 15:33:17 +0000 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [2a00:1450:4864:20::636]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6f0def9f-0dc1-11ed-bd2d-47488cf2e6aa; Wed, 27 Jul 2022 17:33:16 +0200 (CEST) Received: by mail-ej1-x636.google.com with SMTP id mf4so32169323ejc.3 for ; Wed, 27 Jul 2022 08:33:16 -0700 (PDT) Received: from uni.router.wind (adsl-141.176.58.226.tellas.gr. [176.58.226.141]) by smtp.googlemail.com with ESMTPSA id ev6-20020a056402540600b0043af8007e7fsm10260725edb.3.2022.07.27.08.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 08:33:14 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6f0def9f-0dc1-11ed-bd2d-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gsFJdYQm5IaUi4s94A+NUxnT5djgg725ifru2jn4FWk=; b=c20B698felpQIJIxGetf7JzxzaPCF8irPc7bB7io8OzCIjHtZqWwSuoRBXzgmn5mH8 ZEoJX0vVNKqQqhmh1qrJqLQYzOfxfg+bWG5iZTFtaUoLHzFNChNRYcsFg9RKsOphAVHW tBLHY3yLeMxzClv11hNOwicB59rK8t0QIUHEDSJTAe/Su0dOMkfHcoiw6/ECjxRk0Ypj 7tM0f7CGdiWhXI03hOdqM3xheKk9rDfKs/rqCtN++pQmpINnsAlO2wufBoM5EcjQ8LJf 7r8BFAJa4Vu2s+aBDzDky+66+d6XK2aQMoq8F1vi/kgGJzFnFdfGkHJy9rSe+CXPxhQF FZqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gsFJdYQm5IaUi4s94A+NUxnT5djgg725ifru2jn4FWk=; b=Pe/6s1s/3f66ckRRbb09LqF2v/eq5lF87cuVhLBGSw6p9bnWkehQSdGTrus1qZtvMx 0MbSqx3qYfjjVd8OSuE3tA4OQ8AKN31+eJeirdbe3s+JAb0ajaRkSISDCoEpKI4KxRJi Ao4KKOBpNL7g1k+f8/rNY8nni8ScqQWTLqNbekSJfwbRYBUWLf432if542alvTFYuD05 Vke7hVddNKQMkh0jwQnmTpoTI0dB/HWvQFcgG6Ak29K4gN4wNC8kDgv6Fi6cPmI/83jP YErJeJGT3stm00Q2O0+55goVdNajHo37UJDNJ5HaEWmWN0jcD1tc7t9DDz4E6Mqana4G sBSw== X-Gm-Message-State: AJIora+MarMGQDCpemsCXE4EgFqbp+5BW3t1TzFgjk2ZWd4bowr295eu yth95xm/0/lDfW5kzJLwzh6eKTobNl4= X-Google-Smtp-Source: AGRyM1s5sEijfF2Y3L1wOME2jcsEw0+NDBPvAcEid4NnSHaVd4In3G51ouPUr/OyVJNtPPtcAJ92UQ== X-Received: by 2002:a17:906:847c:b0:72b:4188:f940 with SMTP id hx28-20020a170906847c00b0072b4188f940mr18251339ejc.552.1658935995255; Wed, 27 Jul 2022 08:33:15 -0700 (PDT) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH 1/2] xen/arm: asm/atomic.h: Fix MISRA C 2012 Rule 20.7 violation Date: Wed, 27 Jul 2022 18:32:53 +0300 Message-Id: <20220727153254.1143503-2-burzalodowa@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220727153254.1143503-1-burzalodowa@gmail.com> References: <20220727153254.1143503-1-burzalodowa@gmail.com> MIME-Version: 1.0 The macro parameter 'p' is used as an expression and needs to be enclosed in parentheses. Signed-off-by: Xenia Ragiadakou --- xen/arch/arm/include/asm/atomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/include/asm/atomic.h b/xen/arch/arm/include/asm/atomic.h index ac2798d095..f5ef744b4b 100644 --- a/xen/arch/arm/include/asm/atomic.h +++ b/xen/arch/arm/include/asm/atomic.h @@ -123,15 +123,15 @@ static always_inline void write_atomic_size(volatile void *p, } #define read_atomic(p) ({ \ - union { typeof(*p) val; char c[0]; } x_; \ - read_atomic_size(p, x_.c, sizeof(*p)); \ + union { typeof(*(p)) val; char c[0]; } x_; \ + read_atomic_size((p), x_.c, sizeof(*(p))); \ x_.val; \ }) #define write_atomic(p, x) \ do { \ - typeof(*p) x_ = (x); \ - write_atomic_size(p, &x_, sizeof(*p)); \ + typeof(*(p)) x_ = (x); \ + write_atomic_size((p), &x_, sizeof(*(p))); \ } while ( false ) #define add_sized(p, x) ({ \