[PATCH v6 2/5] power: refactor uncore power management library

Stephen Hemminger stephen at networkplumber.org
Mon Oct 21 01:28:54 CEST 2024


On Sun, 20 Oct 2024 09:22:29 +0000
Sivaprasad Tummala <sivaprasad.tummala at amd.com> wrote:

> +uint32_t
> +rte_power_get_uncore_freq(unsigned int pkg, unsigned int die)
> +{
> +	RTE_ASSERT(global_uncore_ops != NULL);

All these RTE_ASSERT calls seem like a good idea, they really don't help.
If RTE_ASSERT fails it prints a message and calls abort.
If you skip the RTE_ASSERT, the next line will cause a NULL dereference
illegal pointer reference and crash.

So in either case it crashes, and the RTE_ASSERT() doesn't add much help.

Also RTE_ENABLE_ASSERT() is usually disabled.


More information about the dev mailing list