On 10 March 2016 at 19:23, Thomas Monjalon <thomas.monjalon at 6wind.com> wrote:
> 2016-03-03 00:34, Marc Sune: > > RTE_PMD_DEBUG_TRACE used RTE_FUNC_PTR_OR_ERR_RET was redefined > > in rte_cryptodev_pmd.h which produced MACRO redefinition warnings > > when including both rte_cryptodev_pmd.h and rte_ethdev.h. > > > > This commit moves MACRO definition to rte_cryptodev.c to prevent > > this warning. > > It is not the right fix. > This MACRO is only used in that .c file, so it actually makes sense not to be defined in the header file. > > This macro should probably be renamed with a crypto prefix or defined > only once (same thing for ethdev). > The function rte_pmd_debug_trace() and the macros > RTE_PROC_PRIMARY_OR_ERR_RET, > RTE_PROC_PRIMARY_OR_RET, > RTE_FUNC_PTR_OR_ERR_RET, > RTE_FUNC_PTR_OR_RET > should not be in lib/librte_eal/common/include/rte_dev.h. > The macros call RTE_PMD_DEBUG_TRACE which is defined elsewhere. > The rte_log.h is probably a better place. > But why these macros have no PMD prefix? > While I agree, this patch is only trying to solve the compilation error, which I think it is a step forward from what we have now. I am working on C++ linking automated test and I could not include both files in the test. Marc