From 8dc29be02f910df2ca43db479708e3bd7da85293 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 23 Apr 2024 09:06:25 +0200 Subject: [PATCH] Remove unused set_priority()/set_thread_priority() --- common/utils/utils.c | 15 --------------- common/utils/utils.h | 2 -- nfapi/oai_integration/nfapi.c | 17 ----------------- nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp | 19 ------------------- 4 files changed, 53 deletions(-) diff --git a/common/utils/utils.c b/common/utils/utils.c index 66b840c7d9..377c4512b7 100644 --- a/common/utils/utils.c +++ b/common/utils/utils.c @@ -118,21 +118,6 @@ char *itoa(int i) { return strdup(buffer); } - -void set_priority(int priority) -{ - struct sched_param param = - { - .sched_priority = priority, - }; - fprintf(stderr, "Calling sched_setscheduler(%d)\n", priority); - if (sched_setscheduler(0, SCHED_RR, ¶m) == -1) - { - fprintf(stderr, "sched_setscheduler: %s\n", strerror(errno)); - abort(); - } -} - /** * @brief Convert a version string x.y.z into numbers. * diff --git a/common/utils/utils.h b/common/utils/utils.h index 8cb9a357fd..082d1dd635 100644 --- a/common/utils/utils.h +++ b/common/utils/utils.h @@ -116,8 +116,6 @@ int hex_char_to_hex_value (char c); // Converts an hexadecimal ASCII coded string into its value.** int hex_string_to_hex_value (uint8_t *hex_value, const char *hex_string, int size); -void set_priority(int priority); - char *itoa(int i); #define STRINGIFY(S) #S diff --git a/nfapi/oai_integration/nfapi.c b/nfapi/oai_integration/nfapi.c index f60e36fb06..7b4d1b6239 100644 --- a/nfapi/oai_integration/nfapi.c +++ b/nfapi/oai_integration/nfapi.c @@ -40,23 +40,6 @@ typedef struct { static nfapi_params_t nfapi_params = {0}; -void set_thread_priority(int priority) { - set_priority(priority); - - pthread_attr_t ptAttr; - if(pthread_attr_setschedpolicy(&ptAttr, SCHED_RR) != 0) { - printf("Failed to set pthread sched policy SCHED_RR\n"); - } - - pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED); - struct sched_param thread_params; - thread_params.sched_priority = 20; - - if(pthread_attr_setschedparam(&ptAttr, &thread_params) != 0) { - printf("failed to set sched param\n"); - } -} - const char *nfapi_get_strmode(void) { if (nfapi_params.nfapi_mode > NFAPI_MODE_UNKNOWN) return nfapi_str_mode[NFAPI_MODE_UNKNOWN]; diff --git a/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp b/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp index 4fe5065cea..72df4e306c 100644 --- a/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp +++ b/nfapi/open-nFAPI/pnf_sim/src/fapi_stub.cpp @@ -137,25 +137,6 @@ extern "C" } fapi_internal_t; } -extern void set_thread_priority(int); -/* -{ - pthread_attr_t ptAttr; - - struct sched_param schedParam; - schedParam.__sched_priority = 79; - sched_setscheduler(0, SCHED_RR, &schedParam); - - pthread_attr_setschedpolicy(&ptAttr, SCHED_RR); - - pthread_attr_setinheritsched(&ptAttr, PTHREAD_EXPLICIT_SCHED); - - struct sched_param thread_params; - thread_params.sched_priority = 20; - pthread_attr_setschedparam(&ptAttr, &thread_params); -} -*/ - void send_uplink_indications(fapi_internal_t *instance, uint16_t sfn_sf) { fapi_harq_ind_t harq_ind; (instance->callbacks.fapi_harq_ind)(&(instance->_public), &harq_ind);