From nobody Tue May 14 08:51:34 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 1694608202818764.415370279818; Wed, 13 Sep 2023 05:30:02 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.601259.937234 (Exim 4.92) (envelope-from ) id 1qgP00-0007wd-0R; Wed, 13 Sep 2023 12:29:40 +0000 Received: by outflank-mailman (output) from mailman id 601259.937234; Wed, 13 Sep 2023 12:29:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qgOzz-0007wW-TV; Wed, 13 Sep 2023 12:29:39 +0000 Received: by outflank-mailman (input) for mailman id 601259; Wed, 13 Sep 2023 12:29:38 +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 1qgOzy-0007wP-Nw for xen-devel@lists.xenproject.org; Wed, 13 Sep 2023 12:29:38 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3262f47b-5231-11ee-9b0d-b553b5be7939; Wed, 13 Sep 2023 14:29:35 +0200 (CEST) Received: from Dell.homenet.telecomitalia.it (host-87-19-206-190.retail.telecomitalia.it [87.19.206.190]) by support.bugseng.com (Postfix) with ESMTPSA id 120754EE074D; Wed, 13 Sep 2023 14:29:34 +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: 3262f47b-5231-11ee-9b0d-b553b5be7939 From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [XEN PATCH] xen/libelf: address violations of MISRA C:2012 RUles 8.2 and 8.3 Date: Wed, 13 Sep 2023 14:29:24 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1694608204836100001 Content-Type: text/plain; charset="utf-8" Add missing parameter names and make function declarations and definitions consistent. No functional change. Signed-off-by: Federico Serafini Reviewed-by: Federico Serafini Reviewed-by: Stefano Stabellini --- xen/include/xen/libelf.h | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h index be47b0cc36..1c77e3df31 100644 --- a/xen/include/xen/libelf.h +++ b/xen/include/xen/libelf.h @@ -260,8 +260,8 @@ struct elf_binary { * str should be a HANDLE. */ =20 -uint64_t elf_access_unsigned(struct elf_binary *elf, elf_ptrval ptr, - uint64_t offset, size_t size); +uint64_t elf_access_unsigned(struct elf_binary *elf, elf_ptrval base, + uint64_t moreoffset, size_t size); /* Reads a field at arbitrary offset and alignemnt */ =20 uint64_t elf_round_up(struct elf_binary *elf, uint64_t addr); @@ -272,8 +272,10 @@ const char *elf_strval(struct elf_binary *elf, elf_ptr= val start); const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start); /* like elf_strval but returns "(invalid)" instead of NULL */ =20 -void elf_memcpy_safe(struct elf_binary*, elf_ptrval dst, elf_ptrval src, s= ize_t); -void elf_memset_safe(struct elf_binary*, elf_ptrval dst, int c, size_t); +void elf_memcpy_safe(struct elf_binary *elf, elf_ptrval dst, elf_ptrval sr= c, + size_t size); +void elf_memset_safe(struct elf_binary *elf, elf_ptrval dst, int c, + size_t size); /* * Versions of memcpy and memset which arrange never to write * outside permitted areas. @@ -324,7 +326,8 @@ ELF_HANDLE_DECL(elf_sym) elf_sym_by_index(struct elf_bi= nary *elf, unsigned index const char *elf_note_name(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note= ) note); /* may return NULL */ elf_ptrval elf_note_desc(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note)= note); uint64_t elf_note_numeric(struct elf_binary *elf, ELF_HANDLE_DECL(elf_note= ) note); -uint64_t elf_note_numeric_array(struct elf_binary *, ELF_HANDLE_DECL(elf_n= ote), +uint64_t elf_note_numeric_array(struct elf_binary *elf, + ELF_HANDLE_DECL(elf_note) note, unsigned int unitsz, unsigned int idx); =20 /* @@ -346,9 +349,10 @@ bool elf_phdr_is_loadable(struct elf_binary *elf, ELF_= HANDLE_DECL(elf_phdr) phdr /* -----------------------------------------------------------------------= - */ /* xc_libelf_loader.c = */ =20 -elf_errorstatus elf_init(struct elf_binary *elf, const char *image, size_t= size); +elf_errorstatus elf_init(struct elf_binary *elf, const char *image_input, + size_t size); /* - * image and size must be correct. They will be recorded in + * image_input and size must be correct. They will be recorded in * *elf, and must remain valid while the elf is in use. */ #ifdef __XEN__ @@ -445,16 +449,16 @@ static inline int elf_xen_feature_get(int nr, uint32_= t * addr) return !!(addr[nr >> 5] & (1 << (nr & 31))); } =20 -int elf_xen_parse_features(const char *features, - uint32_t *supported, - uint32_t *required); -int elf_xen_parse_note(struct elf_binary *elf, - struct elf_dom_parms *parms, - ELF_HANDLE_DECL(elf_note) note); -int elf_xen_parse_guest_info(struct elf_binary *elf, - struct elf_dom_parms *parms); -int elf_xen_parse(struct elf_binary *elf, - struct elf_dom_parms *parms, bool hvm); +elf_errorstatus elf_xen_parse_features(const char *features, + uint32_t *supported, + uint32_t *required); +elf_errorstatus elf_xen_parse_note(struct elf_binary *elf, + struct elf_dom_parms *parms, + ELF_HANDLE_DECL(elf_note) note); +elf_errorstatus elf_xen_parse_guest_info(struct elf_binary *elf, + struct elf_dom_parms *parms); +elf_errorstatus elf_xen_parse(struct elf_binary *elf, + struct elf_dom_parms *parms, bool hvm); =20 static inline void *elf_memcpy_unchecked(void *dest, const void *src, size= _t n) { return memcpy(dest, src, n); } --=20 2.34.1