HV:fix "Pointer param should be declared pointer to const"

Fix violations for function whose parameter can be read-only.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Huihuang Shi
2018-10-23 11:45:29 +08:00
committed by wenlingz
parent d79007ae70
commit ea32c34ae1
39 changed files with 149 additions and 149 deletions

View File

@@ -247,7 +247,7 @@ void asm_assert(int32_t line, const char *file, const char *txt)
} while (1);
}
void dump_intr_excp_frame(struct intr_excp_ctx *ctx)
void dump_intr_excp_frame(const struct intr_excp_ctx *ctx)
{
const char *name = "Not defined";

View File

@@ -43,7 +43,7 @@ static inline void free_earlylog_sbuf(uint16_t pcpu_id)
}
static void do_copy_earlylog(struct shared_buf *dst_sbuf,
struct shared_buf *src_sbuf)
const struct shared_buf *src_sbuf)
{
uint32_t buf_size, valid_size;
uint32_t cur_tail;

View File

@@ -11,7 +11,7 @@
#include <hypervisor.h>
static inline bool sbuf_is_empty(struct shared_buf *sbuf)
static inline bool sbuf_is_empty(const struct shared_buf *sbuf)
{
return (sbuf->head == sbuf->tail);
}

View File

@@ -329,7 +329,7 @@ static bool shell_input_line(void)
return done;
}
static int shell_process_cmd(char *p_input_line)
static int shell_process_cmd(const char *p_input_line)
{
int status = -EINVAL;
struct shell_cmd *p_cmd;

View File

@@ -80,7 +80,7 @@ static inline char fifo_getchar(struct fifo *fifo)
}
}
static inline uint32_t fifo_numchars(struct fifo *fifo)
static inline uint32_t fifo_numchars(const struct fifo *fifo)
{
return fifo->num;
}
@@ -107,7 +107,7 @@ static inline void vuart_fifo_init(struct acrn_vuart *vu)
*
* Return an interrupt reason if one is available.
*/
static uint8_t vuart_intr_reason(struct acrn_vuart *vu)
static uint8_t vuart_intr_reason(const struct acrn_vuart *vu)
{
if (((vu->lsr & LSR_OE) != 0U) && ((vu->ier & IER_ELSI) != 0U)) {
return IIR_RLS;
@@ -125,7 +125,7 @@ static uint8_t vuart_intr_reason(struct acrn_vuart *vu)
* Toggle the COM port's intr pin depending on whether or not we have an
* interrupt condition to report to the processor.
*/
static void vuart_toggle_intr(struct acrn_vuart *vu)
static void vuart_toggle_intr(const struct acrn_vuart *vu)
{
uint8_t intr_reason;
union ioapic_rte rte;