Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp475487img; Thu, 21 Mar 2019 02:11:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqybqKlk7jXAf/BaKzlyqNuJvDcTl7/lmojATRGUgAuTZ7TDMz/4Yw7pP1Qkr1gXT/FW36/l X-Received: by 2002:a17:902:8697:: with SMTP id g23mr2536197plo.30.1553159493449; Thu, 21 Mar 2019 02:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553159493; cv=none; d=google.com; s=arc-20160816; b=kgOGh+qIxdhkC6Qn0fhcaL4aPtBv695TbD7GKeeMUhJjf6mjAddpitMVNGsCCIm66b rrZcx8R2sGOyowr8HKgWA/91CAYpKQdmcMIM0dZ7NqK2qjoa6vWyL5ceJUUg8m9/KBgM WqlOE8IGMme7kfrXwmVNJ7TN+qc9HbfEt9I8Te0tvBleFPOkVMhWwIgCSa3cj1W2Y3fW bFHyTcXn6huPl62aX/3/y3txEmwunupqDuZBD0kGL5j2DWzgXUIC4obo/j95nsqtpaRW V+bHuk4InutEyCFjapM1pV2QrBAH/GG4pZlXvu/NK6YLAqrdGnK4diTyYlWuN2c0eOfi XQjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=T/RBmy9i1McFQwLyvaOyo+vk6q6MFt8aNw7uCgro6dg=; b=gx8Os8RBEtmWrN++sxj1Qnmup1K6oGTrLT1qhbiA/7G+ryzK6EJf1yZhxeXZpyMW9J XS4biDllIyJJgFGtjwnGlnQ3C8sN+aczt9pwSB81X/Vl3P/fgTYnPpAJoCva0T4gSzjY 4ToYCBnwu5Y/lXWWBi6twl8xY+DUqxdvs3J1xWxmqOZJAmBlYe6qCWZkjjbalRfTA3/r /gJbTD/E30g6wakdE9iLq3jtkrYk6GoLZ9ItTbK7ahOeQz+9+U98OtHAPDkM3OIx/jL/ KqKgjszTve3hEe/98zmmwnR4S1zfHhsxhb4YyHnJYA0B4U9QwLqZrLSnZdsvqH2rhVAe IAMw== 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 v34si3711078pgk.320.2019.03.21.02.11.18; Thu, 21 Mar 2019 02:11:33 -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 S1728072AbfCUJJ0 (ORCPT + 99 others); Thu, 21 Mar 2019 05:09:26 -0400 Received: from mx58.baidu.com ([61.135.168.58]:46641 "EHLO tc-sys-mailedm04.tc.baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727931AbfCUJJZ (ORCPT ); Thu, 21 Mar 2019 05:09:25 -0400 Received: from localhost (cp01-cos-dev01.cp01.baidu.com [10.92.119.46]) by tc-sys-mailedm04.tc.baidu.com (Postfix) with ESMTP id 5CB17236C05B; Thu, 21 Mar 2019 17:09:13 +0800 (CST) From: Li RongQing To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , Joonsoo Kim , David Rientjes , Pekka Enberg , Christoph Lameter Subject: [PATCH] mm, slab: remove unneed check in cpuup_canceled Date: Thu, 21 Mar 2019 17:09:13 +0800 Message-Id: <1553159353-5056-1-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nc is a member of percpu allocation memory, and impossible NULL Signed-off-by: Li RongQing --- mm/slab.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 28652e4218e0..f1420e14875a 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -990,10 +990,8 @@ static void cpuup_canceled(long cpu) /* cpu is dead; no one can alloc from it. */ nc = per_cpu_ptr(cachep->cpu_cache, cpu); - if (nc) { - free_block(cachep, nc->entry, nc->avail, node, &list); - nc->avail = 0; - } + free_block(cachep, nc->entry, nc->avail, node, &list); + nc->avail = 0; if (!cpumask_empty(mask)) { spin_unlock_irq(&n->list_lock); -- 2.16.2