diff mbox series

[XEN] xen/libelf: address violations of MISRA C:2012 RUles 8.2 and 8.3

Message ID e4d28b9b78e84260feea6bdbcb4ecdd815af5db3.1694591513.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series [XEN] xen/libelf: address violations of MISRA C:2012 RUles 8.2 and 8.3 | expand

Commit Message

Federico Serafini Sept. 13, 2023, 12:29 p.m. UTC
Add missing parameter names and make function declarations and
definitions consistent. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/include/xen/libelf.h | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

Comments

Federico Serafini Sept. 13, 2023, 12:41 p.m. UTC | #1
On 13/09/23 14:29, Federico Serafini wrote:
> Add missing parameter names and make function declarations and
> definitions consistent. No functional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

There is a typo in the patch title (RUles), please correct on commit.

Reviewed-by: Federico Serafini <federico.serafini@bugseng.com>
Julien Grall Sept. 13, 2023, 1:14 p.m. UTC | #2
Hi,

On 13/09/2023 13:41, Federico Serafini wrote:
> On 13/09/23 14:29, Federico Serafini wrote:
>> Add missing parameter names and make function declarations and
>> definitions consistent. No functional change.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> There is a typo in the patch title (RUles), please correct on commit.

That can be done so long there are no other comments.

> 
> Reviewed-by: Federico Serafini <federico.serafini@bugseng.com>

I am bit confused. Why do you provide a reviewed-by on a patch you wrote?

Cheers,
Stefano Stabellini Sept. 13, 2023, 11:12 p.m. UTC | #3
On Wed, 13 Sep 2023, Julien Grall wrote:
> On 13/09/2023 13:41, Federico Serafini wrote:
> > On 13/09/23 14:29, Federico Serafini wrote:
> > > Add missing parameter names and make function declarations and
> > > definitions consistent. No functional change.
> > > 
> > > Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> > 
> > There is a typo in the patch title (RUles), please correct on commit.
> 
> That can be done so long there are no other comments.
> 
> > 
> > Reviewed-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> I am bit confused. Why do you provide a reviewed-by on a patch you wrote?

Maybe a mistake?

In any case, I reviewed the patch and everything checks out

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Federico Serafini Sept. 14, 2023, 7:26 a.m. UTC | #4
On 13/09/23 15:14, Julien Grall wrote:
> Hi,
> 
> On 13/09/2023 13:41, Federico Serafini wrote:
>> On 13/09/23 14:29, Federico Serafini wrote:
>>> Add missing parameter names and make function declarations and
>>> definitions consistent. No functional change.
>>>
>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>
>> There is a typo in the patch title (RUles), please correct on commit.
> 
> That can be done so long there are no other comments.
> 
>>
>> Reviewed-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> I am bit confused. Why do you provide a reviewed-by on a patch you wrote?
> 
> Cheers,
> 
Since I noticed something wrong with my patch, I thought that adding the
"Reviewed-by" might be better than simply replying to the mail.
I will not do it again.
diff mbox series

Patch

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.
    */
 
-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 */
 
 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_ptrval start);
 const char *elf_strfmt(struct elf_binary *elf, elf_ptrval start);
   /* like elf_strval but returns "(invalid)" instead of NULL */
 
-void elf_memcpy_safe(struct elf_binary*, elf_ptrval dst, elf_ptrval src, size_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 src,
+                     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_binary *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_note),
+uint64_t elf_note_numeric_array(struct elf_binary *elf,
+                                ELF_HANDLE_DECL(elf_note) note,
                                 unsigned int unitsz, unsigned int idx);
 
 /*
@@ -346,9 +349,10 @@  bool elf_phdr_is_loadable(struct elf_binary *elf, ELF_HANDLE_DECL(elf_phdr) phdr
 /* ------------------------------------------------------------------------ */
 /* xc_libelf_loader.c                                                       */
 
-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)));
 }
 
-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);
 
 static inline void *elf_memcpy_unchecked(void *dest, const void *src, size_t n)
     { return memcpy(dest, src, n); }