Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp558329imm; Fri, 1 Jun 2018 05:56:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJTBEgf72v4ux9RCcg1u62QRBSGY1SCGD+l9nN7EUyEN0MPJns0RWQMblpNMCk2bc408Gsu X-Received: by 2002:a17:902:6f16:: with SMTP id w22-v6mr10864704plk.216.1527857779866; Fri, 01 Jun 2018 05:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527857779; cv=none; d=google.com; s=arc-20160816; b=mCUYzRtUsYnUqkqLrsfjaRG0rNhSOYNnly2ZEsB/TPblRJxVxnIDlgmOOgWDFGyH33 PFeUFvGEx/41W2DiMEaEqQ90D9JRSKLD/xzHZYOaFj1rlNagdTYYZ74j9/EEVAEvhAWg rW0Nn86/kuARZDyJZ5o58tv6IWqM9hhudgFA9SvzKGHFftN8CkNHmnIxQOvRhUGpgV4r +gqhNtE2oLxIZjqZpH0iUdBGMef8lwRUO279SeKFbSEqITQbZbWyfMgk4unPlvAxwUg1 tW7+OLdZZHnykkRsO461s2Mc7XNuEhi/Ild7Pgyp1GatylG7Pfwgt4xdS9Fntbts8vIm CvIg== 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=sLAg7ePpxhj935svuV/s6v90oA8DzKC0Qh2n6z7ZfUE=; b=Qyh7/whnCuZI7u/sXHhuUEN0GwLs+jQlIF0iscfyIig/i9N1xz7xYoLHqi8LEMlBCY bBr7AsWCk3/jSHjsbzRJID/x92yKrwZCr8lq//QUNO6tjDLgiqOCnskQxnrARCGwlyq2 hmMcsMp3c0d/fsQz4v6JDkPSpyEkD7ObhuBOTY3IJ5UcR9rlXnsdO0gOAhDtCvsrh3jY IrbdDaoh92rVPvA4lzxqyjYfA2bQ53gg8YI5M7GHCd+6NQjTz0a0O4sY8LhyPP90pdB1 AUlhnLoDgn/JTdhyt6l8ivAdJSH/O89mRC/ajfjZ29++uVL2RcxuXhczacF/fBVGdm9E f+iQ== 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 k1-v6si17654443pgo.543.2018.06.01.05.56.04; Fri, 01 Jun 2018 05:56:19 -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 S1752581AbeFAMyY (ORCPT + 99 others); Fri, 1 Jun 2018 08:54:24 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:41495 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752354AbeFAMyN (ORCPT ); Fri, 1 Jun 2018 08:54:13 -0400 Received: by mail-wr0-f194.google.com with SMTP id u12-v6so36222420wrn.8 for ; Fri, 01 Jun 2018 05:54:13 -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=sLAg7ePpxhj935svuV/s6v90oA8DzKC0Qh2n6z7ZfUE=; b=bZTMBJhbAniIPpjsfPR4sCJ0Hawp80Ss2bmT7knydnwy9PUwrc3t8lKGjPsqtUYD2O yG96Hrkhz5sjZL6vfwimaNUrM2/OOkDbRKC1X5fSrGq4co/GiJ77/IOFTu9IL1yf8YFi vJsh7lBOBPZAyMG9ILuiGZ5hOZmKDt0iBMysaGjpjW8lz4FaR29tpXKra+k1AlV6d7fJ dS/vnugdXGpkZC9kk/ARHho580yMZc86ohvfil1prsl0aBFgKeCXc4X9UCLoyyuVHnDn B8fmGwRzuAlHyFvgZ2MyzzlmvQ8rT1PLXsB1ttSBYSpZkRAOkCOqhs9968r5C//up6py zw1Q== X-Gm-Message-State: ALKqPwe0dkbYAJGlwyy6fQDPy/FQiXdWzAYQ7CfebtL3j99Alr1sn0O/ sQluRjSTNBhZeP2v90k1iOo= X-Received: by 2002:adf:a292:: with SMTP id s18-v6mr8246696wra.114.1527857652823; Fri, 01 Jun 2018 05:54:12 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id y18-v6sm13766517wrl.53.2018.06.01.05.54.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jun 2018 05:54:10 -0700 (PDT) Received: from d104.suse.de (nat.nue.novell.com [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 3D2F612317D; Fri, 1 Jun 2018 14:54:09 +0200 (CEST) From: osalvador@techadventures.net To: akpm@linux-foundation.org Cc: mhocko@suse.com, vbabka@suse.cz, pasha.tatashin@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH 4/4] mm/memory_hotplug: Drop unnecessary checks from register_mem_sect_under_node Date: Fri, 1 Jun 2018 14:53:21 +0200 Message-Id: <20180601125321.30652-5-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180601125321.30652-1-osalvador@techadventures.net> References: <20180601125321.30652-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 --- drivers/base/node.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 248c712e8de5..681be04351bc 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -415,12 +415,7 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid, int ret; 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