From nobody Fri May 17 05:50:19 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=1675451402; cv=none; d=zohomail.com; s=zohoarc; b=h9wppVO+U9gbNOYZa6oLudHweCrREZusAhTXXF3AnL9nFhFb+5enXysbVdf63E7q10a9PPE25gf7KKMFVV8iWMRvwC8rPzBiE6xkWPiyWIoZuVLypg+IMv3UnMMwUf2fQbeKG+vR2+msjOl1Tv+VWNOuzLBfqzyXDvs8VEYWG5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675451402; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nf5jDFa5dOtO540IqofRXSKEY5a9ibf50gjNmqYzwIY=; b=HKxCFCtyl9pHJ2AG1Pq6UWdLBPZsO3uxMh9FDQcKfXtGe4/taCsDrmaAqFb70k9BcQBIBiejpNLJJ1G0Tj5kWEK5OxoqsDfVVOhi1aNg6xCjzm6QE3eVhsuyPH14nVHUtgtJCgQlZb/rOoTJMlp79QNT+b8dPmWXSyjCAkD1iaw= 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 1675451402489886.388993267158; Fri, 3 Feb 2023 11:10:02 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.489350.757716 (Exim 4.92) (envelope-from ) id 1pO1RC-000488-2c; Fri, 03 Feb 2023 19:09:30 +0000 Received: by outflank-mailman (output) from mailman id 489350.757716; Fri, 03 Feb 2023 19:09:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pO1RB-00047h-VD; Fri, 03 Feb 2023 19:09:29 +0000 Received: by outflank-mailman (input) for mailman id 489350; Fri, 03 Feb 2023 19:09:28 +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 1pO1RA-0003dr-E0 for xen-devel@lists.xenproject.org; Fri, 03 Feb 2023 19:09:28 +0000 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [2a00:1450:4864:20::52c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 45a10fd6-a3f6-11ed-93b5-47a8fe42b414; Fri, 03 Feb 2023 20:09:24 +0100 (CET) Received: by mail-ed1-x52c.google.com with SMTP id fi26so6132805edb.7 for ; Fri, 03 Feb 2023 11:09:24 -0800 (PST) Received: from uni.router.wind (adsl-160.109.242.226.tellas.gr. [109.242.226.160]) by smtp.googlemail.com with ESMTPSA id q24-20020aa7cc18000000b0049e19136c22sm1517393edt.95.2023.02.03.11.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 11:09:23 -0800 (PST) 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: 45a10fd6-a3f6-11ed-93b5-47a8fe42b414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nf5jDFa5dOtO540IqofRXSKEY5a9ibf50gjNmqYzwIY=; b=QbS8zg5lOalxJw1+0MhIyWOGsMVXvNY6/YzdygKPF1a7uZsFzpYYrwSEQPd+y3uGxf bu7paLwDkoMCv6Leq0WGdl0GHu6qq0lnyncDrwRE9dWgSVioIle0JCvCSdfMbOJRwxUm X8UGuF2NcaGqD5svJHGibr3z26ciQJ94hdrLwtCiKCf0fPxb55AJMo6crTN4oDwsWCth 0uzJUoJCU15ILyYqXnnFK+e33/bIu4janN34aTpZdD0IIf6h81LMLQMYIXuUQuqmCp/3 gqE84p5sJUo44k3AgXBoIm14O4vsXqLXr83EDceLeR2kH4T0t3c+3RkgHDan3UFo9EE1 H1eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nf5jDFa5dOtO540IqofRXSKEY5a9ibf50gjNmqYzwIY=; b=qGYmcbxZkccNLoCQn7fTSoVqvvraNkBhL3dfJTzY5PUusX6VtawVdkF8dzogK6dki9 xxnlGCEvvznbfasKBwjyNhZKe+WKUa1+MwyKyf4pxNhHlnov4jz5xEaCUjyZCVsueDVT JN5E2Qt5iGCu+jh9UKlqmj0xNiWlU59nJut0x1HpqjG4A3f6ccv9TtZrCCKJbtXZbXOj L8TagfGeWT0+n2AKdVUqCIV5p0DvxRsU7XFfsPZsH82YtEgLWgmaf/daPdkp9ttLXTJa afwgDRxCg6qVYZEUcOqxw6i56vNDYprNkRc6RJOjVXWvU6OOKQ4fnaL37ttZi7C+UuDJ +fgA== X-Gm-Message-State: AO0yUKXHT6oalDV8e9XvVCcEWIeS6UpvD5MDCyWNL4odEfbtH13ZQkAO Z2sfeTurM5oUV7b8zWC+5QHo2ZnEe10= X-Google-Smtp-Source: AK7set8vZpdvQrfLeDqthMRygbp3lHm+1RJvh2Ij9g1JHs/lBRUhGNC4WAH5UNtiHjteRytANu9K1A== X-Received: by 2002:a05:6402:520e:b0:4a0:8ea1:cce with SMTP id s14-20020a056402520e00b004a08ea10ccemr14476060edd.25.1675451364002; Fri, 03 Feb 2023 11:09:24 -0800 (PST) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall Subject: [PATCH v3 1/2] xen/device_tree: fix Eclair findings for MISRA C 2012 Rule 20.7 Date: Fri, 3 Feb 2023 21:09:07 +0200 Message-Id: <20230203190908.211541-2-burzalodowa@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230203190908.211541-1-burzalodowa@gmail.com> References: <20230203190908.211541-1-burzalodowa@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675451403821100005 Content-Type: text/plain; charset="utf-8" Signed-off-by: Xenia Ragiadakou Reviewed-by: Luca Fancellu --- Changes in v3: - the fixes are based solely to Eclair findings (the tool has been adjusted to report only those violations that can result to a bug) - reflect this in the commit title xen/include/xen/device_tree.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index a28937d12ae8..7839a199e311 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -37,11 +37,11 @@ struct dt_device_match { const void *data; }; =20 -#define __DT_MATCH_PATH(p) .path =3D p -#define __DT_MATCH_TYPE(typ) .type =3D typ -#define __DT_MATCH_COMPATIBLE(compat) .compatible =3D compat +#define __DT_MATCH_PATH(p) .path =3D (p) +#define __DT_MATCH_TYPE(typ) .type =3D (typ) +#define __DT_MATCH_COMPATIBLE(compat) .compatible =3D (compat) #define __DT_MATCH_NOT_AVAILABLE() .not_available =3D 1 -#define __DT_MATCH_PROP(p) .prop =3D p +#define __DT_MATCH_PROP(p) .prop =3D (p) =20 #define DT_MATCH_PATH(p) { __DT_MATCH_PATH(p) } #define DT_MATCH_TYPE(typ) { __DT_MATCH_TYPE(typ) } @@ -226,13 +226,13 @@ dt_find_interrupt_controller(const struct dt_device_m= atch *matches); #define DT_ROOT_NODE_SIZE_CELLS_DEFAULT 1 =20 #define dt_for_each_property_node(dn, pp) \ - for ( pp =3D dn->properties; pp !=3D NULL; pp =3D pp->next ) + for ( pp =3D (dn)->properties; (pp) !=3D NULL; pp =3D (pp)->next ) =20 #define dt_for_each_device_node(dt, dn) \ - for ( dn =3D dt; dn !=3D NULL; dn =3D dn->allnext ) + for ( dn =3D dt; (dn) !=3D NULL; dn =3D (dn)->allnext ) =20 #define dt_for_each_child_node(dt, dn) \ - for ( dn =3D dt->child; dn !=3D NULL; dn =3D dn->sibling ) + for ( dn =3D (dt)->child; (dn) !=3D NULL; dn =3D (dn)->sibling ) =20 /* Helper to read a big number; size is in cells (not bytes) */ static inline u64 dt_read_number(const __be32 *cell, int size) --=20 2.37.2 From nobody Fri May 17 05:50:19 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=1675451401; cv=none; d=zohomail.com; s=zohoarc; b=nXNXpDqNc3Kwi99+2cR+e5DoYJMPJ3nHNEWDsjhGRvtwpcPPRf7PE9kXauidFI9ulZIoPX5JPkyR1UAmqmexWsr9CPgcL32ZsNZ5jmt2Ysy3eOMUOAF+NbAjs4mmjcliyP8RVbfpia86iPDw6CtRjR4ZcOTfjwYumdGcurFg034= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675451401; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u/53xjCm4StWok4GzCMBvVj8eVR215tSpVZLrSRkfJ0=; b=GwdcNtHj1J/kFgL7uEV5RrzSPaQyF3dHsK/06FWgwGtxAu/5UrdWbsCqpOda3A6SKHbXU5SUSiF5bfURjtncwRmlwVsKLxpi4ALRchfH5F3KQrbTvlzoaOurg6D37XYq1aYRqDdtt5UnPezbWYcrg04+L8H+NoDOl0sMxY0I0+k= 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 1675451401471790.6679157698333; Fri, 3 Feb 2023 11:10:01 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.489348.757693 (Exim 4.92) (envelope-from ) id 1pO1RA-0003eE-JJ; Fri, 03 Feb 2023 19:09:28 +0000 Received: by outflank-mailman (output) from mailman id 489348.757693; Fri, 03 Feb 2023 19:09:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pO1RA-0003e7-GW; Fri, 03 Feb 2023 19:09:28 +0000 Received: by outflank-mailman (input) for mailman id 489348; Fri, 03 Feb 2023 19:09:28 +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 1pO1RA-0003ds-4g for xen-devel@lists.xenproject.org; Fri, 03 Feb 2023 19:09:28 +0000 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [2a00:1450:4864:20::52c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 46dff81e-a3f6-11ed-933c-83870f6b2ba8; Fri, 03 Feb 2023 20:09:27 +0100 (CET) Received: by mail-ed1-x52c.google.com with SMTP id x7so6185780edr.0 for ; Fri, 03 Feb 2023 11:09:26 -0800 (PST) Received: from uni.router.wind (adsl-160.109.242.226.tellas.gr. [109.242.226.160]) by smtp.googlemail.com with ESMTPSA id q24-20020aa7cc18000000b0049e19136c22sm1517393edt.95.2023.02.03.11.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 11:09:25 -0800 (PST) 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: 46dff81e-a3f6-11ed-933c-83870f6b2ba8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u/53xjCm4StWok4GzCMBvVj8eVR215tSpVZLrSRkfJ0=; b=FQLirTlVFUjB+AQPp0y0vNUjzoF5Od//jXZK0/QFsa2lKmSla9/e/4CkSzlDziqz3D LzTNkPGiiVErGIrbvXPG6PTnuX2tb4ugi5KFg4I+KnFwQrSTKxUoi0a3mFJf32FfBHJn 3ANlqIEsmS+A4DmnTad3QB3LO4A47O7Fgplfct4BG1qCOJpR39aw4+UeFhRhEwnJhVcV ZeRngIVXF+P0qBzFaXkNU5M0CyfJwpmRBhHCRe+w4+E6wS8A7F1mtkCPq291pulfLYYK Q2V+puqeZotcLZb8YfaYONFcFBXsNKUKE7uZfGzbkWC7Gl9xlGOc5cWIFEaElqimefgY X2/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u/53xjCm4StWok4GzCMBvVj8eVR215tSpVZLrSRkfJ0=; b=qjJNp+u1xV9r/8xtHy04JPYUWyAjJucJ7YQO0yHVmF4Xez0L+mkEClO5RZaY+OeKTO 7WUHlnE+XipnEX9ajj0anTfxWwn1JBHlO7CpQhHmfF7N9eciMg5uvuiiGDP9yDCwsMcF XylijeXxkD4rOeXhjsmVaGbe3cnoilesFpruG5/DVAtHA/U0Tb9PgfPYkG6YuKBPFJHe v0UCtgumd2TGBdLGz2Uyic637u0xgFq+WOBG8jB3rVdC6NR7ZH8GjlY0GJ5rEZsYfnLi ibYlBNy5H4pQb3y+khQ0iR2DpISLZ1hTgQ6C7qKquAnfhG0vPPy/KX3pHjftSSEoZAfS OHPg== X-Gm-Message-State: AO0yUKWW4fsIHMkVFbZjv+0Io+bHVx5c9BdZF2hugAG8yev15828H9Zt hD/oTNAWIvcsNo8NIqautLAnym5pR9E= X-Google-Smtp-Source: AK7set9T2ERnS3b9g9ktqqYsjwHPVy/YdYunkxTUXH1aeyDSovnj456AsSqHC0+2XWBqsC+ZD357wg== X-Received: by 2002:aa7:c24f:0:b0:497:b6bc:b811 with SMTP id y15-20020aa7c24f000000b00497b6bcb811mr11466606edo.33.1675451365991; Fri, 03 Feb 2023 11:09:25 -0800 (PST) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall Subject: [PATCH v3 2/2] xen/device_tree: remove incorrect and unused dt_irq() and dt_irq_flags() macros Date: Fri, 3 Feb 2023 21:09:08 +0200 Message-Id: <20230203190908.211541-3-burzalodowa@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230203190908.211541-1-burzalodowa@gmail.com> References: <20230203190908.211541-1-burzalodowa@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1675451402024100003 Content-Type: text/plain; charset="utf-8" Macro dt_irq() is broken because the macro parameter has the same name with the struct dt_irq member "irq". Macro dt_irq_flags() is broken as well because struct dt_irq has no member named "flags". Since no one seems to have ever tried to use them and eventually stumble up= on the issues above, remove them instead of fixing them. Fixes: 886f34045bf0 ("xen/arm: Add helpers to retrieve an interrupt descrip= tion from the device tree") Signed-off-by: Xenia Ragiadakou Reviewed-by: Luca Fancellu --- Changes in v3: - new patch xen/include/xen/device_tree.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 7839a199e311..19a74909cece 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -159,9 +159,6 @@ struct dt_raw_irq { u32 specifier[DT_MAX_IRQ_SPEC]; }; =20 -#define dt_irq(irq) ((irq)->irq) -#define dt_irq_flags(irq) ((irq)->flags) - typedef int (*device_tree_node_func)(const void *fdt, int node, const char *name, int depth, u32 address_cells, u32 size_cells, --=20 2.37.2