diff --git a/pwrapic/gtest/Common.cpp b/pwrapic/gtest/Common.cpp index 82f1b5d80d2249b183df14bd316784193d697bbd..d903a4bcb81b92333a286cdf75d0a487b1cb250a 100644 --- a/pwrapic/gtest/Common.cpp +++ b/pwrapic/gtest/Common.cpp @@ -78,7 +78,7 @@ void MetaDataCallback(const PWR_COM_CallbackData *callbackData) } break; default: - printf("[TASK]Get INVALIDE data.\n"); + printf("[TASK]Get INVALID data.\n"); break; } } diff --git a/pwrapic/inc/sockclient.h b/pwrapic/inc/sockclient.h index 0c0bfe6ee67a0f18ff59475aa3524ee18767cd16..42a4d91f0c7372dc9084637f2733a6bd49eb4e46 100644 --- a/pwrapic/inc/sockclient.h +++ b/pwrapic/inc/sockclient.h @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. * Author: queyanwen * Create: 2022-06-23 - * Description: Provide IPC ability. Socket initialization, send/receive msg, send/recieve buffer + * Description: Provide IPC ability. Socket initialization, send/receive msg, send/receive buffer * **************************************************************************** */ #ifndef POWERAPI_CONNECTION_H__ #define POWERAPI_CONNECTION_H__ diff --git a/pwrapic/src/powerapi.c b/pwrapic/src/powerapi.c index a3dc5465e4f07d64515446af0682fce37238a627..dfe00ef8b13a71d7d2dfb728333d75e32bce6165 100644 --- a/pwrapic/src/powerapi.c +++ b/pwrapic/src/powerapi.c @@ -33,7 +33,7 @@ { \ if ((s) > GetPwrApiStatus()) { \ if ((s) == STATUS_REGISTERTED) { \ - PwrLog(ERROR, "Not registed."); \ + PwrLog(ERROR, "Not register."); \ return PWR_ERR_NOT_REGISTED; \ } else { \ PwrLog(ERROR, "Not authorized."); \ @@ -731,4 +731,4 @@ int PWR_USB_SetAutoSuspend(PWR_USB_AutoSuspend usbAts[], uint32_t len) } -#endif // #ifndef RELEASE_MODE \ No newline at end of file +#endif // #ifndef RELEASE_MODE diff --git a/pwrapic/src/sockclient.c b/pwrapic/src/sockclient.c index d1d853ea3df7bc13977eeb0d037f82485c59942b..85dcd56c3ea803dd6cfe3a1e864499d2741226da 100644 --- a/pwrapic/src/sockclient.c +++ b/pwrapic/src/sockclient.c @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. * Author: queyanwen * Create: 2022-06-23 - * Description: Provide IPC ability. Socket initialization, send/receive msg, send/recieve buffer + * Description: Provide IPC ability. Socket initialization, send/receive msg, send/receive buffer * **************************************************************************** */ #include "sockclient.h" diff --git a/pwrapic/test/demo_main.c b/pwrapic/test/demo_main.c index ba0f8d74a60e257b6c6d2382208e676d5dc892d0..76adc2957a5d3c9824d433396159f4171bff33bb 100644 --- a/pwrapic/test/demo_main.c +++ b/pwrapic/test/demo_main.c @@ -114,7 +114,7 @@ void MetaDataCallback(const PWR_COM_CallbackData *callbackData) } */ break; default: - printf("[TASK ] Get invalide data.\n"); + printf("[TASK ] Get invalid data.\n"); break; } } @@ -144,7 +144,7 @@ static void SignalHandler(int none) static void SetupSignal(void) { - // regist signal handler + // register signal handler (void)signal(SIGINT, SignalHandler); (void)signal(SIGUSR1, SignalHandler); (void)signal(SIGUSR2, SignalHandler); @@ -666,4 +666,4 @@ int main(int argc, const char *args[]) PWR_ReleaseControlAuth(); PWR_UnRegister(); return 0; -} \ No newline at end of file +} diff --git a/pwrapis/inc/common.h b/pwrapis/inc/common.h index f97c3ba38dc530a67e174072684087e0925c1948..70b54b19e37d7783ccf49959e90cdaa4e9cb1122 100644 --- a/pwrapis/inc/common.h +++ b/pwrapis/inc/common.h @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. * Author: luocaimin * Create: 2022-06-23 - * Description: provide const value defination + * Description: provide const value definition * **************************************************************************** */ #ifndef LCM_COMMON_H #define LCM_COMMON_H @@ -21,7 +21,7 @@ #define MAX_PEDDING_SOCKS 5 #define MS_TO_SEC 1000 -// Status code defination +// Status code definition #define INTERACT_SUCCEED 2003 #define INTERACT_FAIL 2002 #define NO_PROCESS 2000 @@ -134,7 +134,7 @@ #define MAX_FULL_TIME 25 // Gather #define MAX_PERIOD 3600 -// Sockt connetion closed +// Sockt connection closed #define CONN_CLOSED (-753462) #define READ_DONE 1 // Total number of items collected @@ -176,12 +176,12 @@ #define CPU_FIVE_MIN_LOAD_FIELD_NUM 2 #define CPU_FIFTEEN_MIN_LOAD_FIELD_NUM 3 -// Memery data define +// Memory data define #define FIRST_MATCH_LINE 1 #define MEMINFO_DATA_FIELD_NUM 2 #define NUMA_MEM_DATA_FIELD_NUM 4 -// Numa node name perfix length +// Numa node name prefix length #define NUMA_NM_PX_LEN 13 #define ZERO_USAGE "0" #define ST_CHANGE "2" diff --git a/pwrapis/src/CMakeLists.txt b/pwrapis/src/CMakeLists.txt index d3af215d8f16cd5717b5ab769900d158b49017c1..98973fa5224e7ea8d84257e2b5e5755cef74a579 100644 --- a/pwrapis/src/CMakeLists.txt +++ b/pwrapis/src/CMakeLists.txt @@ -28,10 +28,10 @@ install (FILES "${PROJECT_SOURCE_DIR}/../conf/pwrapis_config.ini" DESTINATION /etc/sysconfig/pwrapis PERMISSIONS OWNER_READ OWNER_WRITE) install (FILES "${PROJECT_SOURCE_DIR}/../pwrapis.service" DESTINATION /usr/lib/systemd/system) -# release complile mode +# release compile mode # set(CMAKE_BUILD_TYPE "Release") # set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall") -# debug complile mode +# debug compile mode set(CMAKE_BUILD_TYPE "Debug") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -ggdb -Wall -Wextra -Werror") diff --git a/pwrapis/src/cpuservice.c b/pwrapis/src/cpuservice.c index 5e8749a645f66500351f7857bba5cf9a6daf0f68..00cdf624c18e7ec4498bde51fc27b920da286126 100644 --- a/pwrapis/src/cpuservice.c +++ b/pwrapis/src/cpuservice.c @@ -198,7 +198,7 @@ static int UsageToLong(char *buf, unsigned long paras[], int line) DeleteSubstr(temp, "cpu"); paras[i] = strtoul(temp, NULL, 0); } else { - return -2; // -2 means no this core usage informaton + return -2; // -2 means no this core usage information } } else if (i != 0) { paras[i] = strtoul(temp, NULL, 0); @@ -1423,4 +1423,4 @@ void SetCpuDmaLatency(PwrMsg *req) // fclose(g_cpuDmaLatencyWriteFd); } while (PWR_FALSE); SendRspToClient(req, ret, NULL, 0); -} \ No newline at end of file +} diff --git a/pwrapis/src/main_frame.c b/pwrapis/src/main_frame.c index 0b4748f63949586437b6b474ee589e1a716e8bc9..c34f81d71ed3447d29bf0b373a37e3315ea5e8e8 100644 --- a/pwrapis/src/main_frame.c +++ b/pwrapis/src/main_frame.c @@ -59,7 +59,7 @@ static void SignalHandler(int none) static void SetupSignal(void) { - // regist signal handler + // register signal handler (void)signal(SIGINT, SignalHandler); (void)signal(SIGUSR1, SignalHandler); (void)signal(SIGUSR2, SignalHandler); diff --git a/pwrapis/src/utils.c b/pwrapis/src/utils.c index fd7737e76b2f133bca4ea71077a001ed66318691..1ffe380673ccedce4a38d2606f7206caa5b577fe 100644 --- a/pwrapis/src/utils.c +++ b/pwrapis/src/utils.c @@ -747,7 +747,7 @@ const char *ReadNums(const char *pSrc, const char *sep, int maxCnt, uint64_t dts return readPos; } -// Find the front nonspace postion, return char pointer +// Find the front nonspace position, return char pointer char *Ltrim(char *s) { if (s == NULL) { @@ -761,7 +761,7 @@ char *Ltrim(char *s) return t; } -// Find the last nonspace postion, return char pointer +// Find the last nonspace position, return char pointer char *Rtrim(char *s) { if (s == NULL) { @@ -1128,4 +1128,4 @@ int GetPath(const char *filepath, char *path) } } return PWR_ERR_FILE_ACCESS_FAILED; -} \ No newline at end of file +}