[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC] Next steps for MISRA C Rule 17.7 in XEN
Hello folks! There are a lot of MISRA C R17.7 violations in the XEN. This rule states: "The value returned by a function having non-void return type shall be used". Actually, need to decide how to deal with these violations. Quick analyze shown that there are different cases in XEN code base. Like, for example: the return value of function `clean_and_invalidate_dcache_va_range(const void*, unsigned long)' (unit `xen/arch/arm/alternative.c' with target `xen/arch/arm/alternative.o') is unexpectedly ignored The return value of this function 'clean_and_invalidate_dcache_va_range' is checked only in one place. Probably, after deeper analyze the return value can be dropped and function prototype can be changed to static inline void clean_and_invalidate_dcache_va_range (const void *p, unsigned long size); Next case is vice versa: the return value of function `vgic_reserve_virq(struct domain*, unsigned)' is unexpectedly ignored There is only one place where the return value is not checked. Probably, in this place code may be changed to: (void)vgic_reserve_virq(d, irq); For the case with 'memset' function: the return value of function `memset(void*, int, size_t)' is unexpectedly ignored I guess it's better to create deviation, something like: "The return value of the function memset(void *, int, size_t) is ignored because the primary purpose of the function is to set a block of memory to a specific value, not to use the pointer returned by the function." But due to the large number of violations, it will be tricky to address all of them. I don't know, maybe the only right solution is to deviate all. Thanks! Dmytro.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |