From patchwork Tue Jan 22 15:21:09 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: 10775739 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 1FC301390 for ; Tue, 22 Jan 2019 15:23:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FE1128505 for ; Tue, 22 Jan 2019 15:23:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03D232AE42; Tue, 22 Jan 2019 15:23:28 +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 8DDFA28505 for ; Tue, 22 Jan 2019 15:23:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73EDA8E0008; Tue, 22 Jan 2019 10:23:26 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6F0E18E0001; Tue, 22 Jan 2019 10:23:26 -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 605C68E0008; Tue, 22 Jan 2019 10:23:26 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by kanga.kvack.org (Postfix) with ESMTP id 233D38E0001 for ; Tue, 22 Jan 2019 10:23:26 -0500 (EST) Received: by mail-pl1-f200.google.com with SMTP id e68so15609712plb.3 for ; Tue, 22 Jan 2019 07:23:26 -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=dZ2fSUNgLRnhhP2BrzWQZPDKJTTGrJeoZZ3Q5Y1qRXM=; b=iGw2UlWQ+dKnmlc+VjQ/yW+YVMVa8GI0AHjIRhDx7kRyZ9eztUAPt67xbyBT8uELVA cVOIV+kSq/wdA3Ydj2zbo1AlnF8ufPLr37gmdkpOuDkDJM+72P/d02rsSDY0AhyuKAwN ueZum1cCKIQ45J8BEc6C3/qgnaYDnMJSh4cnHFssK5Etz4haVeWbhc20TP+3BgTft5E0 2QCGLFgQAtttokAeU9QVtHx07GhFDKPzI1tWb40+BC4J9EVyGv++sxI70JEazdGtwzc6 bOESePx4tpepg3CuS9EkNU/6LweL0B6mU621hOCznhI3bReo8Eazi+kczC4SY35D02GB Qumg== X-Gm-Message-State: AJcUukf08TOY0ZGRTk+DwEuc7dbBb7/ArpHhS+Nydjle4sbm36SzJ/OA /NwMgZulZvBtyvHNcD0oxw8bUwxnU+7rf0QItD1utnUJ8I0I6YL2pA6y2hLxJesSKPH9fO3cLVn vO3r11OqJ53qtWjdbVl8n3pgu4YJoXlHEGa1cmtfbTIpJYx+E9ZUwNd3jD+hJxuM= X-Received: by 2002:a62:26c7:: with SMTP id m190mr34372466pfm.79.1548170605756; Tue, 22 Jan 2019 07:23:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN5z6mzSufNoqgDAK/exuHcHkib077TxXmTJNp1DZ5qmMZaYZ2/DBqok23Kv+OSaAljm3GeC X-Received: by 2002:a62:26c7:: with SMTP id m190mr34372446pfm.79.1548170605203; Tue, 22 Jan 2019 07:23:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170605; cv=none; d=google.com; s=arc-20160816; b=k7OWQ/qJHkzoW0wBmYUHtWk08lK7aBgsnO7+ON6OC/B5qZaZdfATddKtszZXtFuICF emqNGVLXAjgUf2DLexniDrZxLAbkRF4OyKKglU85bIG9Ho8i1jt0cfkLgsvrhV5KZLUY hGXRT38osbDNL0G7v7rzyBdwBysBU/VDsXN2MNiwzVjQZVY5wJMaEUAGONoirDTOML6N n2oVAUt6pO+u554vuqlkOVZN1/93VO9N0ldnr7URlynIJl2qZ782fn3imc/1t1snAeVx Dsoks3aPo/yqCdghJFMr8L4Dc/zHPZrSIXIyb2xIZlU9VVeaub3i1curbPRMBn7ZBBKJ iAvg== 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=dZ2fSUNgLRnhhP2BrzWQZPDKJTTGrJeoZZ3Q5Y1qRXM=; b=OCZ8havlr6monmJgQyGdM8uRn6pdL7JG0eXxynjHfPGqOmnRUuCMbTkvF1vXWflLRy hWzU2jkMfRBm5UojTthNcualYZd64BHZm3449t5gcDeNwMQZTP+/GeU9NPmMOtEso9mj rOI4kT0wIcw97LYtzO0s1+A4UtNO37hkVqY8nrtoyc/icPHzhBE6pptjWzAvZs/16QbN KbOoQVU0RiUVd282dXdbVlIZCcz0un1/Me9QjlZw5tyavxu1XJQ+uaTIdQGygoUSvNra n1T5hDeML6p+AOpOlJcSxvJuol0QrEF/83QOp70+8wNyen/w9YBNuLQcC7puSpARtLII UvBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2RVF+90P; 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 j17si5395880pfd.113.2019.01.22.07.23.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 07:23:25 -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=2RVF+90P; 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 640F8217D4; Tue, 22 Jan 2019 15:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170604; bh=i9+4GiLYRtmtv3ir+rbnVncJd83gUJJKoqTnAuitgYc=; h=From:To:Cc:Subject:Date:From; b=2RVF+90PHUspuFyfrOJlpHopGsdIkh6jBP4DMuRChHm7DCuXC64LSiW9J8+8v6PRt oZmSkuGjVysIKnYVjs8XO03fgyCO9h41DpBhJE4DEuvwJQTtOMsKCL13NOiK7UQoNg AyNqLE1HKmb+hiseg7GdQwmWIS/IJpKPkRO4S8DE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-mm@kvack.org Subject: [PATCH] zsmalloc: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:21:09 +0100 Message-Id: <20190122152151.16139-10-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: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky Cc: linux-mm@kvack.org Signed-off-by: Greg Kroah-Hartman --- mm/zsmalloc.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 0787d33b80d8..1347d7922ea2 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -575,8 +575,6 @@ static void __init zs_stat_init(void) } zs_stat_root = debugfs_create_dir("zsmalloc", NULL); - if (!zs_stat_root) - pr_warn("debugfs 'zsmalloc' stat dir creation failed\n"); } static void __exit zs_stat_exit(void) @@ -654,22 +652,10 @@ static void zs_pool_stat_create(struct zs_pool *pool, const char *name) return; } - entry = debugfs_create_dir(name, zs_stat_root); - if (!entry) { - pr_warn("debugfs dir <%s> creation failed\n", name); - return; - } - pool->stat_dentry = entry; - - entry = debugfs_create_file("classes", S_IFREG | 0444, - pool->stat_dentry, pool, - &zs_stats_size_fops); - if (!entry) { - pr_warn("%s: debugfs file entry <%s> creation failed\n", - name, "classes"); - debugfs_remove_recursive(pool->stat_dentry); - pool->stat_dentry = NULL; - } + pool->stat_dentry = debugfs_create_dir(name, zs_stat_root); + + debugfs_create_file("classes", S_IFREG | 0444, pool->stat_dentry, pool, + &zs_stats_size_fops); } static void zs_pool_stat_destroy(struct zs_pool *pool)