8303047: avoid NULL after 8301661

Reviewed-by: mdoerr, kbarrett, dholmes
(cherry picked from commit 221f34634d)
This commit is contained in:
Matthias Baesken
2023-02-23 08:08:25 +00:00
committed by Vitaly Provodin
parent 55e42f436c
commit a37e124669
2 changed files with 3 additions and 3 deletions

View File

@@ -1305,7 +1305,7 @@ void os::print_os_info(outputStream* st) {
#ifdef __APPLE__
static void print_sysctl_info_string(const char* sysctlkey, outputStream* st, char* buf, size_t size) {
if (sysctlbyname(sysctlkey, buf, &size, NULL, 0) >= 0) {
if (sysctlbyname(sysctlkey, buf, &size, nullptr, 0) >= 0) {
st->print_cr("%s:%s", sysctlkey, buf);
}
}
@@ -1313,7 +1313,7 @@ static void print_sysctl_info_string(const char* sysctlkey, outputStream* st, ch
static void print_sysctl_info_uint64(const char* sysctlkey, outputStream* st) {
uint64_t val;
size_t size=sizeof(uint64_t);
if (sysctlbyname(sysctlkey, &val, &size, NULL, 0) >= 0) {
if (sysctlbyname(sysctlkey, &val, &size, nullptr, 0) >= 0) {
st->print_cr("%s:%llu", sysctlkey, val);
}
}

View File

@@ -2109,7 +2109,7 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
}
size_t sz_check = sizeof(PROCESSOR_POWER_INFORMATION) * (size_t)proc_count;
NTSTATUS status = ::CallNtPowerInformation(ProcessorInformation, NULL, 0, buf, (ULONG) buflen);
NTSTATUS status = ::CallNtPowerInformation(ProcessorInformation, nullptr, 0, buf, (ULONG) buflen);
int max_mhz = -1, current_mhz = -1, mhz_limit = -1;
bool same_vals_for_all_cpus = true;