hv:fix "missing for discarded return value" for memcpy_s and strcpy_s

It will print error information inside memcpy_s if
the parameteter is invalid, the caller can not check
the return value for memcpy_s/strcpy_s/strncpy_s
code like this:
int a(void) {
return 0;
}
int b(void){
a();
}
fix as follow:
int a(void) {
return 0;
}
int b(void){
(void)a();
}

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
Mingqiang Chi
2018-07-05 13:32:01 +08:00
committed by wenlingz
parent 8d3847d216
commit deb44402e3
20 changed files with 63 additions and 60 deletions

View File

@@ -909,7 +909,7 @@ static void get_entry_info(struct ptdev_remapping_info *entry, char *type,
{
if (is_entry_active(entry)) {
if (entry->type == PTDEV_INTR_MSI) {
strcpy_s(type, 16, "MSI");
(void)strcpy_s(type, 16, "MSI");
*dest = (entry->ptdev_intr_info.msi.pmsi_addr & 0xFF000U)
>> 12;
if ((entry->ptdev_intr_info.msi.pmsi_data &
@@ -928,9 +928,9 @@ static void get_entry_info(struct ptdev_remapping_info *entry, char *type,
if (entry->ptdev_intr_info.intx.vpin_src
== PTDEV_VPIN_IOAPIC)
strcpy_s(type, 16, "IOAPIC");
(void)strcpy_s(type, 16, "IOAPIC");
else
strcpy_s(type, 16, "PIC");
(void)strcpy_s(type, 16, "PIC");
ioapic_get_rte(phys_irq, &rte);
*dest = ((rte >> 32) & IOAPIC_RTE_DEST) >> 24;
if ((rte & IOAPIC_RTE_TRGRLVL) != 0U)
@@ -945,7 +945,7 @@ static void get_entry_info(struct ptdev_remapping_info *entry, char *type,
*irq = dev_to_irq(entry->node);
*vector = dev_to_vector(entry->node);
} else {
strcpy_s(type, 16, "NONE");
(void)strcpy_s(type, 16, "NONE");
*irq = IRQ_INVALID;
*vector = 0U;
*dest = 0UL;