lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1338553446-22292-4-git-send-email-anton.vorontsov@linaro.org>
Date:	Fri,  1 Jun 2012 05:24:05 -0700
From:	Anton Vorontsov <anton.vorontsov@...aro.org>
To:	Pekka Enberg <penberg@...nel.org>
Cc:	Leonid Moiseichuk <leonid.moiseichuk@...ia.com>,
	KOSAKI Motohiro <kosaki.motohiro@...il.com>,
	Minchan Kim <minchan@...nel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	John Stultz <john.stultz@...aro.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, linaro-kernel@...ts.linaro.org,
	patches@...aro.org, kernel-team@...roid.com
Subject: [PATCH 4/5] vmevent: Hide meaningful names from the user-visible header

...so that nobody would try to use the internally used bits.

Suggested-by: KOSAKI Motohiro <kosaki.motohiro@...il.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@...aro.org>
---
 include/linux/vmevent.h |    6 ++----
 mm/vmevent.c            |    9 +++++++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/linux/vmevent.h b/include/linux/vmevent.h
index aae0d24..b8ec0ac 100644
--- a/include/linux/vmevent.h
+++ b/include/linux/vmevent.h
@@ -35,10 +35,8 @@ enum {
 	 */
 	VMEVENT_ATTR_STATE_ONE_SHOT	= (1UL << 3),
 
-	/* Saved state, used internally by the kernel for one-shot mode. */
-	__VMEVENT_ATTR_STATE_VALUE_WAS_LT	= (1UL << 30),
-	/* Saved state, used internally by the kernel for one-shot mode. */
-	__VMEVENT_ATTR_STATE_VALUE_WAS_GT	= (1UL << 31),
+	__VMEVENT_ATTR_STATE_INTERNAL	= (1UL << 30) |
+					  (1UL << 31),
 };
 
 struct vmevent_attr {
diff --git a/mm/vmevent.c b/mm/vmevent.c
index 35fd0d5..e64a92d 100644
--- a/mm/vmevent.c
+++ b/mm/vmevent.c
@@ -83,6 +83,11 @@ static u64 vmevent_sample_attr(struct vmevent_watch *watch, struct vmevent_attr
 	return fn(watch, attr);
 }
 
+enum {
+	VMEVENT_ATTR_STATE_VALUE_WAS_LT	= (1UL << 30),
+	VMEVENT_ATTR_STATE_VALUE_WAS_GT	= (1UL << 31),
+};
+
 static bool vmevent_match(struct vmevent_watch *watch)
 {
 	struct vmevent_config *config = &watch->config;
@@ -100,8 +105,8 @@ static bool vmevent_match(struct vmevent_watch *watch)
 
 		if (attr_lt || attr_gt || attr_eq) {
 			bool one_shot = state & VMEVENT_ATTR_STATE_ONE_SHOT;
-			u32 was_lt_mask = __VMEVENT_ATTR_STATE_VALUE_WAS_LT;
-			u32 was_gt_mask = __VMEVENT_ATTR_STATE_VALUE_WAS_GT;
+			u32 was_lt_mask = VMEVENT_ATTR_STATE_VALUE_WAS_LT;
+			u32 was_gt_mask = VMEVENT_ATTR_STATE_VALUE_WAS_GT;
 			u64 value = vmevent_sample_attr(watch, attr);
 			bool lt = value < attr->value;
 			bool gt = value > attr->value;
-- 
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ