All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: rjw@rjwysocki.net
Cc: linux-pm@vger.kernel.org, Himangi Saraogi <himangi774@gmail.com>,
	Thomas Renninger <trenn@suse.de>
Subject: [PATCH 1/3] cpupower: mperf monitor: Correct use of ! and &
Date: Tue, 29 Jul 2014 18:12:18 +0200	[thread overview]
Message-ID: <1406650340-38644-1-git-send-email-trenn@suse.de> (raw)
In-Reply-To: <2377922.j9jRKZAKtD@vostro.rjw.lan>

From: Himangi Saraogi <himangi774@gmail.com>

In commit ae91d60ba88ef0bdb1b5e9b2363bd52fc45d2af7, 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 <himangi774@gmail.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
 .../cpupower/utils/idle_monitor/mperf_monitor.c    |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c b/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
index 5650ab5..90a8c4f 100644
--- a/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
+++ b/tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
@@ -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) {
-- 
1.7.6.1


  reply	other threads:[~2014-07-29 16:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 14:05 [PATCH 0/4] tools/power/cpupower latest fixes Thomas Renninger
2014-07-22 14:05 ` [PATCH 1/4] cpupower: mperf monitor: Correct use of ! and & Thomas Renninger
2014-07-22 14:05 ` [PATCH 2/4] tools: power: cpupower: bench: parse.c: Fix several minor errors Thomas Renninger
2014-07-22 14:06 ` [PATCH 3/4] cpupower: Remove redundant error check Thomas Renninger
2014-07-22 14:06 ` [PATCH 4/4] cpupower: Adjust MAINTAINERS file Thomas Renninger
2014-07-22 23:53 ` [PATCH 0/4] tools/power/cpupower latest fixes Rafael J. Wysocki
2014-07-29 16:12   ` Thomas Renninger [this message]
2014-07-29 16:12     ` [PATCH 2/3] tools: power: cpupower: bench: parse.c: Fix several minor errors Thomas Renninger
2014-07-29 16:12     ` [PATCH 3/3] cpupower: Remove redundant error check Thomas Renninger
2014-07-30  0:28     ` [PATCH 1/3] cpupower: mperf monitor: Correct use of ! and & Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406650340-38644-1-git-send-email-trenn@suse.de \
    --to=trenn@suse.de \
    --cc=himangi774@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.