From nobody Thu May 16 18:13:38 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; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1689949586602969.9882754705534; Fri, 21 Jul 2023 07:26:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.567579.886837 (Exim 4.92) (envelope-from ) id 1qMr4r-0002vP-Vt; Fri, 21 Jul 2023 14:25:53 +0000 Received: by outflank-mailman (output) from mailman id 567579.886837; Fri, 21 Jul 2023 14:25:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qMr4r-0002vI-TI; Fri, 21 Jul 2023 14:25:53 +0000 Received: by outflank-mailman (input) for mailman id 567579; Fri, 21 Jul 2023 14:25:52 +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 1qMr4q-0002v8-Ld for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 14:25:52 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7dda6a21-27d2-11ee-b23a-6b7b168915f2; Fri, 21 Jul 2023 16:25:50 +0200 (CEST) Received: from Dell.bugseng.com (unknown [37.160.253.240]) by support.bugseng.com (Postfix) with ESMTPSA id 95F9C4EE0C89; Fri, 21 Jul 2023 16:25:49 +0200 (CEST) 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: 7dda6a21-27d2-11ee-b23a-6b7b168915f2 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall Subject: [XEN PATCH] device_tree: address violations of MISRA C:2012 Rules 8.2 and 8.3 Date: Fri, 21 Jul 2023 16:25:41 +0200 Message-Id: <8acb3e1a39c4251a23b59d5c094b7fb39f7a5ed9.1689949312.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1689949588257100001 Content-Type: text/plain; charset="utf-8" Give a name to unnamed parameters thus addressing violations of MISRA C:2012 Rule 8.2 ("Function types shall be in prototype form with named parameters"). Keep consistency between parameter names and types used in function declarations and the ones used in the corresponding function definitions, thus addressing violations of MISRA C:2012 Rule 8.3 ("All declarations of an object or function shall use the same names and type qualifiers"). No functional changes. Signed-off-by: Federico Serafini --- xen/common/device_tree.c | 24 ++++++++++++------------ xen/include/xen/device_tree.h | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 0677193ab3..319f98f8c2 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -85,11 +85,11 @@ struct dt_bus unsigned int (*get_flags)(const __be32 *addr); }; =20 -void dt_get_range(const __be32 **cell, const struct dt_device_node *np, +void dt_get_range(const __be32 **cellp, const struct dt_device_node *np, u64 *address, u64 *size) { - *address =3D dt_next_cell(dt_n_addr_cells(np), cell); - *size =3D dt_next_cell(dt_n_size_cells(np), cell); + *address =3D dt_next_cell(dt_n_addr_cells(np), cellp); + *size =3D dt_next_cell(dt_n_size_cells(np), cellp); } =20 void dt_set_cell(__be32 **cellp, int size, u64 val) @@ -993,9 +993,9 @@ int dt_device_get_paddr(const struct dt_device_node *de= v, unsigned int index, } =20 int dt_for_each_range(const struct dt_device_node *dev, - int (*cb)(const struct dt_device_node *, + int (*cb)(const struct dt_device_node *dev, uint64_t addr, uint64_t length, - void *), + void *data), void *data) { const struct dt_device_node *parent =3D NULL; @@ -1164,7 +1164,7 @@ unsigned int dt_number_of_irq(const struct dt_device_= node *device) return (intlen / intsize); } =20 -unsigned int dt_number_of_address(const struct dt_device_node *dev) +unsigned int dt_number_of_address(const struct dt_device_node *device) { const __be32 *prop; u32 psize; @@ -1173,20 +1173,20 @@ unsigned int dt_number_of_address(const struct dt_d= evice_node *dev) int onesize, na, ns; =20 /* Get parent & match bus type */ - parent =3D dt_get_parent(dev); + parent =3D dt_get_parent(device); if ( parent =3D=3D NULL ) return 0; =20 bus =3D dt_match_bus(parent); if ( !bus ) return 0; - bus->count_cells(dev, &na, &ns); + bus->count_cells(device, &na, &ns); =20 if ( !DT_CHECK_COUNTS(na, ns) ) return 0; =20 /* Get "reg" or "assigned-addresses" property */ - prop =3D dt_get_property(dev, bus->addresses, &psize); + prop =3D dt_get_property(device, bus->addresses, &psize); if ( prop =3D=3D NULL ) return 0; =20 @@ -1197,9 +1197,9 @@ unsigned int dt_number_of_address(const struct dt_dev= ice_node *dev) } =20 int dt_for_each_irq_map(const struct dt_device_node *dev, - int (*cb)(const struct dt_device_node *, - const struct dt_irq *, - void *), + int (*cb)(const struct dt_device_node *dev, + const struct dt_irq *dt_irq, + void *data_cb), void *data) { const struct dt_device_node *ipar, *tnode, *old =3D NULL; diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index c2eada7489..e5d4fbc327 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -538,7 +538,7 @@ bool_t dt_machine_is_compatible(const char *compat); * Returns a node pointer with refcount incremented, use * of_node_put() on it when done. */ -struct dt_device_node *dt_find_node_by_name(struct dt_device_node *node, +struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from, const char *name); =20 /** @@ -639,7 +639,7 @@ unsigned int dt_number_of_address(const struct dt_devic= e_node *device); * device-tree node. It's the high level pendant to dt_device_get_raw_irq(= ). */ int dt_device_get_irq(const struct dt_device_node *device, unsigned int in= dex, - struct dt_irq *irq); + struct dt_irq *out_irq); =20 /** * dt_device_get_raw_irq - Resolve an interrupt for a device without trans= lation @@ -652,7 +652,7 @@ int dt_device_get_irq(const struct dt_device_node *devi= ce, unsigned int index, */ int dt_device_get_raw_irq(const struct dt_device_node *device, unsigned int index, - struct dt_raw_irq *irq); + struct dt_raw_irq *out_irq); =20 /** * dt_irq_translate - Translate an irq @@ -668,9 +668,9 @@ int dt_irq_translate(const struct dt_raw_irq *raw, stru= ct dt_irq *out_irq); * @data: Caller data passed to callback */ int dt_for_each_irq_map(const struct dt_device_node *dev, - int (*cb)(const struct dt_device_node *, - const struct dt_irq *, - void *), + int (*cb)(const struct dt_device_node *dev, + const struct dt_irq *irq, + void *data), void *data); =20 /** @@ -680,9 +680,9 @@ int dt_for_each_irq_map(const struct dt_device_node *de= v, * @data: Caller data passed to callback */ int dt_for_each_range(const struct dt_device_node *dev, - int (*cb)(const struct dt_device_node *, + int (*cb)(const struct dt_device_node *dev, uint64_t addr, uint64_t length, - void *), + void *data), void *data); =20 /** --=20 2.34.1