8298147: Clang warns about pointless comparisons

Reviewed-by: dholmes
This commit is contained in:
Thomas Stuefe 2022-12-07 07:31:29 +00:00
parent 8ea369afe6
commit 1c2a093988
2 changed files with 0 additions and 27 deletions

View File

@ -287,9 +287,6 @@ int CgroupV1Subsystem::cpu_shares() {
char* CgroupV1Subsystem::pids_max_val() {
GET_CONTAINER_INFO_CPTR(cptr, _pids, "/pids.max",
"Maximum number of tasks is: %s", "%s %*d", pidsmax, 1024);
if (pidsmax == NULL) {
return NULL;
}
return os::strdup(pidsmax);
}

View File

@ -92,27 +92,18 @@ int CgroupV2Subsystem::cpu_quota() {
char * CgroupV2Subsystem::cpu_cpuset_cpus() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/cpuset.cpus",
"cpuset.cpus is: %s", "%1023s", cpus, 1024);
if (cpus == NULL) {
return NULL;
}
return os::strdup(cpus);
}
char* CgroupV2Subsystem::cpu_quota_val() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/cpu.max",
"Raw value for CPU quota is: %s", "%s %*d", quota, 1024);
if (quota == NULL) {
return NULL;
}
return os::strdup(quota);
}
char * CgroupV2Subsystem::cpu_cpuset_memory_nodes() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/cpuset.mems",
"cpuset.mems is: %s", "%1023s", mems, 1024);
if (mems == NULL) {
return NULL;
}
return os::strdup(mems);
}
@ -151,9 +142,6 @@ jlong CgroupV2Subsystem::memory_max_usage_in_bytes() {
char* CgroupV2Subsystem::mem_soft_limit_val() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/memory.low",
"Memory Soft Limit is: %s", "%s", mem_soft_limit_str, 1024);
if (mem_soft_limit_str == NULL) {
return NULL;
}
return os::strdup(mem_soft_limit_str);
}
@ -176,9 +164,6 @@ jlong CgroupV2Subsystem::memory_and_swap_limit_in_bytes() {
char* CgroupV2Subsystem::mem_swp_limit_val() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/memory.swap.max",
"Memory and Swap Limit is: %s", "%s", mem_swp_limit_str, 1024);
if (mem_swp_limit_str == NULL) {
return NULL;
}
return os::strdup(mem_swp_limit_str);
}
@ -186,9 +171,6 @@ char* CgroupV2Subsystem::mem_swp_limit_val() {
char* CgroupV2Subsystem::mem_swp_current_val() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/memory.swap.current",
"Swap currently used is: %s", "%s", mem_swp_current_str, 1024);
if (mem_swp_current_str == NULL) {
return NULL;
}
return os::strdup(mem_swp_current_str);
}
@ -216,9 +198,6 @@ jlong CgroupV2Subsystem::read_memory_limit_in_bytes() {
char* CgroupV2Subsystem::mem_limit_val() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/memory.max",
"Raw value for memory limit is: %s", "%s", mem_limit_str, 1024);
if (mem_limit_str == NULL) {
return NULL;
}
return os::strdup(mem_limit_str);
}
@ -245,9 +224,6 @@ char* CgroupV2Controller::construct_path(char* mount_path, char *cgroup_path) {
char* CgroupV2Subsystem::pids_max_val() {
GET_CONTAINER_INFO_CPTR(cptr, _unified, "/pids.max",
"Maximum number of tasks is: %s", "%s %*d", pidsmax, 1024);
if (pidsmax == NULL) {
return NULL;
}
return os::strdup(pidsmax);
}