Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp725266imm; Fri, 22 Jun 2018 04:22:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL84n/k8WjevcElGy7gp6CZpF1a0uI8LTGDiNPDh64Pq4OteAvkI4LnI/1HgshDbpb7AzVC X-Received: by 2002:a17:902:7891:: with SMTP id q17-v6mr1296868pll.186.1529666543122; Fri, 22 Jun 2018 04:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529666543; cv=none; d=google.com; s=arc-20160816; b=d60cZSbpKiMbKNDCarxtkdLsiTxoJtyOMgNyXeiNgXZEPrPR4loXR+UkdEKKpJ/6Se 8JIamY9E4uTzifdJTlcT1qpYXUF3H59iW1PvqvsGd0TKE5L5jfkvX2fmph0K36ejPe8j Z/OY2haFBj1tTBDYoFK2y5XTIWPKvYWnvBd2umsDOJtVniFdiAvoYu0YfJsUvnHla6nl XVbWEvh5EoP10L1ohU0CXsjNTbH1WQSu58ACw6DtVamPDJUAEx9u5HQS9brw+nSmCe4x gcsLVfI4899FEb3A9oJ1ZOhf2M66jaFgRrRSJVrf7Dw5Wx/j4X5mOjTuw2e8yWfLNxK2 1HdQ== 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:arc-authentication-results; bh=Vppk5lepmis7Ld2t4g0iQZwPCZGyFSFB7nOgL3SbhDQ=; b=wbB2Dko/QUopdJlMO1Ct29C/yDT0L5PZSkPIGv5v5u8x5UcY1UTQJ/B21HUMkw0S+t 3E5NLA8PQAELw/dtwyfDWwvr05J1upPWQ95rG8cDlffgOOlHdarx9A8CZ0BSLt4Jigmz 4+D84a84Cb2GVX6sKH2bu5riWaf7OjscXU0rQ6ZFRY0TDwqNym3VH8MdTiH2O/cuf6xJ J66P9Vpu2Cmtjqe5Q+/RvcKxtzTh5CnVn/6MH1wMEyh0AW2+a7q2NADgyDLuoLEW1S75 6/cZpVzvnfflp1KA3NhZjBvpXUWkoc5ahPoOZ3NBsHp4aly9PT8JsJ6OHR1Etr2J7j6z q0Cg== 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 r12-v6si5914813pgv.285.2018.06.22.04.22.08; Fri, 22 Jun 2018 04:22:23 -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 S933414AbeFVLUF (ORCPT + 99 others); Fri, 22 Jun 2018 07:20:05 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55458 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbeFVLTf (ORCPT ); Fri, 22 Jun 2018 07:19:35 -0400 Received: by mail-wm0-f66.google.com with SMTP id v16-v6so1871335wmh.5 for ; Fri, 22 Jun 2018 04:19:35 -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=Vppk5lepmis7Ld2t4g0iQZwPCZGyFSFB7nOgL3SbhDQ=; b=HWMFMKApzsY5CZi71H8YMLO5U6bQcphaYO141B/obu31OacNvawC41Mj4xgM/8NIq5 WXDPxz6QLRVWrckmfFFLC4GJ6JXjzlkg0453BxwGWgENCXGWyV8xmO4M6rw8YHL6/xSe fQcY7su4oWjNafVnO7QB4JikZK5i1lxH8kPN3o+/GJlpmCXHHNhfxCEw8sknkduv4XgV sKgFRTv/QtjKfvx/faAS6Ap9Usrz7sJwZIsPv43e+UOtl6i/awFlu5yi35pK35m7E3a8 wJQXxuL2LkgqAmx/pcVD+4hzRyMBznOJkeEIDgwdVYHK5HG4U22D59uDsXvHlucbkkU8 OtXg== X-Gm-Message-State: APt69E0CVetCXvXGDnqXk/29eAe1/d+Vu06OoTHv9vJLqz4i+M4KxfBk Zh6c+OASmHomlr8S/zccQkM= X-Received: by 2002:a1c:47cf:: with SMTP id m76-v6mr1361484wmi.80.1529666374503; Fri, 22 Jun 2018 04:19:34 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id l78-v6sm2718567wmb.39.2018.06.22.04.19.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 04:19:33 -0700 (PDT) Received: from d104.suse.de (charybdis-ext.suse.de [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 2B18612375D; Fri, 22 Jun 2018 13:19:32 +0200 (CEST) From: osalvador@techadventures.net To: akpm@linux-foundation.org Cc: mhocko@suse.com, vbabka@suse.cz, pasha.tatashin@oracle.com, Jonathan.Cameron@huawei.com, arbab@linux.vnet.ibm.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v2 4/4] mm/memory_hotplug: Drop unnecessary checks from register_mem_sect_under_node Date: Fri, 22 Jun 2018 13:18:39 +0200 Message-Id: <20180622111839.10071-5-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180622111839.10071-1-osalvador@techadventures.net> References: <20180622111839.10071-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 Callers of register_mem_sect_under_node() are always passing a valid memory_block (not NULL), so we can safely drop the check for NULL. In the same way, register_mem_sect_under_node() is only called in case the node is online, so we can safely remove that check as well. Signed-off-by: Oscar Salvador Reviewed-by: Pavel Tatashin --- drivers/base/node.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 845d5523812b..1ac4c36e13bb 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -404,12 +404,7 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, void *arg) int ret, nid = *(int *)arg; unsigned long pfn, sect_start_pfn, sect_end_pfn; - if (!mem_blk) - return -EFAULT; - mem_blk->nid = nid; - if (!node_online(nid)) - return 0; sect_start_pfn = section_nr_to_pfn(mem_blk->start_section_nr); sect_end_pfn = section_nr_to_pfn(mem_blk->end_section_nr); -- 2.13.6