From patchwork Wed Aug 15 14:42:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oscar Salvador X-Patchwork-Id: 10566671 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1543C1510 for ; Wed, 15 Aug 2018 14:42:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 044D82A902 for ; Wed, 15 Aug 2018 14:42:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0AF2A905; Wed, 15 Aug 2018 14:42:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 889202A902 for ; Wed, 15 Aug 2018 14:42:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 83D9F6B0008; Wed, 15 Aug 2018 10:42:32 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7EF646B000C; Wed, 15 Aug 2018 10:42:32 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F0D66B000D; Wed, 15 Aug 2018 10:42:32 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id 00AD36B0008 for ; Wed, 15 Aug 2018 10:42:31 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id z11-v6so894897wma.4 for ; Wed, 15 Aug 2018 07:42:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=2QBHJLSndIlhEv9WAsiGy4U1CE6bNUzFCt/babHudhM=; b=ojTUsF3JCNsiyEuvFGrEuWQ4WqfzUgiwWIda/OPLLw6lXmb65f4ZZl45XwX4H1tTRY hywUouBUnrd5xWMj6zwI+bPy8+Vm7gWbOXGnJ1v4uZq0KprIjqZxPJ6aYGsH+YU7aAum nKe0x4iXEPgz33GceZJy4eXVgp+Mj2nOBzG+51TnAIxdxDJTgDR72jWqk+ouqi4U23ED Qr/pg9EXw/H/7TMl03RMSOGDhW3NAX23HKk4pK4XO66m2WEUJGe3Kzl0WfM4pBEsPcug 9EgNHVAdBBFFHvf4dkhXvDnKmlwrnIBDHC4EKdLnWW1j7mNTJmCFkcZFeN5wLEsww0k5 5apw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Gm-Message-State: AOUpUlF4373sPN73zjKKG4aAQODiGONYehqYzC1WjoXTvSsFUN+VCUzr gIQORNxoPm34ksm0vCGieaCZMUHm4/KjnGOZeI6KjgKbhohTk/sNLOJGqSnGbhWhZZd6nOJKxTH S/JmQ3gRN10E4IvjkY8aXi5m4IqM3DHH7yDgH6b1+sAoET5d3XDmmnXFXbgjSxyTWCmqXqzvXvf SENr8jBHNKZbmg5B3YRR4a9/Tk75rDi4XmiN06P/Xr083PdGFSh29LEmuA+Svn8GiqGTstpOo4N 0YIUYFZLsz8F9niUg36JCmRf9Ejm8pnf7w5IcuFhxWfmOIttoglM1G/c/oh0TkZD0jku4YiqRgN B8hGEMQYLz55b149Imnr0WwxAcDw/x96B88uCP0OxbLjzJfvfX7p7gJYaViorpR+1dSc0x6C4Q= = X-Received: by 2002:a1c:8682:: with SMTP id i124-v6mr14382326wmd.77.1534344151442; Wed, 15 Aug 2018 07:42:31 -0700 (PDT) X-Received: by 2002:a1c:8682:: with SMTP id i124-v6mr14382309wmd.77.1534344150746; Wed, 15 Aug 2018 07:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534344150; cv=none; d=google.com; s=arc-20160816; b=iZ79J/6kp7APX5COS+GueD6HUd6JSAm+eIWELxM+9NJ5ld8DrP2aIU+knR95WQA6Id K9tMpaWGmjXWfDOh43qZBuz2/Zy8LwMgo2SXnHWjp/yh4TbVlLEL7wsi3TuRPr91EiZe tr8xrwJQbKGXqyC618R/rE6JEwIuDHIhCt0zvqrZRcf8oCluZ7EQ2CLaxsLingckfGaE 6vZYZFebOvWfbiOtGuMZmRv8RbRsv9+GbKM7im6UjDtw94Qkl6FuzkbK4MuK8WTnSJFr kBeR1E78nW0dtYK7E6A7AQ7B560TWCKPjdVIeDNtRaK6NsoNahLeMTE09/6GA+X+fTwe W5Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2QBHJLSndIlhEv9WAsiGy4U1CE6bNUzFCt/babHudhM=; b=sB/N+FokqHJ5oOYw6W043Mdar/6Y1X4v/5/3oMjCOs+dojJ9y/kMyUKOC2Y5hB6HBT WWBkZ+4TWoDpdp/+MOIhfUdBmh5ubHJfhUmkBTy/PcoOttBN9lDyS42mpGfnBaXVdKP5 55y32svprazuZFG1S46jzBZnCoG8zWFHH+/51cHF3722ZJviFcfiiEnZFvGkJlj/c3Zn le2qRPZEBt4FXj1X6GeAHWAF/NJRaJqr4Ktn2hNhRF6V3t7VoiNgi264wxgcZ0Vrv2yQ QM4YQ3KQeKQw9mSdJvLj8XdLLl9GR+fYQvqDJRoNlsYELasWWR1rIDnuPshCzmEaVJKD YNTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id w13-v6sor8565403wrl.31.2018.08.15.07.42.30 for (Google Transport Security); Wed, 15 Aug 2018 07:42:30 -0700 (PDT) Received-SPF: pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; spf=pass (google.com: domain of osalvador.vilardaga@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=osalvador.vilardaga@gmail.com X-Google-Smtp-Source: AA+uWPzKqdMDlGqLXohO8LNpswrEfFSAkzyS00GXdQhNfSXRbvPIrkJ8BThDgUGJctV2PO/j00kwEQ== X-Received: by 2002:adf:8004:: with SMTP id 4-v6mr17031601wrk.130.1534344150509; Wed, 15 Aug 2018 07:42:30 -0700 (PDT) Received: from techadventures.net (techadventures.net. [62.201.165.239]) by smtp.gmail.com with ESMTPSA id v14-v6sm1271377wmh.41.2018.08.15.07.42.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Aug 2018 07:42:29 -0700 (PDT) Received: from d104.suse.de (charybdis-ext.suse.de [195.135.221.2]) by techadventures.net (Postfix) with ESMTPA id 37B1012489F; Wed, 15 Aug 2018 16:42:28 +0200 (CEST) From: Oscar Salvador To: akpm@linux-foundation.org Cc: mhocko@suse.com, vbabka@suse.cz, dan.j.williams@intel.com, yasu.isimatu@gmail.com, jonathan.cameron@huawei.com, david@redhat.com, Pavel.Tatashin@microsoft.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [PATCH v3 2/4] mm/memory_hotplug: Drop mem_blk check from unregister_mem_sect_under_nodes Date: Wed, 15 Aug 2018 16:42:17 +0200 Message-Id: <20180815144219.6014-3-osalvador@techadventures.net> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180815144219.6014-1-osalvador@techadventures.net> References: <20180815144219.6014-1-osalvador@techadventures.net> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Oscar Salvador Before calling to unregister_mem_sect_under_nodes(), remove_memory_section() already checks if we got a valid memory_block. No need to check that again in unregister_mem_sect_under_nodes(). If more functions start using unregister_mem_sect_under_nodes() in the future, we can always place a WARN_ON to catch null mem_blk's so we can safely back off. For now, let us keep the check in remove_memory_section() since it is the only function that uses it. Signed-off-by: Oscar Salvador Reviewed-by: Andrew Morton Reviewed-by: Pavel Tatashin Reviewed-by: David Hildenbrand --- drivers/base/node.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 1ac4c36e13bb..dd3bdab230b2 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -455,10 +455,6 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk, NODEMASK_ALLOC(nodemask_t, unlinked_nodes, GFP_KERNEL); unsigned long pfn, sect_start_pfn, sect_end_pfn; - if (!mem_blk) { - NODEMASK_FREE(unlinked_nodes); - return -EFAULT; - } if (!unlinked_nodes) return -ENOMEM; nodes_clear(*unlinked_nodes);