Skip to content

Commit 671be01

Browse files
committed
Merge tag 'linux-cpupower-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux
Pull cpupower utility updates for v5.9 from Shuah Khan: "This cpupower update for Linux 5.9-rc1 consists of 2 fixes to coccicheck warnings and one change to replacing HTTP links with HTTPS ones." * tag 'linux-cpupower-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower: Replace HTTP links with HTTPS ones cpupower: Fix NULL but dereferenced coccicheck errors cpupower: Fix comparing pointer to 0 coccicheck warns
2 parents 92ed301 + fa0866a commit 671be01

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

tools/power/cpupower/lib/cpufreq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ struct cpufreq_available_governors *cpufreq_get_available_governors(unsigned
285285
} else {
286286
first = malloc(sizeof(*first));
287287
if (!first)
288-
goto error_out;
288+
return NULL;
289289
current = first;
290290
}
291291
current->first = first;
@@ -362,7 +362,7 @@ struct cpufreq_available_frequencies
362362
} else {
363363
first = malloc(sizeof(*first));
364364
if (!first)
365-
goto error_out;
365+
return NULL;
366366
current = first;
367367
}
368368
current->first = first;
@@ -418,7 +418,7 @@ struct cpufreq_available_frequencies
418418
} else {
419419
first = malloc(sizeof(*first));
420420
if (!first)
421-
goto error_out;
421+
return NULL;
422422
current = first;
423423
}
424424
current->first = first;
@@ -493,7 +493,7 @@ static struct cpufreq_affected_cpus *sysfs_get_cpu_list(unsigned int cpu,
493493
} else {
494494
first = malloc(sizeof(*first));
495495
if (!first)
496-
goto error_out;
496+
return NULL;
497497
current = first;
498498
}
499499
current->first = first;
@@ -726,7 +726,7 @@ struct cpufreq_stats *cpufreq_get_stats(unsigned int cpu,
726726
} else {
727727
first = malloc(sizeof(*first));
728728
if (!first)
729-
goto error_out;
729+
return NULL;
730730
current = first;
731731
}
732732
current->first = first;

tools/power/cpupower/man/cpupower-monitor.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ displayed.
170170

171171
.SH REFERENCES
172172
"BIOS and Kernel Developer’s Guide (BKDG) for AMD Family 14h Processors"
173-
http://support.amd.com/us/Processor_TechDocs/43170.pdf
173+
https://support.amd.com/us/Processor_TechDocs/43170.pdf
174174

175175
"Intel® Turbo Boost Technology
176176
in Intel® Core™ Microarchitecture (Nehalem) Based Processors"
177177
http://download.intel.com/design/processor/applnots/320354.pdf
178178

179179
"Intel® 64 and IA-32 Architectures Software Developer's Manual
180180
Volume 3B: System Programming Guide"
181-
http://www.intel.com/products/processor/manuals
181+
https://www.intel.com/products/processor/manuals
182182

183183
.SH FILES
184184
.ta

tools/power/cpupower/utils/helpers/bitmask.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ struct bitmask *bitmask_alloc(unsigned int n)
2626
struct bitmask *bmp;
2727

2828
bmp = malloc(sizeof(*bmp));
29-
if (bmp == 0)
29+
if (!bmp)
3030
return 0;
3131
bmp->size = n;
3232
bmp->maskp = calloc(longsperbits(n), sizeof(unsigned long));
33-
if (bmp->maskp == 0) {
33+
if (!bmp->maskp) {
3434
free(bmp);
3535
return 0;
3636
}
@@ -40,7 +40,7 @@ struct bitmask *bitmask_alloc(unsigned int n)
4040
/* Free `struct bitmask` */
4141
void bitmask_free(struct bitmask *bmp)
4242
{
43-
if (bmp == 0)
43+
if (!bmp)
4444
return;
4545
free(bmp->maskp);
4646
bmp->maskp = (unsigned long *)0xdeadcdef; /* double free tripwire */

0 commit comments

Comments
 (0)