Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7496866imu; Tue, 22 Jan 2019 07:01:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN7QVn9u/07rosbq8mk7s7EZPsLYsMNVbIpF+621W4m65wfsXmgLZ1DQhG0fgkwMrwJzpIsg X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr34611925plo.162.1548169260835; Tue, 22 Jan 2019 07:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548169260; cv=none; d=google.com; s=arc-20160816; b=w0cJpcc5bzVzRzdsCMu7GpvP/9eyqR4yVNfZx3FVNFqWzRRreUNOxNXecwROC5W6hZ q61B6PhXqjMrwSypLcVOlhMrhRk7B2L1B0mdI7CCCAUoxBUZePjbkt1qhjZZ1Dsi7aVx vRbrnB1XtO4KSTDccZmRbmgZ0TsACOCsxDMFhKQ8cKdedRO/sG1FLQhs/x7J6j+5NPAy SWQPcyEao03Kde/Q8m89dZgFLBo3SPgcy1IlHwY3/rdJvPilSeAMvMZF6qn002Lt4cRk jw6LKYnroHukU0CB4SzAXDcNoGYWPeIMUvWPUxuuWmXYwn3amNU/vl/gnWe2zfa7eJS7 ikdQ== 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=u0CcOmOJEe1Q4V0hMK9T5dQCkNG/n1fgCzEc8WWOw+I=; b=lLJqCn0Ga+4DiQZTJYjh5sTQlO04wVC4tfSjmUG6+eMx4PfUBHk5hvmebLfZEHDgI3 aTpDup6vrWI/mXxwGW4prCLt8C+uWtT3noGR/hiweZDlkWcSIwtwurisb+B75FJ6ZRMl UHjM369nb/Y/6wwegbU8XptaY9FtlAyGPnLLgFVOZReDBmf1naWvTyGQKFIDhEIUL5HC v4ylbCvB/UD4SvsB9hNltcS2z38vAbVy7wMx8BYNBVs2CX/JQMbcG7PXIgT9cJpls6Mn OQ4+/TIAhuqgP6IYiQ+rBD0hqgKDOhob5HD8PMdYbN8RrC6V54IU5b8YQ4CwT3sH8/3H zkmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dBEe1Efe; 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 x16si7827665pga.407.2019.01.22.07.00.44; Tue, 22 Jan 2019 07:01:00 -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=dBEe1Efe; 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 S1729116AbfAVO6p (ORCPT + 99 others); Tue, 22 Jan 2019 09:58:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:37978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729042AbfAVO6e (ORCPT ); Tue, 22 Jan 2019 09:58: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 1382521726; Tue, 22 Jan 2019 14:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548169113; bh=jCuAxteeCLcwZWRObsCeZCZ4eTBs5kj/RbwALPOVfCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dBEe1EfedWy8GgMm+wVyTpMFe1BLc7oXgag0iN0zzbBf+u9h7l6F28EaeMRtgHYBL mlYVLIYjMLQ/X/0N/vfNbHOjpDAXMHQp4yCftMSvDZ9BsXj6jOfMgQ9g6tGPK4T1f+ Z2s9RJB6K32Uph8TNdpXYKuy4uN8d7wqt54VFaYs= 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 , Yangtao Li Subject: [PATCH 4/5] mips: math-emu: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 15:57:41 +0100 Message-Id: <20190122145742.11292-5-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: Yangtao Li Cc: linux-mips@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/mips/math-emu/me-debugfs.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/arch/mips/math-emu/me-debugfs.c b/arch/mips/math-emu/me-debugfs.c index 58798f527356..387724860fa6 100644 --- a/arch/mips/math-emu/me-debugfs.c +++ b/arch/mips/math-emu/me-debugfs.c @@ -189,32 +189,21 @@ static int __init debugfs_fpuemu(void) { struct dentry *fpuemu_debugfs_base_dir; struct dentry *fpuemu_debugfs_inst_dir; - struct dentry *d, *reset_file; - - if (!mips_debugfs_dir) - return -ENODEV; fpuemu_debugfs_base_dir = debugfs_create_dir("fpuemustats", mips_debugfs_dir); - if (!fpuemu_debugfs_base_dir) - return -ENOMEM; - reset_file = debugfs_create_file("fpuemustats_clear", 0444, - mips_debugfs_dir, NULL, - &fpuemustats_clear_fops); - if (!reset_file) - return -ENOMEM; + debugfs_create_file("fpuemustats_clear", 0444, mips_debugfs_dir, NULL, + &fpuemustats_clear_fops); #define FPU_EMU_STAT_OFFSET(m) \ offsetof(struct mips_fpu_emulator_stats, m) #define FPU_STAT_CREATE(m) \ do { \ - d = debugfs_create_file(#m, 0444, fpuemu_debugfs_base_dir, \ + debugfs_create_file(#m, 0444, fpuemu_debugfs_base_dir, \ (void *)FPU_EMU_STAT_OFFSET(m), \ &fops_fpuemu_stat); \ - if (!d) \ - return -ENOMEM; \ } while (0) FPU_STAT_CREATE(emulated); @@ -233,8 +222,6 @@ do { \ fpuemu_debugfs_inst_dir = debugfs_create_dir("instructions", fpuemu_debugfs_base_dir); - if (!fpuemu_debugfs_inst_dir) - return -ENOMEM; #define FPU_STAT_CREATE_EX(m) \ do { \ @@ -242,11 +229,9 @@ do { \ \ adjust_instruction_counter_name(name, #m); \ \ - d = debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir, \ + debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir, \ (void *)FPU_EMU_STAT_OFFSET(m), \ &fops_fpuemu_stat); \ - if (!d) \ - return -ENOMEM; \ } while (0) FPU_STAT_CREATE_EX(abs_s); -- 2.20.1