Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp541675imm; Wed, 19 Sep 2018 03:09:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY8rGH4vTFUFwXEZOiMPlMvYE6De6NhkCZMbUZGW+ZP9mn3Ew6lfV0D8K8yfCbTfysWhLEu X-Received: by 2002:a17:902:1121:: with SMTP id d30-v6mr32837277pla.250.1537351762278; Wed, 19 Sep 2018 03:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537351762; cv=none; d=google.com; s=arc-20160816; b=zKm7gXuxZaQlAZbeOfLylLrbK72qrRHCEz03K0wexXau/ldVCgf/FLKRn8e3kgGkJf qMcNvrN/rTUnaXfJELoGdFvIJbrKkKJ6NJBTYY7vaRqpqoQCFZj/mYYMyWL2rbsx8DDW LsL2l8GHYxqqDsv2J5A1pQ9QAvWe4wkyqKjCwRYqd3uQtPnzzS3WO6rgdPyDNqWbK5We JUIhnGXIEFnS49BAUlCOUx/lWELNKVXRKyrI9qGPi0CgN7LhIGKQgc4KoKVGugi0l9q4 sZ2C/bKlirRxEWG5pfgOPDq4TGm79AwACDD75tOAXVww9gj54TEmWGKfNPBoIODk0Jzh xt7w== 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=nPK6uXZN7cckrZujWIB4/aDojr48F0Bx+xBF9fcQrF4=; b=v64lLydv2JpgwH7JK/RvJKjVygvF0U5hUV0N6tFJy5gaDThOBTi5wixscJerYnBEbZ OYF56Pi56ACVdy+N13bdfuk11ZSMXmRuu17bcpRWTPS+HLa2psVXtFGNazWRZTSmuj7o l6DImHwg3I1UEQJBiej4MTWOg+ZBQ54Q95iNCZa/0O38wFe6GW4wDQds7fDz46FrOPTS 95sXvTcUDXj6kdtYtBGqHodDTbziAWXDSOiwgpuvwsZ2/eM1O3mINmr5Dhz59gzESCFi 5PhMP0VFl1HdkppiO5x9ZJFl+A/TTwTfKbt5f7+boitgE/7JTZly33u+Gnki2Q5svMMY dthg== 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 p67-v6si22307506pfg.295.2018.09.19.03.09.06; Wed, 19 Sep 2018 03:09:22 -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 S1731255AbeISPpy (ORCPT + 99 others); Wed, 19 Sep 2018 11:45:54 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44914 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731157AbeISPpw (ORCPT ); Wed, 19 Sep 2018 11:45:52 -0400 Received: by mail-wr1-f65.google.com with SMTP id v16-v6so5138616wro.11 for ; Wed, 19 Sep 2018 03:08:41 -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=nPK6uXZN7cckrZujWIB4/aDojr48F0Bx+xBF9fcQrF4=; b=h/VzMhQVK1CGE5SJj0nYVEDOYesVY+XnZ9t9urklxIyjVy3uA1CVojFtZOEFbCLOxG 4i7jYqGg+gISiu7FqAoBOTW33Htee/srcd69JduVnHNUH77gwC2SsDfoez3dh3trCf63 hK6iHrNhrXXO1l7r9XRFUWhau4kRXnhFIZGSOEE2tGS6JRCQhWtXljdQpJ4ZiHdOW0yF ml96lL5Jbk0kknhhBsxLzP5Iq2LoSolTdahuCP0KJq7ypB4B/RZDhmP7e/bNgYPAh4af 1AnJa73D5JN1/ZgW5ryMl1yp/WDNQexyu1fR027O7ytCMD9nN0hgaGQUWa20QOQBfUOu Jc/g== X-Gm-Message-State: APzg51BE1OFrwXdZu69E2GWcdklVfOg+nIa4sEqOKC5HZXz2GDLJcja+ fb/TyJlqI+X2hLt+Ylnxwwg= X-Received: by 2002:a5d:68c9:: with SMTP id p9-v6mr27824256wrw.108.1537351720351; Wed, 19 Sep 2018 03:08:40 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id d18-v6sm2982148wmb.33.2018.09.19.03.08.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Sep 2018 03:08:39 -0700 (PDT) Received: from d104.suse.de (charybdis-ext.suse.de [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 2ED381253C4; Wed, 19 Sep 2018 12:08:38 +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 3/5] mm/memory_hotplug: Tidy up node_states_clear_node Date: Wed, 19 Sep 2018 12:08:17 +0200 Message-Id: <20180919100819.25518-4-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180919100819.25518-1-osalvador@techadventures.net> References: <20180919100819.25518-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 --- 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 c2c7359bd0a7..131c08106d54 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1590,12 +1590,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