From nobody Wed May 8 19:32:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1660037489; cv=none; d=zohomail.com; s=zohoarc; b=kIJEV50IHk0PmO9no8T3a144b2wGtBAwUj2mzDgrv5LQ42qoZFwPPBig2+eAZ8Ul8GythKI8iHWO1CUmLNDTT1h/+Tg0pZTi+FiyT1sQhaKKT/FConxOwn+qxcog3x08BIIdVAy5BKzFnNNtcxugEIdr6l5Dfvs+zwBo2c8RTTo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660037489; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=GKf425hQpe0PuKB2CboK1V+rcOcRfhoh8GDez6kIN+s=; b=UHE7bdsVgIjrOTOgGNQk/h0F/OtWkzTpr6dMTSTj9e/O5z7ZxKyeRC32hA+EGuUEBm1V3taqJk3bGIXrXmVOxV2BdjIaHKkGmyF7M7kXfsj84TQNvxyo8L5su+IqY8XEDb2HEZLjOLjjyGgbjdRmSLpNWXhjTjlwehCXzfHRiu0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1660037489303420.5644788982203; Tue, 9 Aug 2022 02:31:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.382862.617907 (Exim 4.92) (envelope-from ) id 1oLLZm-0006Uo-Ig; Tue, 09 Aug 2022 09:31:02 +0000 Received: by outflank-mailman (output) from mailman id 382862.617907; Tue, 09 Aug 2022 09:31:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oLLZm-0006Uh-G0; Tue, 09 Aug 2022 09:31:02 +0000 Received: by outflank-mailman (input) for mailman id 382862; Tue, 09 Aug 2022 09:31:01 +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 1oLLZl-0006UY-Cg for xen-devel@lists.xenproject.org; Tue, 09 Aug 2022 09:31:01 +0000 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [2a00:1450:4864:20::533]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f9b4b0d3-17c5-11ed-bd2e-47488cf2e6aa; Tue, 09 Aug 2022 11:31:00 +0200 (CEST) Received: by mail-ed1-x533.google.com with SMTP id z2so14402955edc.1 for ; Tue, 09 Aug 2022 02:30:58 -0700 (PDT) Received: from uni.. ([2a02:587:ac16:4a00:ffbe:91df:428c:5448]) by smtp.googlemail.com with ESMTPSA id 14-20020a170906328e00b007308fab3eb7sm890025ejw.195.2022.08.09.02.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 02:30:57 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: f9b4b0d3-17c5-11ed-bd2e-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=GKf425hQpe0PuKB2CboK1V+rcOcRfhoh8GDez6kIN+s=; b=Uazp/VRgepPhK3ZjanepFrhaJzeQlZt9m6RQZqr2/r1soHMFRiJcGnoDOGJEixZTIG YQateJa7SnyEicp60liI4cdH19a5sTnn0NHBMzjPuTPqQW20k6SEQUKQMhW74U038kHz 86NVMEHSWZ9E05cD8S9j72TovMt/HnKprLbSf3rrY3KzRtom1kHw/2fgCZvh9DVbmq+J v5ZtMcq8DTQaQWmWIqktRgyWpdQttQGgwuhtKDYC82IrXciKKrcOszVLr+XUDTWBJDdn caTco++3oGs41wL9JRaCB0T9ZIzE5yif6bnxzVhT4mDYjGydCrRjfhktPabvPpjLjQsw +Ptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=GKf425hQpe0PuKB2CboK1V+rcOcRfhoh8GDez6kIN+s=; b=WlXC/b9WlUKabf2OkFv5RUbgTiQdLafIz8CvAa/PSkZZQO+0yJrrbCQz1lLZxw1bBJ xOZTlpJ2+K9MjDa9WrfniDrNICLw3UHSceB0kjhKR13gAxG1og8pswaKniP5DglDsO7D kiZ8R4secmFW6v6b/BWCJO8wpPU8lZzWfKvNvJfrH/7Tqe12QJ7oNcIfGLmyjn19jaEp KEQZjSJGgK4oFgRUExSm4qoQi1lIJezuPWQfo9xavT6szrEvA3hZy3Kr6CFZKWj90c3Q wuVj+bWdJ7WLoVX4oQe/G6eKOE110czJpyGZ/O60zoGsNXuBYdArbgqpxVII7cyr5i0L NiOQ== X-Gm-Message-State: ACgBeo027pRLPWnk5XWW+LpLIAZ+6yrXlE0mnuEnvOcrNsmsMNFII72q k2tq2+tYHO9AaMlrVKHJkuW972FijiI= X-Google-Smtp-Source: AA6agR4PcxieVKljj2LSYZb9hvlkouYZasC20AZdREBl+9zuPeFIijZ0BNfExWGz4VGgqziGGeMI6w== X-Received: by 2002:a05:6402:50c9:b0:43e:42b0:f84a with SMTP id h9-20020a05640250c900b0043e42b0f84amr20758381edb.72.1660037457829; Tue, 09 Aug 2022 02:30:57 -0700 (PDT) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH] xen/arm: vreg: Fix MISRA C 2012 Rule 20.7 violation Date: Tue, 9 Aug 2022 12:30:48 +0300 Message-Id: <20220809093048.1893025-1-burzalodowa@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1660037490622100001 Content-Type: text/plain; charset="utf-8" In VREG_REG_HELPERS(), the macro parameter 'offmask' is used as expression = and therefore it is good to be enclosed in parentheses to prevent against unintended expansions. Signed-off-by: Xenia Ragiadakou Reviewed-by: Stefano Stabellini --- xen/arch/arm/include/asm/vreg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/include/asm/vreg.h b/xen/arch/arm/include/asm/vre= g.h index fa2f4cdb17..f26a70d024 100644 --- a/xen/arch/arm/include/asm/vreg.h +++ b/xen/arch/arm/include/asm/vreg.h @@ -141,7 +141,7 @@ static inline void vreg_reg_clearbits(unsigned long *re= g, register_t bits, static inline register_t vreg_reg##sz##_extract(uint##sz##_t reg, \ const mmio_info_t *info)\ { \ - return vreg_reg_extract(reg, info->gpa & offmask, \ + return vreg_reg_extract(reg, info->gpa & (offmask), \ info->dabt.size); \ } \ \ @@ -151,7 +151,7 @@ static inline void vreg_reg##sz##_update(uint##sz##_t *= reg, \ { \ unsigned long tmp =3D *reg; \ \ - vreg_reg_update(&tmp, val, info->gpa & offmask, \ + vreg_reg_update(&tmp, val, info->gpa & (offmask), \ info->dabt.size); \ \ *reg =3D tmp; \ @@ -163,7 +163,7 @@ static inline void vreg_reg##sz##_setbits(uint##sz##_t = *reg, \ { \ unsigned long tmp =3D *reg; \ \ - vreg_reg_setbits(&tmp, bits, info->gpa & offmask, \ + vreg_reg_setbits(&tmp, bits, info->gpa & (offmask), \ info->dabt.size); \ \ *reg =3D tmp; \ @@ -175,7 +175,7 @@ static inline void vreg_reg##sz##_clearbits(uint##sz##_= t *reg, \ { \ unsigned long tmp =3D *reg; \ \ - vreg_reg_clearbits(&tmp, bits, info->gpa & offmask, \ + vreg_reg_clearbits(&tmp, bits, info->gpa & (offmask), \ info->dabt.size); \ \ *reg =3D tmp; \ --=20 2.34.1