Skip to content

Commit

Permalink
cpupower: mperf monitor: Correct use of ! and &
Browse files Browse the repository at this point in the history
In commit ae91d60, a bug was fixed that
involved converting !x & y to !(x & y).  The code below shows the same
pattern, and thus should perhaps be fixed in the same way.

The Coccinelle semantic patch that makes this change is as follows:

// <smpl>
@@ expression E1,E2; @@
(
  !E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
// </smpl>

Signed-off-by: Himangi Saraogi <[email protected]>
Signed-off-by: Thomas Renninger <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
himangi774 authored and rafaeljw committed Jul 29, 2014
1 parent 103f179 commit 97fa1c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static int init_maxfreq_mode(void)
unsigned long long hwcr;
unsigned long min;

if (!cpupower_cpu_info.caps & CPUPOWER_CAP_INV_TSC)
if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_INV_TSC))
goto use_sysfs;

if (cpupower_cpu_info.vendor == X86_VENDOR_AMD) {
Expand Down

0 comments on commit 97fa1c5

Please sign in to comment.