From patchwork Tue Nov 6 15:02:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 10670675 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 4993515E9 for ; Tue, 6 Nov 2018 15:03:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39A472A4D4 for ; Tue, 6 Nov 2018 15:03:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D3E32A4D3; Tue, 6 Nov 2018 15:03:15 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 B1EB32A4D3 for ; Tue, 6 Nov 2018 15:03:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63A176B0336; Tue, 6 Nov 2018 10:03:13 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5E9296B0337; Tue, 6 Nov 2018 10:03:13 -0500 (EST) 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 4DA9C6B0339; Tue, 6 Nov 2018 10:03:13 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by kanga.kvack.org (Postfix) with ESMTP id 0987A6B0336 for ; Tue, 6 Nov 2018 10:03:13 -0500 (EST) Received: by mail-pg1-f199.google.com with SMTP id f9so3848679pgs.13 for ; Tue, 06 Nov 2018 07:03:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id; bh=MLHVDltbxTflwlSL2wkItnD4F7UYXdnExQ6+eby17cU=; b=IypmoLveYuvp9J6zFcZLuwK238GweNQ+3yXGWBs4+siKyh93/dITjpAIlWPXoLcnNf w1a2jEFSAIEakIJeKIGAxiJ9ohNjTPUR0SDqDhSqGu4pkIqQpATSCJCMK4ayGwaunvgS ihKfcuele/x+IVw86wtqgCOFGTf08FcJ2LgGcqTmK8WIQuncegRV9moiebm5Rk3A4pDu pzACWpJioE9WzE7JHgzVRNC1KrBPImxP1ec3ritGi5RPGkrYzMzIo1W2IIqngRdXU+in gSRfnDbyYl2DH2Xs0s7ZHZ9uWDq182ZWMYRqm1Dmlu2IhZ0i1Vwvffl1u9lkipCvpOxH dyHA== X-Gm-Message-State: AGRZ1gLmowHw8hDb7MIkARyOGAJBShuqpqBsvYUNhQmWwSr+Lyn4PS9h JNLl9RiqbEz5HkG0jDnuUmS3cIAgEsSaEkcYG5AvT9uxGhcrdnMjeaouCwNP9RwTMgn83waa09G RnQj86CXYoy18AIurFhaKs0t04uf7g0DLX7W4c+qxiy20Dka9j7QZ5XITCW4p9cBA8KnZMypaYK vL/aKDrLsBtr//XjMFib4aVZDZoMZ/LwZsmMOT1QOYzdAEgsknZJIlTEqXaVa1MCUZjowA6Kx0j yTuf2wayPpyhqywoNbpy0+T6tUAWNW4F7YaxA6s3mPdBA3mXsGyE7P41Nz5E1pOMMfuZALqq2gi K8pNKteZL4mZbED2seDjOoMKjupS75z9TkyY/sIPLgZuFRCX2ZWm1WjToRM6+2tRCwI8pr7Nxuf T X-Received: by 2002:a63:6cc:: with SMTP id 195mr24407699pgg.52.1541516592584; Tue, 06 Nov 2018 07:03:12 -0800 (PST) X-Received: by 2002:a63:6cc:: with SMTP id 195mr24407641pgg.52.1541516591763; Tue, 06 Nov 2018 07:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541516591; cv=none; d=google.com; s=arc-20160816; b=qP1f3xcLFUZl2NlFckYYh9ecw3OfoKIcqaTCYUhCgizeDBDCgxZjK22cWPSH+s48I8 WfG4mP2SL8ACxdLSf/0E1iZHJGnfq9JGn6Y/tTc3m1mKb4ThXlu28ECMgDU0TL6Hv08E kGruI30sguBH75XkYucwwWi5iMbRdMmye2ZHGwD87MPzcO87zvmZiWQKS9gYA606lU9l C2bvSj8vRE99O3L4cWDReFw7wymzTB4G251JvyBheuqJSy5eSSAfmAwRsPtXS/69hFht QTrCfxdGPDuSrTVnAAqPkfFn087Ds2lDdr87fX4dFgm5amZF401T/dNNA1KW/XTk1G3M tvZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=MLHVDltbxTflwlSL2wkItnD4F7UYXdnExQ6+eby17cU=; b=LBzczSkpcMPW2LxASTHk6B96IrqiX6Mi0Tewk82GWfnD+Tyni6MvuefPXyAuq7HIpF fyJauLkvs8U8YG4qPsCf9lRBFn3cFDwn+0Qwo6SXHhoHxkSN9VLIYeBKb+PFEKof5hv1 gRmIzf+wshOxr4+MFjb0PlkKaX/TWkCJwLfTSSNOisnZ/l4zAJKriN4bbS7G1m1E8suK EqtYYMyEuc0rgbvEb49wrFzcdQVzaGUUvEQGkjp6y4oZ9znEtvAa/ujpd3oYB1oXyJrK g3CMKlwoEmbM7/jbHRK3VlhNyEl+9DBj7Kl4hEG303Juo6O5skmN7dwWVD6jHe43kiUu bpng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S6lAKKMZ; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=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 n27-v6sor38081092pfb.48.2018.11.06.07.03.11 for (Google Transport Security); Tue, 06 Nov 2018 07:03:11 -0800 (PST) Received-SPF: pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S6lAKKMZ; spf=pass (google.com: domain of richard.weiyang@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MLHVDltbxTflwlSL2wkItnD4F7UYXdnExQ6+eby17cU=; b=S6lAKKMZ7UJz1mzciHO+3JhLBEycaI2OnKP+Wp//MmPpZLymBrRZjswUKICvFpG0vr lJoMu3S1gAK4tZ/vIquhdR4t3jx4PWS0APVVvfoyyVGdPHmzX0P+EDqbJ+kZL6cswrCm OiHSE+PSCVXKHYrjXdYWNkt+UX2aYQydQtDa7687T955bRR2PCBSeLsvGo3jTJeysxyE Sd6yuvjaDFhvmnWOONdxxUL96kLDvl105t90Igc8BKJ+WTxAe5RZ5+tt9rhAwbhXu7ty Ejc7IwTqJllkl8HcDNYzuaV5lVWTRy/3rFXtpxL7fBywP84xq3L11RxNKWVFqAt7uS8t m4rw== X-Google-Smtp-Source: AJdET5cMMLOocAMbJsfE+FLLRAgdhfae2JSP/F4Xz1E0IAKppvILkCtnQEbWnYYqNKVTw9XmR30a1A== X-Received: by 2002:a62:1803:: with SMTP id 3-v6mr26523179pfy.21.1541516590786; Tue, 06 Nov 2018 07:03:10 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id l16-v6sm64024083pfb.75.2018.11.06.07.03.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 07:03:09 -0800 (PST) From: Wei Yang To: cl@linux.com, penberg@kernel.org Cc: akpm@linux-foundation.org, linux-mm@kvack.org, Wei Yang Subject: [PATCH] mm/slub: page is always non-NULL for node_match() Date: Tue, 6 Nov 2018 23:02:45 +0800 Message-Id: <20181106150245.1668-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.15.1 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 node_match() is a static function and only invoked in slub.c. In all three places, page is ensured to be valid. Signed-off-by: Wei Yang Acked-by: Christoph Lameter --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index 90d26063be68..af8bea511855 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2365,7 +2365,7 @@ static int slub_cpu_dead(unsigned int cpu) static inline int node_match(struct page *page, int node) { #ifdef CONFIG_NUMA - if (!page || (node != NUMA_NO_NODE && page_to_nid(page) != node)) + if (node != NUMA_NO_NODE && page_to_nid(page) != node) return 0; #endif return 1;