From patchwork Fri Jun 1 12:24:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 9078 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2206D23E1B for ; Fri, 1 Jun 2012 12:26:37 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id E5DFEA18AA1 for ; Fri, 1 Jun 2012 12:26:36 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so1894261ggn.11 for ; Fri, 01 Jun 2012 05:26:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=PhjM2Qu39QepohmK1l77+bqKjF7c4vh+ZaSMT1nPYyo=; b=Q6Z3193e+fMLBi8waV/f7n3hdtPpf5hMehD4hqjh2NtPyJwU7v+viQVbfoD3+wxQaA tqfWY4FhBG7MDU3RuGhPBI4AcZYDqoxyYBXStZn1cslAkakGZGFc1tREHldYv68nlSEi eO+1Qy2WA4F3nP1rDHMUqBUoLmTo71K5ZqUXcsPFgnSHrhdobM5+75cNZW35OXAyHj6I pucCps5XNASfn11iR1UnVbLFjX3Y0Av1Zewh9Ff1lpwgMwuHZIdiME2hlgoRUGdKXeul 7uOSybltREm5VAJRZXWeo+NFrHQzF+0+gwIGXG+/PL0aRJej/fcOhgRGSQI0o19Sk/SL nMTw== Received: by 10.50.195.234 with SMTP id ih10mr1234662igc.0.1338553595244; Fri, 01 Jun 2012 05:26:35 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp313882ibb; Fri, 1 Jun 2012 05:26:34 -0700 (PDT) Received: by 10.68.241.8 with SMTP id we8mr9639485pbc.130.1338553594526; Fri, 01 Jun 2012 05:26:34 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id ql5si4305197pbc.156.2012.06.01.05.26.34 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jun 2012 05:26:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by mail-pb0-f50.google.com with SMTP id rr4so3360451pbb.37 for ; Fri, 01 Jun 2012 05:26:34 -0700 (PDT) Received: by 10.68.217.3 with SMTP id ou3mr2143306pbc.117.1338553594314; Fri, 01 Jun 2012 05:26:34 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id oq8sm2235212pbb.23.2012.06.01.05.26.32 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Jun 2012 05:26:33 -0700 (PDT) From: Anton Vorontsov To: Pekka Enberg Cc: Leonid Moiseichuk , KOSAKI Motohiro , Minchan Kim , Bartlomiej Zolnierkiewicz , John Stultz , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com Subject: [PATCH 4/5] vmevent: Hide meaningful names from the user-visible header Date: Fri, 1 Jun 2012 05:24:05 -0700 Message-Id: <1338553446-22292-4-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <20120601122118.GA6128@lizard> References: <20120601122118.GA6128@lizard> X-Gm-Message-State: ALoCoQkgEO+IbIwoDaY9gceckFRd2Ex6hM2mgBE/9sroYXK+2mBLr9p15pWEtLCPMX7dFnMrpEQB ...so that nobody would try to use the internally used bits. Suggested-by: KOSAKI Motohiro Signed-off-by: Anton Vorontsov --- 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;