Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7495556imu; Tue, 22 Jan 2019 06:59:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN5FVaj6YarOXiwhwe7xWFhKONTM5z9WIKj3WnFyNPPwQPwea+zI/OKuSIWR2NkxCat133hH X-Received: by 2002:a63:fa58:: with SMTP id g24mr31633983pgk.390.1548169197225; Tue, 22 Jan 2019 06:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548169197; cv=none; d=google.com; s=arc-20160816; b=zriFufRBxCJn7dpv4ydw5cdS//x9zX5BeFZOsHSLnnVy4HSj9SeA0k7fUP8+R/9517 CLex966xOZGTIXo0kyYNANVdkkh4/pgm2udozsKToTlbCISk9ezm5ZwoBfqbupsh1u+G Z78/37JaDbr8qyJgvSpaSiTE1za8F7kmSpnt7iDnHpuPqxVVcCGQuXHPiV/HBHNwjKJH KDfR+OJjzclaE6bSXEoOG+zCkMbpMSx3Q72eTHCdn7C4WERSo1PYZLpzBxbaj0GbAkvk 9Gkpjqo1oedUNYd7w6g1aDqoQpyqN7603Vh3cq9rXCO6uZNJEz7+nDIai69C0u8hOWdV 2wFQ== 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=W62gyUZ+uDxoUVca4kiCN7aXUdzrpjY1hX5Jsb/St6k=; b=z0iQrvY3e1eMthoIEXlNBBJjQur6n3Tp/+yecpNBTW07I1CS+Ql4IbX1/73p1rIa+D Wz7KhxDjqszWQVAdJ4I5H2zv5+9DOerHOHP2fQyIx945+WtwQiXg5ZwJrrkjBBV47Idm c8zqNBZNqc4o3UNHtsJfBVV5Xu9GQ/N87Dlsl1fNp+ioEIItZPCttQPz52CmHCHt319V sGlTjRV9RzRCwKdgi7ZQKdgn2YtqjXBdwdVGmJDsjpf5cS13aWbciP1VeNhx+X7vtdrq jMx8LtunbYfpjr7MLoG3+Duhl3HUk5Ip2+1eoYxxrWHisfx5PP0BvjSSlt1yT8fNTdLw dKXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GdMmuXJI; 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 a124si16153329pfb.263.2019.01.22.06.59.41; Tue, 22 Jan 2019 06:59:57 -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=GdMmuXJI; 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 S1729058AbfAVO61 (ORCPT + 99 others); Tue, 22 Jan 2019 09:58:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:37686 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728795AbfAVO60 (ORCPT ); Tue, 22 Jan 2019 09:58:26 -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 2B92120870; Tue, 22 Jan 2019 14:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548169105; bh=ijoguKNKOW+osmpm75miT/X5mA7FLeCrfFSkQYzCLyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GdMmuXJIUex6E0yvEJjiR1dfB+EgfOXd3I43lGsMd6RYWP3/YoytwvkAfTgr8WNef If5ecDa5P1W6ve+sShfCSfp5xI4XOZRZP4/zhe7Z4e4n9za+RVFWUW8FzNaQw0dNf0 a5D3OSQ1xdGblwJIYvUJbnvhCT7zJqz+tX3Wj9j0= From: Greg Kroah-Hartman To: Ralf Baechle , Paul Burton , James Hogan , John Crispin Cc: linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH 1/5] mips: cavium: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 15:57:38 +0100 Message-Id: <20190122145742.11292-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190122145742.11292-1-gregkh@linuxfoundation.org> References: <20190122145742.11292-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: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-mips@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/mips/cavium-octeon/oct_ilm.c | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/arch/mips/cavium-octeon/oct_ilm.c b/arch/mips/cavium-octeon/oct_ilm.c index 2d68a39f1443..0b6ec4c17896 100644 --- a/arch/mips/cavium-octeon/oct_ilm.c +++ b/arch/mips/cavium-octeon/oct_ilm.c @@ -63,31 +63,12 @@ static int reset_statistics(void *data, u64 value) DEFINE_SIMPLE_ATTRIBUTE(reset_statistics_ops, NULL, reset_statistics, "%llu\n"); -static int init_debufs(void) +static void init_debugfs(void) { - struct dentry *show_dentry; dir = debugfs_create_dir("oct_ilm", 0); - if (!dir) { - pr_err("oct_ilm: failed to create debugfs entry oct_ilm\n"); - return -1; - } - - show_dentry = debugfs_create_file("statistics", 0222, dir, NULL, - &oct_ilm_ops); - if (!show_dentry) { - pr_err("oct_ilm: failed to create debugfs entry oct_ilm/statistics\n"); - return -1; - } - - show_dentry = debugfs_create_file("reset", 0222, dir, NULL, - &reset_statistics_ops); - if (!show_dentry) { - pr_err("oct_ilm: failed to create debugfs entry oct_ilm/reset\n"); - return -1; - } - + debugfs_create_file("statistics", 0222, dir, NULL, &oct_ilm_ops); + debugfs_create_file("reset", 0222, dir, NULL, &reset_statistics_ops); return 0; - } static void init_latency_info(struct latency_info *li, int startup) @@ -169,11 +150,7 @@ static __init int oct_ilm_module_init(void) int rc; int irq = OCTEON_IRQ_TIMER0 + TIMER_NUM; - rc = init_debufs(); - if (rc) { - WARN(1, "Could not create debugfs entries"); - return rc; - } + init_debugfs(); rc = request_irq(irq, cvm_oct_ciu_timer_interrupt, IRQF_NO_THREAD, "oct_ilm", 0); -- 2.20.1