Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp670064imm; Fri, 21 Sep 2018 06:28:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYnXFKFv+GraKX8dT9b8PNc9vU4X93Opvz0wSGIybU3vbaRudoIUBvBoICWQjuSAmDeiDsR X-Received: by 2002:a62:7d8d:: with SMTP id y135-v6mr45978938pfc.259.1537536519368; Fri, 21 Sep 2018 06:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537536519; cv=none; d=google.com; s=arc-20160816; b=ua0kphnEGl25U8OH56bP275JUcFLPfPLculxDBUaN1/Sl/6kvoKmgUo302x3NUIR7/ 7lwgYiC2BEKZtoQk0g/M3W4Ukr4NWLeBPLJKP8lsq2LWeMPtH2jX7EM00tOlXmUfa8DI CtvPHsyf4g0tfrrAOm4fqSdSTP73DyNaDcTyWw6ElVqpdOxFpQ7ncuVOC+fdK5Gq9jA7 AIRuGzNWEWKApd/yW5yesgCpm0T8Z2OJsVPOkCHh2jTUj1PpOcFO+ZXmX1t/w4y9nJzA 2etrNLPGmTcfDgsv3gaeBI22pae0cwF73X5gBgJRIfHv0r0c2eZ/sOnp+0k4romPUuLQ UE6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=0+jHGq6Iwq96rM0u3yCt0rOallYZv8FDz6OCFetpq3Y=; b=Z8W7hH3yq1o3/41tVLBTIbmjLqQ4OCTZlNh+WmQTs7N47zYcQ02BZ9o7viIESg7JrC KPrDMehw4ABWF9ubzx/DKcD7zOPFGY25NlGV/NUgNYjwjI5xZbzEx9epUQ3AujuiAN2S TjzO3q4C08jLm5V+KAfT2fkaptGoeWnT4XNrMxMHj+xBpTVLnjQgeNRrhe9mfDt0OfOM Fra+YR75Hm0F3N01kLHF7hSuWjDbEVCT5VjstPW4gIfnJsxTtQqw0tzVFeytA+kwhlCz dkpbjcSR2vk/QwipL7x1HXA2NnrXTBI9lyALuM0ybHnF453z8qp6Eb5C/hJCqj6LxekN PmKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u29-v6si25875973pga.29.2018.09.21.06.28.08; Fri, 21 Sep 2018 06:28:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390110AbeIUTPg (ORCPT + 99 others); Fri, 21 Sep 2018 15:15:36 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35643 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbeIUTPf (ORCPT ); Fri, 21 Sep 2018 15:15:35 -0400 Received: by mail-wm1-f66.google.com with SMTP id o18-v6so3303570wmc.0 for ; Fri, 21 Sep 2018 06:26:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0+jHGq6Iwq96rM0u3yCt0rOallYZv8FDz6OCFetpq3Y=; b=enC0TdPoo9/OnDx1cr0DHmV785ZWP+6hpVA61d9+hgYLjG/f0geD3VXvlGsJD7eCPo pBDQBChMZRv/rGT33nnNezBrwRk8XdmgbmljTHrxq97+4TXpFH0K166T88Bq52gxDGxn x8+x0xPnyQX4BjQDCdCAqbtT5pHmwvmdIAew2HETDBEpuNQ9TweDZ4yqBZbgQr2fZ6Ny r8+ITV+Y7yM/nZ4+V3IObOmPsrVrU1RaWD5kLDgdccJvJfDQcS8NaBIGrf4BbTJmobf2 39ETJxH/DaSdVUWXr+jWdqNGcMZUrqBtKh8RwX2y2XK+WEMZ3n1rZtkiC8rA26003VKG 5Asg== X-Gm-Message-State: APzg51Ap1GfLp32HcG+S5K9nsRxxjtsdEV4oaaJA2StI5DnVOAzCm3HE jMCu/owXmVwxq3dua/wgBjQ= X-Received: by 2002:a1c:148f:: with SMTP id 137-v6mr7024221wmu.61.1537536402509; Fri, 21 Sep 2018 06:26:42 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id x204-v6sm5567205wmg.27.2018.09.21.06.26.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 06:26:41 -0700 (PDT) Received: from d104.suse.de (nat.nue.novell.com [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 4F88D125334; Fri, 21 Sep 2018 15:26:40 +0200 (CEST) From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, dan.j.williams@intel.com, david@redhat.com, Pavel.Tatashin@microsoft.com, Jonathan.Cameron@huawei.com, yasu.isimatu@gmail.com, malat@debian.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v2 2/4] mm/memory_hotplug: Tidy up node_states_clear_node Date: Fri, 21 Sep 2018 15:26:32 +0200 Message-Id: <20180921132634.10103-3-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180921132634.10103-1-osalvador@techadventures.net> References: <20180921132634.10103-1-osalvador@techadventures.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oscar Salvador node_states_clear has the following if statements: if ((N_MEMORY != N_NORMAL_MEMORY) && (arg->status_change_nid_high >= 0)) ... if ((N_MEMORY != N_HIGH_MEMORY) && (arg->status_change_nid >= 0)) ... N_MEMORY can never be equal to neither N_NORMAL_MEMORY nor N_HIGH_MEMORY. Similar problem was found in [1]. Since this is wrong, let us get rid of it. [1] https://patchwork.kernel.org/patch/10579155/ Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin --- mm/memory_hotplug.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 63facfc57224..561c44761f95 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1582,12 +1582,10 @@ static void node_states_clear_node(int node, struct memory_notify *arg) if (arg->status_change_nid_normal >= 0) node_clear_state(node, N_NORMAL_MEMORY); - if ((N_MEMORY != N_NORMAL_MEMORY) && - (arg->status_change_nid_high >= 0)) + if (arg->status_change_nid_high >= 0) node_clear_state(node, N_HIGH_MEMORY); - if ((N_MEMORY != N_HIGH_MEMORY) && - (arg->status_change_nid >= 0)) + if (arg->status_change_nid >= 0) node_clear_state(node, N_MEMORY); } -- 2.13.6