From patchwork Tue Sep 12 08:26:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 138365 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp599793vqx; Tue, 12 Sep 2023 11:26:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZ6D2joaL9MVux6fF3Iln1Iv29ePaKnrVw4o7tSbUDQrH/+nAml5jKtZdgNzF/G+HFPjF9 X-Received: by 2002:a17:90b:4acf:b0:263:f4cc:a988 with SMTP id mh15-20020a17090b4acf00b00263f4cca988mr94667pjb.5.1694543209771; Tue, 12 Sep 2023 11:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694543209; cv=none; d=google.com; s=arc-20160816; b=uqD22MrrXZLsbp9rNT+tX0FlKI4h6t5uPEZbP1IwHa/kRHFuxuWyi5VQY//r6obRIm lN3BmEizvqxtdAVkm/BiJjs0y2uIRgxhTUE/ZqydmHGMtQxiz51XFn45hbYWbdVo7zLg XrXpaQLrOmlrsGWfTMW5P7YSAxWJIe44/QI7RkvAGoLOQDVsvCeLelBuGUbnVbec7IND 4TmNNHaK1V/E28YQr/7KemIpo1EpVorNsR++G2MeyFY0REOqMU1ELF8kb1meQO84rNro dEPyXE2J4dQLqvKAJXU2sj89ixApfS2CNHw9XkxlqkGbuqIsT6AnqC9EPmAWRw4jhp8r oHOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=R5ZWDB1FqFuWIcPP5uo4y/kiHrFaFSG3Le/UDhdwTss=; fh=2PeE0S4lccGv8Pli/cGW5q/UpM//xUnv+1ene7wDScw=; b=uTKwcEKemv4ncYplb8qLBXyQCoC6OcbCEUgM76Pip6lNz2UdxKvazAUmGI13QAHBMs itc7SME0dZynCW/ezXC0kLT7lO7muRXseG44vYSnlbdH7sEX95TcKsQH62qJhLHfj9P1 H/faqv/O644BsmzNHS0Y07F2onqW2LlUOW4EgsSKy6zPnk+SL81gmIRa5KczcsrF6uTu GHzCqDawWA2HmH+EcQiM/g1K9QerTIYRvQrKuR/OGLbxoGzGXUNG0TN8oODNLfna1ix7 IIEt8Tv/BlA6fDyyRtTHvHCUo9qM/CGHwcDBEmzXsxOirflGgVdriIieJIHmNL/xBG2v pJZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=LisAvLo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 9-20020a17090a0c0900b00263e423753dsi8329246pjs.42.2023.09.12.11.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 11:26:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=LisAvLo5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 852E982952AF; Tue, 12 Sep 2023 01:27:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbjILI1D (ORCPT + 38 others); Tue, 12 Sep 2023 04:27:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232520AbjILI06 (ORCPT ); Tue, 12 Sep 2023 04:26:58 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB1D210D7 for ; Tue, 12 Sep 2023 01:26:54 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-401b3ea0656so56425095e9.0 for ; Tue, 12 Sep 2023 01:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1694507213; x=1695112013; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=R5ZWDB1FqFuWIcPP5uo4y/kiHrFaFSG3Le/UDhdwTss=; b=LisAvLo57XxkUFPNZ04wZ6MVrPqXudZtvjtSSmebJodiaTFUwCreF+EVZRkcusP5LJ pr+ZWdEykKIe2tql54QONnaHuWwkaHgJOIMobRS4y5ST4iqm5l12d6Yf0IPOsQHaFqjl rXR7cN1chsUosw76CuGoX0dcf8gfTj3GxlNlkpckcYlRMVrOCOqH+RnaaCpqh7q0E4Kv iPWdL/HPfJSgCJGbZ78zdAD12UVz506de1+WygNRYgSSmCwSI6hq7hAnMlICA3+BZkzA C5pmbCMAdOs9CCsIAKmKsw4IyctPesi0vIwm+O8T6CA8n2YTdV6hCa8/C2w78LsCKz/R YuiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694507213; x=1695112013; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R5ZWDB1FqFuWIcPP5uo4y/kiHrFaFSG3Le/UDhdwTss=; b=ZDnHvenbr8e47D7t8+zFfI3DY3O9/ERJspnkIipLtxsnKzYw9USGOEsIjw+gUOj7zJ 672z3KMlxO7XECknFgfKgvEBKZaRFGGAhXTQKY98pBOomN+0YtAUYAMWYKeAKnfH6RDN a4rC1wWE021fuKg0Ikb4npsK3Y0G2PWhH7EbFHCXCN9szHgox7sIOsYUfpFZTxvo+Kgo Vwi0RUEmMuptps3j0SUBzqJqpfdSvPKvd/vczXVTxCxZFQRA0yj+c3rMSDdavNZ2pPlY CjbCX9zS5Qj/1igISQRAMexqHjdOnsxbWG1nLn1T9trYnLFvrpwcurNuQdmoIAPbfYLN AOmA== X-Gm-Message-State: AOJu0YwjcQzdi/SFNlqp5pM3m9k3WaEi/X9EqKsq/wlP2avXB/0weWH6 R94cCw1XOVOv/qhVqFCqDp003g== X-Received: by 2002:a05:600c:3b9a:b0:402:f5c4:2e5a with SMTP id n26-20020a05600c3b9a00b00402f5c42e5amr11179870wms.37.1694507212943; Tue, 12 Sep 2023 01:26:52 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:907f:4cd7:f0ae:6b2a]) by smtp.gmail.com with ESMTPSA id e10-20020adf9bca000000b003143cb109d5sm9793110wrc.14.2023.09.12.01.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 01:26:52 -0700 (PDT) From: Bartosz Golaszewski To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Peter Zijlstra Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] slab: drop unneeded NULL-pointer check in kfree auto cleanup Date: Tue, 12 Sep 2023 10:26:43 +0200 Message-Id: <20230912082643.13144-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 12 Sep 2023 01:27:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776851717370887168 X-GMAIL-MSGID: 1776857340892686046 From: Bartosz Golaszewski kfree() already accepts and silently ignores NULL-pointers, there's no need to check it when running the auto cleanup routine. Signed-off-by: Bartosz Golaszewski --- include/linux/slab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 8228d1276a2f..fb709ed506ba 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -228,7 +228,7 @@ void kfree(const void *objp); void kfree_sensitive(const void *objp); size_t __ksize(const void *objp); -DEFINE_FREE(kfree, void *, if (_T) kfree(_T)) +DEFINE_FREE(kfree, void *, kfree(_T)) /** * ksize - Report actual allocation size of associated object