Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7533531imu; Tue, 22 Jan 2019 07:31:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Oodh08olcY0hG4ZdaV996nkL9s0vkezncCwEXQIAmFhUFm8QWsctDKV7zERL7xL4DEQfi X-Received: by 2002:a17:902:64c1:: with SMTP id y1mr34339488pli.64.1548171085802; Tue, 22 Jan 2019 07:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548171085; cv=none; d=google.com; s=arc-20160816; b=qiB0rubvfN0M1X2x2TVBsUabIFJpHUdGHt6S+/m9s+fv6L2rvONUbK5qOdAtsM8X5g BDPa+/yk7FTQUK3II0/WrNQoFPhX/10wTP7O7lgIslScvxNzapayVuopTVuAecfmUsz9 NUavQn7ddZ/H7kfdhWPzAd+FO+gHyoek44VX9YSah9jrMqnurvgzxWHQgUFjk8C9wl4w MGMmHHJ8H9BX5X07AipheiTn0enddIeqLSCW5xwE3CTZqXX8W9qASEzzx8CkFWtIlqV9 Sie30zB7J389UUVPVYfXrFG1Ey3jgquR2EuwjX27CvnHwNNDuBQJrg9F1E3Lkf2vb0Jd yaug== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=gJTyutTJ5G8ahi9h1H9Kf8GvEt+ALLo3MZ12xlof7Os=; b=EjOMBpyW5iPw1+XVKIHteRFTv2VnokjRHVIZ1CYm8Twt4lOTzZHnIo7DNewdAWRQ4p CDi0GoJU/J2sNwBztPLz0g6sbFnAIFIZGv9UCBW8NUZQonxQgCi7y/YyrHw9pULt0nT7 cZa18I3l8XV80ha+DCC5bMOFdX4uQ7YT5LDbBmDspmeoDvt6izuMRMLcrbFzN7AusJu+ RYUiZj9IU0fCfQ7XSX5OTY0NiEzDCLlU6Ng2b6ZTYJOESeeI21s+cNkYTsd7I9q4hBZ9 E31U/MZAsbl/vKeE/KASMS9IlOMIJntBZV3EAjUkG5aV9BGwYuJLUod6LCtvQxvWX27X weSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fPHBuwWn; 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 o10si15749764pls.76.2019.01.22.07.31.08; Tue, 22 Jan 2019 07:31:25 -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=fPHBuwWn; 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 S1729498AbfAVP1t (ORCPT + 99 others); Tue, 22 Jan 2019 10:27:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:34746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbfAVPWe (ORCPT ); Tue, 22 Jan 2019 10:22: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 BE71E217D4; Tue, 22 Jan 2019 15:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170554; bh=quRMAXt4hjMDtnBNH2qSNVlvrM8PCp2mVMmaQNS11h4=; h=From:To:Cc:Subject:Date:From; b=fPHBuwWnku70MXZERYQvmR/hgOe3S5XmaLJf90ckv5iDokIGOVnyDjn4ShBgaEFiG 6LmWdui/FHiHaOs8U5GW2z3KZc+3BMD6HKyHGqa6F4p/r41Hm66lFw4j02x2c8z0bW Jbuio0AiGpDiqIYCX/bgnUMvQ1YfVlR4AtZNotzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Martin Schwidefsky , Heiko Carstens , Kees Cook , Christian Borntraeger , Hendrik Brueckner , linux-s390@vger.kernel.org Subject: [PATCH] s390: kernel: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:21:02 +0100 Message-Id: <20190122152151.16139-3-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 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: Martin Schwidefsky Cc: Heiko Carstens Cc: Kees Cook Cc: Christian Borntraeger Cc: Hendrik Brueckner Cc: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/s390/kernel/debug.c | 6 ------ arch/s390/kernel/kdebugfs.c | 2 -- arch/s390/kernel/sysinfo.c | 2 -- 3 files changed, 10 deletions(-) diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index d374f9b218b4..0ebf08c3b35e 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -1056,12 +1056,6 @@ int debug_register_view(debug_info_t *id, struct debug_view *view) mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); pde = debugfs_create_file(view->name, mode, id->debugfs_root_entry, id, &debug_file_ops); - if (!pde) { - pr_err("Registering view %s/%s failed due to out of " - "memory\n", id->name, view->name); - rc = -1; - goto out; - } spin_lock_irqsave(&id->lock, flags); for (i = 0; i < DEBUG_MAX_VIEWS; i++) { if (!id->views[i]) diff --git a/arch/s390/kernel/kdebugfs.c b/arch/s390/kernel/kdebugfs.c index 2c46bd6c6fd2..33130c7daf55 100644 --- a/arch/s390/kernel/kdebugfs.c +++ b/arch/s390/kernel/kdebugfs.c @@ -9,8 +9,6 @@ EXPORT_SYMBOL(arch_debugfs_dir); static int __init arch_kdebugfs_init(void) { arch_debugfs_dir = debugfs_create_dir("s390", NULL); - if (IS_ERR(arch_debugfs_dir)) - arch_debugfs_dir = NULL; return 0; } postcore_initcall(arch_kdebugfs_init); diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index 12f80d1f0415..2ac3c9b56a13 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c @@ -545,8 +545,6 @@ static __init int stsi_init_debugfs(void) int lvl, i; stsi_root = debugfs_create_dir("stsi", arch_debugfs_dir); - if (IS_ERR_OR_NULL(stsi_root)) - return 0; lvl = stsi(NULL, 0, 0, 0); if (lvl > 0) stsi_0_0_0 = lvl; -- 2.20.1