This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8551

-- gerrit

commit 71ce62ddff014953502b7e65afa82f7b77ab53ef
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Sat Nov 9 19:21:30 2024 +0100

    semihosting: make local functions static
    
    The functions:
    - semihosting_opcode_to_str();
    - semihosting_write_fields();
    - semihosting_set_field();
    are not referenced outside the file.
    
    Make them static.
    
    Change-Id: Ia8d35554673145fdfe0e501543eb18919863039f
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/target/semihosting_common.c b/src/target/semihosting_common.c
index 1eb195712e..ffcd3aafde 100644
--- a/src/target/semihosting_common.c
+++ b/src/target/semihosting_common.c
@@ -92,6 +92,8 @@ static int semihosting_common_fileio_info(struct target 
*target,
        struct gdb_fileio_info *fileio_info);
 static int semihosting_common_fileio_end(struct target *target, int result,
        int fileio_errno, bool ctrl_c);
+static void semihosting_set_field(struct target *target, uint64_t value, 
size_t index, uint8_t *fields);
+static int semihosting_write_fields(struct target *target, size_t number, 
uint8_t *fields);
 
 /**
  * Initialize common semihosting support.
@@ -298,7 +300,12 @@ static inline int semihosting_getchar(struct semihosting 
*semihosting, int fd)
  */
 static char *semihosting_user_op_params;
 
-const char *semihosting_opcode_to_str(const uint64_t opcode)
+/**
+ * @brief Convert the syscall opcode to a human-readable string
+ * @param[in] opcode Syscall opcode
+ * @return String representation of syscall opcode
+ */
+static const char *semihosting_opcode_to_str(const uint64_t opcode)
 {
        switch (opcode) {
                case SEMIHOSTING_SYS_CLOSE:
@@ -1729,8 +1736,7 @@ int semihosting_read_fields(struct target *target, size_t 
number,
 /**
  * Write all fields of a command from buffer to target.
  */
-int semihosting_write_fields(struct target *target, size_t number,
-       uint8_t *fields)
+static int semihosting_write_fields(struct target *target, size_t number, 
uint8_t *fields)
 {
        struct semihosting *semihosting = target->semihosting;
        /* Use 4-byte multiples to trigger fast memory access. */
@@ -1754,9 +1760,7 @@ uint64_t semihosting_get_field(struct target *target, 
size_t index,
 /**
  * Store a field in the buffer, considering register size and endianness.
  */
-void semihosting_set_field(struct target *target, uint64_t value,
-       size_t index,
-       uint8_t *fields)
+static void semihosting_set_field(struct target *target, uint64_t value, 
size_t index, uint8_t *fields)
 {
        struct semihosting *semihosting = target->semihosting;
        if (semihosting->word_size_bytes == 8)
diff --git a/src/target/semihosting_common.h b/src/target/semihosting_common.h
index a1848b4881..1821ca4e2e 100644
--- a/src/target/semihosting_common.h
+++ b/src/target/semihosting_common.h
@@ -188,13 +188,6 @@ struct semihosting {
        int (*post_result)(struct target *target);
 };
 
-/**
- * @brief Convert the syscall opcode to a human-readable string
- * @param[in] opcode Syscall opcode
- * @return String representation of syscall opcode
- */
-const char *semihosting_opcode_to_str(uint64_t opcode);
-
 int semihosting_common_init(struct target *target, void *setup,
        void *post_result);
 int semihosting_common(struct target *target);
@@ -202,13 +195,8 @@ int semihosting_common(struct target *target);
 /* utility functions which may also be used by semihosting extensions (custom 
vendor-defined syscalls) */
 int semihosting_read_fields(struct target *target, size_t number,
        uint8_t *fields);
-int semihosting_write_fields(struct target *target, size_t number,
-       uint8_t *fields);
 uint64_t semihosting_get_field(struct target *target, size_t index,
        uint8_t *fields);
-void semihosting_set_field(struct target *target, uint64_t value,
-       size_t index,
-       uint8_t *fields);
 
 extern const struct command_registration semihosting_common_handlers[];
 

-- 

Reply via email to