Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7478463imu; Tue, 22 Jan 2019 06:43:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6AMgdyUHckipUb3KMFlOajN2mKbSlJD69/APwspT2HRLtL9rKNjg6MZ1dl5RI/lnnmXLed X-Received: by 2002:a62:b80a:: with SMTP id p10mr32389912pfe.32.1548168203498; Tue, 22 Jan 2019 06:43:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548168203; cv=none; d=google.com; s=arc-20160816; b=TQiJ0Q7njgtVqvn1g+3QrJ8Gd6rE2c7a41uFfhilnR0nrIu7mnz9gKJYrgRL4KTEio 0QqzF+D9H+a0TMnkVxRjAasenPtQqNCABdZXhyeBh+z4fAV6ZrsMERhO3P6Zr2los4Fe 09GkyhNCrXWy+clMki9RSzAvGD5UkRSkF58s2b0YV7O1YWkXxM/OXZf5RPSNQ7h0Qaq/ 0Fi//hqb03809klW6aCbDwaZLJUrePQkB5EI0JQDXK6pAT14TyTOdhfy9On7Xs+Zj1Ti czO2+KFpoWTMf4jYUJIJIgRU2slvX6N8fpIQAwU9AKfR48N7ZkoxCSI7Hd76hpwm7ZvB 8MXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3Q8E4bMOJopys5wlGcT2B2mx35w4ekrQS6y3elkMVUc=; b=QMdi25qQ74OG8JiPYw9UTYnvtlfyr0q2leDIWez0RqbnOnn1EIYU52qovPED7HQPL4 JKR1wPmbjA983ap871cUQcbKmOnNRrcZC2TyFuiKgUeaf8iS0JHAjMYjRaIpeNG6ZJmd Zw9LzsUAyiUpuzySpwkyx1QprWi5f+mGr+sCsT/Uhsr3p/37519W7OfeHAahLbe2sQrg nrxd6x5fqM0RHNYFQYyhl7QTi44bnTQ/gRJB15SAlRvPvaILHrBQzrrtwTgJIvoGCCO6 nnW2jfCEOKmwdAoK0bS3A+ZPEZ/uNi8A6MpBtn8wGQ63ZsT4MlsdT74pVxuv/TV4xdmd Cb9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y4R6ZdqH; 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 41si11168261plf.347.2019.01.22.06.43.06; Tue, 22 Jan 2019 06:43:23 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=y4R6ZdqH; 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 S1728936AbfAVOlh (ORCPT + 99 others); Tue, 22 Jan 2019 09:41:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:53436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728865AbfAVOle (ORCPT ); Tue, 22 Jan 2019 09:41:34 -0500 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 8706721726; Tue, 22 Jan 2019 14:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548168093; bh=2rmGDbNBH5/CgNPKDpWNXtKTH4HHX/G4IW9TDzzgGyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y4R6ZdqH4OIMvuO7z1or3zb3XXTVumm17TBMgneiIksWziTj8hEe7lOFOjwoCTc3E xgUf9h5mZU5N8XBSmEaBkYni3VOwpyr1Y0sX0TgUZc8PgjrRznLHn+aOIoNH1MQQJ3 RnxL5OXNXPDTpUhG1x/iu/n5Up5DzqPerX52Kszg= From: Greg Kroah-Hartman To: Catalin Marinas , Kevin Hilman , Russell King , Will Deacon Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , Paul Walmsley , Aaro Koskinen , Tony Lindgren , linux-omap@vger.kernel.org Subject: [PATCH 3/4] arm: omap1: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 15:41:13 +0100 Message-Id: <20190122144114.9816-4-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122144114.9816-1-gregkh@linuxfoundation.org> References: <20190122144114.9816-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Paul Walmsley Cc: Aaro Koskinen Cc: Tony Lindgren Cc: Russell King Cc: Kevin Hilman Cc: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-omap1/clock.c | 63 +++++++------------------------------ arch/arm/mach-omap1/pm.c | 7 ++--- 2 files changed, 14 insertions(+), 56 deletions(-) diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index c8c6fe88b2d6..3d7ab2bcf46c 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -990,84 +990,45 @@ static int debug_clock_show(struct seq_file *s, void *unused) DEFINE_SHOW_ATTRIBUTE(debug_clock); -static int clk_debugfs_register_one(struct clk *c) +static void clk_debugfs_register_one(struct clk *c) { - int err; struct dentry *d; struct clk *pa = c->parent; d = debugfs_create_dir(c->name, pa ? pa->dent : clk_debugfs_root); - if (!d) - return -ENOMEM; c->dent = d; - d = debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount); - if (!d) { - err = -ENOMEM; - goto err_out; - } - d = debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate); - if (!d) { - err = -ENOMEM; - goto err_out; - } - d = debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags); - if (!d) { - err = -ENOMEM; - goto err_out; - } - return 0; - -err_out: - debugfs_remove_recursive(c->dent); - return err; + debugfs_create_u8("usecount", S_IRUGO, c->dent, &c->usecount); + debugfs_create_ulong("rate", S_IRUGO, c->dent, &c->rate); + debugfs_create_x8("flags", S_IRUGO, c->dent, &c->flags); } -static int clk_debugfs_register(struct clk *c) +static void clk_debugfs_register(struct clk *c) { int err; struct clk *pa = c->parent; - if (pa && !pa->dent) { - err = clk_debugfs_register(pa); - if (err) - return err; - } + if (pa && !pa->dent) + clk_debugfs_register(pa); - if (!c->dent) { - err = clk_debugfs_register_one(c); - if (err) - return err; - } - return 0; + if (!c->dent) + clk_debugfs_register_one(c); } static int __init clk_debugfs_init(void) { struct clk *c; struct dentry *d; - int err; d = debugfs_create_dir("clock", NULL); - if (!d) - return -ENOMEM; clk_debugfs_root = d; - list_for_each_entry(c, &clocks, node) { - err = clk_debugfs_register(c); - if (err) - goto err_out; - } + list_for_each_entry(c, &clocks, node) + clk_debugfs_register(c); - d = debugfs_create_file("summary", S_IRUGO, - d, NULL, &debug_clock_fops); - if (!d) - return -ENOMEM; + debugfs_create_file("summary", S_IRUGO, d, NULL, &debug_clock_fops); return 0; -err_out: - debugfs_remove_recursive(clk_debugfs_root); - return err; } late_initcall(clk_debugfs_init); diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index 998075d3ef86..d068958d6f8a 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -539,11 +539,8 @@ static void omap_pm_init_debugfs(void) struct dentry *d; d = debugfs_create_dir("pm_debug", NULL); - if (!d) - return; - - (void) debugfs_create_file("omap_pm", S_IWUSR | S_IRUGO, - d, NULL, &omap_pm_debug_fops); + debugfs_create_file("omap_pm", S_IWUSR | S_IRUGO, d, NULL, + &omap_pm_debug_fops); } #endif /* CONFIG_DEBUG_FS */ -- 2.20.1