From patchwork Tue Jan 22 15:21:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 10775723 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 C33266C2 for ; Tue, 22 Jan 2019 15:22:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B31F52AFF2 for ; Tue, 22 Jan 2019 15:22:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A75C02AFFB; Tue, 22 Jan 2019 15:22:14 +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,DKIM_SIGNED, DKIM_VALID,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 429562AFF2 for ; Tue, 22 Jan 2019 15:22:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B879F8E0007; Tue, 22 Jan 2019 10:22:12 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B36088E0001; Tue, 22 Jan 2019 10:22:12 -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 A4D528E0007; Tue, 22 Jan 2019 10:22:12 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id 657448E0001 for ; Tue, 22 Jan 2019 10:22:12 -0500 (EST) Received: by mail-pl1-f197.google.com with SMTP id v11so15633284ply.4 for ; Tue, 22 Jan 2019 07:22: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:mime-version:content-transfer-encoding; bh=E4viFmDl24z5G5IyzzMsH6GLnu/y+4+GKfTQC9Y206Q=; b=SNJGfX7jFjpbws8VeiPEYn2KSUeE6WkPp5boNxVVqbphd+4XChKS9usQcGf+3Fe6/J ciD4rUH6oRUNJDzZRZfAlAc4XtevjMPugiDMaOgLE5vwnqXTAoN0DcnQr3r1n1krK5UG Cd4gcBZYohj7HDUzuMx0A2h5aK1R6HaBLFx8oXiE8lPe5Ws0hfkSoq+b3zkt9i6uSUjA +HglHRB9VaIFSdG1bXJsBa5ke+aEzgkX0a2GbzrV0nPs0Z4YlNP8M5bHohCcIrbYiRNs 3gRaOm10+iTljuKPfpCFjwV2tgXcbRLlkRJZlPYgQEbN8clMpQhNMlm6z/oohD7ICtxp MXkg== X-Gm-Message-State: AJcUuke22J9IpIv9oBXFWEo2HbZHwMZkO8tVPmvjbYZzOlnP4o6PQDWY cHZPZtVs0nCM8pwWPIpWTIndivS10hxc1AeCAzTI5nLEoMbrrFlleUxBCSoarXiVAQmMS+mv1qI dq87H9yYG6GLlOu+/tUoedlA/GjdhdLmgWRfJCSCd26tDV6kwP3YmD2C4+PHhsxI= X-Received: by 2002:a17:902:7e44:: with SMTP id a4mr34700180pln.338.1548170532107; Tue, 22 Jan 2019 07:22:12 -0800 (PST) X-Google-Smtp-Source: ALg8bN51RmcOo6F+Y547HPLPd4ik4t2BUJcxQqpXfPWGr0ZQ9XNwljGBLfveuDhugHLnHCPQlRdb X-Received: by 2002:a17:902:7e44:: with SMTP id a4mr34700151pln.338.1548170531527; Tue, 22 Jan 2019 07:22:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170531; cv=none; d=google.com; s=arc-20160816; b=RhzWkdBDRp/nDHKFhU3lIDoOisVSxFX/wAevy9GtWhHHs/dStQYwg1HmradPTTZpkt OofFMMUfmbFvxE3rRvLdYVBOaydi3RZrkFXSg0xyalDJOb7Eom+nxUdqECZ077v7DcKC u/DUi/j+sUtMpBLZuLowFrNARB6hyDXx9u+UubbMZf7DG47QmmFKJcjgWeUUpQx6wI2Q ymtMfndJtufcdQK6MByKv6RsDxQIcZjpY/sVzZvnWRiZuWlaUGscHCadir0HAWpQElVp axJHU8ENnxRSl40qx76ffWaaqQUuNV9bRVATHzBRVZkydz8YFu0n4k3MaXMraRoJtaQg 67eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=E4viFmDl24z5G5IyzzMsH6GLnu/y+4+GKfTQC9Y206Q=; b=zSXUf4UIG+f1sf+20JIr/Xjfy2v4CkR5LOCffYXZkV/6ZdoHuPHfNLGLcpjxnjSmxH kMLvNK3kiyIxCn05QmzP0avaIgyYirXYAm49qGXxaq5HVMsvhc0YIl/VozMafVB9Ilno tdoOSkWxUaAVjvaj4G4f93tNE10YZaM/t8HlIQqdNBXfUh7nonlsoh9rbHxlUhrfR+PF +8ObtAN4WUi+LloZozl0ArBijXUdO7YGXKG1pudryotnNo8//FyS0bzAb14lbrgeOeYF qPRNzCezM1Wr2O/8ajPivlgbwF96tN9/BDEiDrbgYb7l3fI8Q6kXh9xC9YIbiUDUtuOq miyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RRLG7bew; spf=pass (google.com: domain of srs0=915k=p6=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom="SRS0=915k=P6=linuxfoundation.org=gregkh@kernel.org" Received: from mail.kernel.org (mail.kernel.org. [198.145.29.99]) by mx.google.com with ESMTPS id o3si15026155pgi.388.2019.01.22.07.22.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 07:22:11 -0800 (PST) Received-SPF: pass (google.com: domain of srs0=915k=p6=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) client-ip=198.145.29.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RRLG7bew; spf=pass (google.com: domain of srs0=915k=p6=linuxfoundation.org=gregkh@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom="SRS0=915k=P6=linuxfoundation.org=gregkh@kernel.org" Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E05B9217D4; Tue, 22 Jan 2019 15:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170531; bh=rdQqRvE6bRp8PqN9mm0dC6LLrunUx2tWmydq03JT1EA=; h=From:To:Cc:Subject:Date:From; b=RRLG7bewpKJ03na93ToeZeKB+ZA4TOW64COQunfps4NwaUJTWpcgYyw7UHcLY6nqa 3EvVaZcl728K1hzrIPzG3RQ8vKXtSL4jYV2ha0cYtqfsOAn567qzav0s+k1D3M3haK tbJRlEdRhqgE6btV7xSGfxOwXSq/G4GJCcV+Ldoo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Catalin Marinas , linux-mm@kvack.org Subject: [PATCH] mm: kmemleak: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:21:12 +0100 Message-Id: <20190122152151.16139-13-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Catalin Marinas Cc: linux-mm@kvack.org Signed-off-by: Greg Kroah-Hartman --- mm/kmemleak.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index f9d9dc250428..d45bc65db5fb 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -2124,14 +2124,9 @@ void __init kmemleak_init(void) */ static int __init kmemleak_late_init(void) { - struct dentry *dentry; - kmemleak_initialized = 1; - dentry = debugfs_create_file("kmemleak", 0644, NULL, NULL, - &kmemleak_fops); - if (!dentry) - pr_warn("Failed to create the debugfs kmemleak file\n"); + debugfs_create_file("kmemleak", 0644, NULL, NULL, &kmemleak_fops); if (kmemleak_error) { /*