mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv:Fix Implict conversion:actual to formal param
MISRAC has requirement about implict conversion: actual to formal param. This patch is used to fix part of these violations. 1.Add a new structure seg_desc_vmcs to hold the VMCS field address of segment selector to clean up seg_desc structure. 2.Add the definition of maximum MSI entry and the relevant judgement. 3.The violations in shell.c, logmsg.c will be fixed in other series of patches with modification of function snprintf(), vsnprintf() and other related usages. v1->v2: *Move the definition of struct seg_desc_vmcs from instr_emul.h to instr_emul.c. *Modify the formal parameter type in function definition from uint8_t to char instead of using cast. *Drop the const declaration for char data in formal parameter. v2->v3: *update the data missing conversion. *change type of internal parameter len to avoid casting in npklog.c. *change the conversion from signed char to unsigned int in uart16550_getc() to solve sign-extension. Tracked-On: #861 Signed-off-by: Junjun Shan <junjun.shan@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -84,7 +84,7 @@ void npk_log_write(const char *buf, size_t buf_len)
|
||||
const char *p = buf;
|
||||
int sz;
|
||||
uint32_t ref;
|
||||
size_t len;
|
||||
uint16_t len;
|
||||
|
||||
if (!npk_log_enabled || !channel)
|
||||
return;
|
||||
@@ -93,7 +93,7 @@ void npk_log_write(const char *buf, size_t buf_len)
|
||||
ref = (atomic_inc_return((int32_t *)&per_cpu(npk_log_ref, cpu_id)) - 1)
|
||||
& HV_NPK_LOG_REF_MASK;
|
||||
channel += (cpu_id << HV_NPK_LOG_REF_SHIFT) + ref;
|
||||
len = min(buf_len, HV_NPK_LOG_MAX);
|
||||
len = (uint16_t)(min(buf_len, HV_NPK_LOG_MAX));
|
||||
mmio_write32(HV_NPK_LOG_HDR, &(channel->DnTS));
|
||||
mmio_write16(len, &(channel->Dn));
|
||||
|
||||
|
Reference in New Issue
Block a user