+static int
+check_function_ptrs(void)
+{
+ enum power_management_env env = rte_power_get_env();
+
+ const bool not_null_expected = !(env == PM_ENV_NOT_SET);
+
+ const char *inject_not_string1 = not_null_expected ? " not" : "";
+ const char *inject_not_string2 = not_null_expected ? "" : " not";
+
+ if ((rte_power_freqs == NULL) == not_null_expected) {
+ printf("rte_power_freqs should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_get_freq == NULL) == not_null_expected) {
+ printf("rte_power_get_freq should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_set_freq == NULL) == not_null_expected) {
+ printf("rte_power_set_freq should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_freq_up == NULL) == not_null_expected) {
+ printf("rte_power_freq_up should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_freq_down == NULL) == not_null_expected) {
+ printf("rte_power_freq_down should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_freq_max == NULL) == not_null_expected) {
+ printf("rte_power_freq_max should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_freq_min == NULL) == not_null_expected) {
+ printf("rte_power_freq_min should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_turbo_status == NULL) == not_null_expected) {
+ printf("rte_power_turbo_status should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_freq_enable_turbo == NULL) == not_null_expected) {
+ printf("rte_power_freq_enable_turbo should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_freq_disable_turbo == NULL) == not_null_expected) {
+ printf("rte_power_freq_disable_turbo should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+ if ((rte_power_get_capabilities == NULL) == not_null_expected) {
+ printf("rte_power_get_capabilities should%s be NULL, environment has%s been "
+ "initialised\n", inject_not_string1,
+ inject_not_string2);
+ return -1;
+ }
+
+ return 0;
+}
+