From mboxrd@z Thu Jan 1 00:00:00 1970 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 31CD6C04A68 for ; Wed, 27 Jul 2022 16:18:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.376334.609033 (Exim 4.92) (envelope-from ) id 1oGjje-0003OK-CB; Wed, 27 Jul 2022 16:18:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 376334.609033; Wed, 27 Jul 2022 16:18:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oGjje-0003OB-97; Wed, 27 Jul 2022 16:18:10 +0000 Received: by outflank-mailman (input) for mailman id 376334; Wed, 27 Jul 2022 16:18:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oGjjc-0002ye-Kz for xen-devel@lists.xenproject.org; Wed, 27 Jul 2022 16:18:08 +0000 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [2a00:1450:4864:20::535]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b33cf3c1-0dc7-11ed-924f-1f966e50362f; Wed, 27 Jul 2022 18:18:08 +0200 (CEST) Received: by mail-ed1-x535.google.com with SMTP id f15so13611714edc.4 for ; Wed, 27 Jul 2022 09:18:07 -0700 (PDT) Received: from [192.168.1.93] (adsl-141.176.58.226.tellas.gr. [176.58.226.141]) by smtp.gmail.com with ESMTPSA id r9-20020a17090609c900b0072fd1e563e2sm4177577eje.177.2022.07.27.09.18.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Jul 2022 09:18:06 -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: b33cf3c1-0dc7-11ed-924f-1f966e50362f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=D6Z74H1QnjiAxJgRth53+k0Aaa8dEJYp3Z2ikE/yk6Q=; b=kuIik6nzwflLuzsmNH9WdUuUxFZNl46TgNoS2D+jqIkGMQhZQ41Dvi+HufCvOKEbJx fPzesN/MEY8j6dyajY3DnW4Z5X1Tl7HNwyY6f9VJgfFqRZAr0zSRNSLJXUPFYhFhvp1t aIgswFa9aBEWX+km+KtnCeTKlej32LThDz+HiJf5JKZkbdSQ5kV+0TYc55lqFA9Nl3Ro pfSGIygLqaaAw/XxcZTsGOBBnFWYfJ3vLRdRW0nwtiHvgnIWobQ+9sXKSbK7w3KxvRWG X/+NLN6yheLUD1glR2VZKRkZhyaFYWzD700ygrpGLl/CW0w7jNOTAywLFoNJUVMGdeHb f62Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=D6Z74H1QnjiAxJgRth53+k0Aaa8dEJYp3Z2ikE/yk6Q=; b=sV8LwRFDH1tffOvb5LOcP6ZhhM/9mP8ZbC1PhckYaiJM06yRKkJ2kNKkvGkEUtEaVU Pe2XxUTdb24jDnvV5htaZTLJgA99U0zMvbcbf6R7IuRqd46pcfOzBmOJ4OUHiD7ZHyt4 eiGLN13IaIl7pyHKaWzgkD+L6LS6xpzLrLF2vhvyRp0wMhNGT6VapEDUmD3V4FCCSIm7 f1ggQ2oejTHCfX8evY/oaPFHiBM7chpzcbZKK48cx4fthOw4WJjufmCcCs/wEpm9fpHc ExpTzkXbf0zUeYgdfWRTRrtGInNZ26uM76fL6Jq3oKvS5bvHNRlWAdeNP9tVzRgZXhNT 2f2w== X-Gm-Message-State: AJIora8GPCjbrRRXdXN81xzRa2CLrc13eYCZNEJsDdQ5R7J0P6pF9P7D AixLirx2whCi76XyzAzXH5E= X-Google-Smtp-Source: AGRyM1vgyhXRnZYWO+inoKaatYt2BGwiLbzpgQnXH4AQl+TX6/kiUoY+6pyn559NIypeLDlMGzogBw== X-Received: by 2002:a05:6402:1c01:b0:43a:f714:bcbe with SMTP id ck1-20020a0564021c0100b0043af714bcbemr23782567edb.14.1658938686980; Wed, 27 Jul 2022 09:18:06 -0700 (PDT) Message-ID: Date: Wed, 27 Jul 2022 19:18:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/2] xen/arm: asm/atomic.h: Fix MISRA C 2012 Rule 20.7 violation Content-Language: en-US To: Jan Beulich Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , xen-devel@lists.xenproject.org References: <20220727153254.1143503-1-burzalodowa@gmail.com> <20220727153254.1143503-2-burzalodowa@gmail.com> <9db28ce4-d4dd-3806-75c7-a6746d40cbb4@suse.com> From: Xenia Ragiadakou In-Reply-To: <9db28ce4-d4dd-3806-75c7-a6746d40cbb4@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Jan, On 7/27/22 18:36, Jan Beulich wrote: > On 27.07.2022 17:32, Xenia Ragiadakou wrote: >> The macro parameter 'p' is used as an expression and needs to be enclosed in >> parentheses. > > Yes, but ... > >> --- 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))); \ > > ... not in the first argument's case - that's not an expression. > Too few parentheses are a risk, but too many are as well, as they > negatively affect readability. > Yes you are right. Here write_atomic_size((p), &x_, sizeof(*(p))); as well. I will fix and resend. -- Xenia