Message ID | 20210406132204.1818522-2-thomas@monjalon.net (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | David Marchand |
Headers | show |
Series | cleanup drivers log registration | expand |
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
On 4/6/21 4:22 PM, Thomas Monjalon wrote: > In the unlikely case where something goes wrong > while registering a log type, > the fallback is to use the EAL log type. > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net> > Reviewed-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h index 173004fd71..21a7d16340 100644 --- a/lib/librte_eal/include/rte_log.h +++ b/lib/librte_eal/include/rte_log.h @@ -380,6 +380,8 @@ RTE_INIT(__##type) \ { \ type = rte_log_register_type_and_pick_level(RTE_STR(name), \ RTE_LOG_##level); \ + if (type < 0) \ + type = RTE_LOGTYPE_EAL; \ } #ifdef __cplusplus