Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2429147ybl; Sun, 26 Jan 2020 02:28:55 -0800 (PST) X-Google-Smtp-Source: APXvYqz6q5w3n6MM/bEkXiJ/1vMVNEVz6MsewiY55q/QgEC9BMP59TiVx6JRscmN5GLxgKy5EO6e X-Received: by 2002:a05:6830:4a4:: with SMTP id l4mr8881288otd.91.1580034535147; Sun, 26 Jan 2020 02:28:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580034535; cv=none; d=google.com; s=arc-20160816; b=Mrr4PeirPPO3a4d8BVbw4lwVgg3DRrRNz8uin2zNwHG5aQlYeYPKW5hsf3rPYW7AHb zZHRMjSsL9ltK04NSegq518cV+917ZQO1oIhz/NzWyKEw/PFicwiobl0pPv9RlHMIxW3 IGoJ7UnNf5RNKqeVTUoc6e+OxkR5bLfTHCtDB6PRW8isJmfmrwCXjRWHGS3vP4IPNZfs jkb0McwlStTOmYU2bz83niWrUeHjbUdWx6sH35uzgf/yXiR0oYRQk1u2Y7gx75F/exOU JCIa40r//qoqkr4TT80hnOj3oSdgedoK5UiqO2nZEgexjJPk9Uep5X6JhYE+TjdyR+um aM0g== 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=vkwfKutG6/o3pTI98b0ItRe3t/SxK2AB92poFF6aShs=; b=uwm7ihRqUKfg0Tjfn03m4MY+Rzdxr3KAzzPuBln0+GB91NO+U699KqxM4mOe9lCAeJ JRKsRv1s9va7cr7qy8wJiACiToeGleVyY18Bq+Fq4ePoMfxvWla+hKcwJTjf/Js8VyLA SdfThUy5pC89KfZAB95nR8wAkjk7pduyLjCp2PkM/rGRCdOwWfHnLubtqdbicd/prdfs DbI59rNGzHUvMtd6KN0Xk2wj+oVloBGF3Kc4j8MiarHQKOQU7lozxxDqoBLWfqllict0 9WXNzp/hILl8+lG4wNFYSM6OcCkH41CymgdnqZeIzXjGkEp+LiQHdUil+VD1CstaVD+h 5G5w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p7si4442971otl.17.2020.01.26.02.28.22; Sun, 26 Jan 2020 02:28:55 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729420AbgAZK1U (ORCPT + 99 others); Sun, 26 Jan 2020 05:27:20 -0500 Received: from mga12.intel.com ([192.55.52.136]:33300 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbgAZK1T (ORCPT ); Sun, 26 Jan 2020 05:27:19 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jan 2020 02:27:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,365,1574150400"; d="scan'208";a="223002736" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga008.fm.intel.com with ESMTP; 26 Jan 2020 02:27:18 -0800 From: Wei Yang To: akpm@linux-foundation.org Cc: mhocko@suse.com, yang.shi@linux.alibaba.com, rientjes@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [Patch v3 1/4] mm/migrate.c: not necessary to check start and i Date: Sun, 26 Jan 2020 18:26:20 +0800 Message-Id: <20200126102623.9616-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200126102623.9616-1-richardw.yang@linux.intel.com> References: <20200126102623.9616-1-richardw.yang@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Till here, i must no less than start. And if i equals to start, store_status() would always return 0. Remove some unnecessary check to make it easy to read and prepare for further cleanup. Signed-off-by: Wei Yang Acked-by: Michal Hocko --- mm/migrate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 6a6c8f247bce..ae3db45c6a42 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1674,11 +1674,9 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, err += nr_pages - i - 1; goto out; } - if (i > start) { - err = store_status(status, start, current_node, i - start); - if (err) - goto out; - } + err = store_status(status, start, current_node, i - start); + if (err) + goto out; current_node = NUMA_NO_NODE; } out_flush: -- 2.17.1