Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7525309imu; Tue, 22 Jan 2019 07:24:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5fEHkK0yp1Yg2oUK2HvAhe/KkA011O2PD6PF8wMXHBg4l02q9YHVhw4FSPj0SFOtE2Itv3 X-Received: by 2002:a65:624c:: with SMTP id q12mr32435202pgv.379.1548170643372; Tue, 22 Jan 2019 07:24:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548170643; cv=none; d=google.com; s=arc-20160816; b=CtBQ22uWncUA3daQqDnqCwtCHyvSKULim38t38/1wMaKGawiPeuX7oJCiPkstUZ62Z 4LFjV6h4ojVzSP1j72ycbJyP2gFOhqa76fxNsWDLuuPORyUdilxnNlXgXSxQlMQb2jqN Nh3cY/fgbGTF6m1BdujBv/GYXWxqpneJbx0UzaHFKtIo6A/i2le2XBXO+0Pvh7s/lyeD mBGjUT82wxsUmKIkiZ9I7SYjNjSwZdZjA5soYh+26/P5pmc9lmlJt+EuSZJFq0D9iAC/ DI0SY2so1LWnZbw3GAd6v6zFOQFXGoIT/+8lS7h1Zwt/3pW5H4l6EXVX+TUjOZ8eNVEh xnOg== 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=jFg7xZyzUiPN9nZrx4z6fgmk1Pa3hVts1zrOamZoMEA=; b=m/UJ3H6qDENWA3NUM4t0lUKoazeLwINV/nNtceMBzGmlt+5kLpsKQ3ADBKU0Mfqv9f CtK2lBlqirNAVi6jLRcJqfy2XG2tW5Lj8qTGGgkwXIcjdRn8gJ+kYGJdse+rYEPZ1bap ROG4W8peoTF7aPrlNpCe7Tb3M+hujJQpJowiwZNnmBwHNvsQnZu2via8fMOzl8L48AtV jdyJ7Cw8I57+NLe8JhdYjiUxlCi6+JYYSqN9YnPu3AdPl+Uj5wnftTDiRdMQ4nVLPHli ql0tP/XDOqk4BSGcFlMzbYPYTAonqnJ1B0y5Gl99aqUf5FRBclTd2KPefV7xY3E8k8F/ Nq1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0IbOgIr+; 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 34si9662966pgt.455.2019.01.22.07.23.42; Tue, 22 Jan 2019 07:24:03 -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=0IbOgIr+; 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 S1729461AbfAVPWA (ORCPT + 99 others); Tue, 22 Jan 2019 10:22:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:33722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729438AbfAVPVz (ORCPT ); Tue, 22 Jan 2019 10:21:55 -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 1758A20879; Tue, 22 Jan 2019 15:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548170514; bh=wXp1RKZNIp4pxi86GSGIiSvi1kOn+o+SdTJvYdOJzZ4=; h=From:To:Cc:Subject:Date:From; b=0IbOgIr+WAJe1U9uE0W29vavvfG8mh0Y5AfrGYsTWicjrMS+X23zMLe/Wtl1GMIw9 lRd4SiEfmgHqbyYJtSBKmeTbkaIcg1RW0rEn4znvXE28OIkabzvdZKaMEJZU+w75Oo cAtF4INIr/JIoO+Y/XcVTskKkngQ4fH8e/eVTkbw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org Subject: [PATCH] s390: hypfs: no need to check return value of debugfs_create functions Date: Tue, 22 Jan 2019 16:21:00 +0100 Message-Id: <20190122152151.16139-1-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: linux-s390@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/s390/hypfs/hypfs.h | 6 +++--- arch/s390/hypfs/hypfs_dbfs.c | 8 ++------ arch/s390/hypfs/hypfs_diag.c | 9 ++++----- arch/s390/hypfs/hypfs_diag0c.c | 3 ++- arch/s390/hypfs/hypfs_sprp.c | 6 +++--- arch/s390/hypfs/hypfs_vm.c | 3 ++- arch/s390/hypfs/inode.c | 11 +++-------- 7 files changed, 19 insertions(+), 27 deletions(-) diff --git a/arch/s390/hypfs/hypfs.h b/arch/s390/hypfs/hypfs.h index 52348e0a812e..05f3f9aee5fc 100644 --- a/arch/s390/hypfs/hypfs.h +++ b/arch/s390/hypfs/hypfs.h @@ -43,7 +43,7 @@ int hypfs_diag0c_init(void); void hypfs_diag0c_exit(void); /* Set Partition-Resource Parameter */ -int hypfs_sprp_init(void); +void hypfs_sprp_init(void); void hypfs_sprp_exit(void); /* debugfs interface */ @@ -69,9 +69,9 @@ struct hypfs_dbfs_file { struct dentry *dentry; }; -extern int hypfs_dbfs_init(void); +extern void hypfs_dbfs_init(void); extern void hypfs_dbfs_exit(void); -extern int hypfs_dbfs_create_file(struct hypfs_dbfs_file *df); +extern void hypfs_dbfs_create_file(struct hypfs_dbfs_file *df); extern void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df); #endif /* _HYPFS_H_ */ diff --git a/arch/s390/hypfs/hypfs_dbfs.c b/arch/s390/hypfs/hypfs_dbfs.c index b9bdf5c1918e..f4c7dbfaf8ee 100644 --- a/arch/s390/hypfs/hypfs_dbfs.c +++ b/arch/s390/hypfs/hypfs_dbfs.c @@ -78,14 +78,11 @@ static const struct file_operations dbfs_ops = { .unlocked_ioctl = dbfs_ioctl, }; -int hypfs_dbfs_create_file(struct hypfs_dbfs_file *df) +void hypfs_dbfs_create_file(struct hypfs_dbfs_file *df) { df->dentry = debugfs_create_file(df->name, 0400, dbfs_dir, df, &dbfs_ops); - if (IS_ERR(df->dentry)) - return PTR_ERR(df->dentry); mutex_init(&df->lock); - return 0; } void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df) @@ -93,10 +90,9 @@ void hypfs_dbfs_remove_file(struct hypfs_dbfs_file *df) debugfs_remove(df->dentry); } -int hypfs_dbfs_init(void) +void hypfs_dbfs_init(void) { dbfs_dir = debugfs_create_dir("s390_hypfs", NULL); - return PTR_ERR_OR_ZERO(dbfs_dir); } void hypfs_dbfs_exit(void) diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c index 3452e18bb1ca..f0bc4dc3e9bf 100644 --- a/arch/s390/hypfs/hypfs_diag.c +++ b/arch/s390/hypfs/hypfs_diag.c @@ -440,11 +440,10 @@ __init int hypfs_diag_init(void) pr_err("The hardware system does not support hypfs\n"); return -ENODATA; } - if (diag204_info_type == DIAG204_INFO_EXT) { - rc = hypfs_dbfs_create_file(&dbfs_file_d204); - if (rc) - return rc; - } + + if (diag204_info_type == DIAG204_INFO_EXT) + hypfs_dbfs_create_file(&dbfs_file_d204); + if (MACHINE_IS_LPAR) { rc = diag224_get_name_table(); if (rc) { diff --git a/arch/s390/hypfs/hypfs_diag0c.c b/arch/s390/hypfs/hypfs_diag0c.c index cebf05150cc1..46bf190234b9 100644 --- a/arch/s390/hypfs/hypfs_diag0c.c +++ b/arch/s390/hypfs/hypfs_diag0c.c @@ -125,7 +125,8 @@ int __init hypfs_diag0c_init(void) { if (!MACHINE_IS_VM) return 0; - return hypfs_dbfs_create_file(&dbfs_file_0c); + hypfs_dbfs_create_file(&dbfs_file_0c); + return 0; } /* diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c index 601b70786dc8..7d9fb496d155 100644 --- a/arch/s390/hypfs/hypfs_sprp.c +++ b/arch/s390/hypfs/hypfs_sprp.c @@ -137,11 +137,11 @@ static struct hypfs_dbfs_file hypfs_sprp_file = { .unlocked_ioctl = hypfs_sprp_ioctl, }; -int hypfs_sprp_init(void) +void hypfs_sprp_init(void) { if (!sclp.has_sprp) - return 0; - return hypfs_dbfs_create_file(&hypfs_sprp_file); + return; + hypfs_dbfs_create_file(&hypfs_sprp_file); } void hypfs_sprp_exit(void) diff --git a/arch/s390/hypfs/hypfs_vm.c b/arch/s390/hypfs/hypfs_vm.c index c4b7b681e055..42f2375c203e 100644 --- a/arch/s390/hypfs/hypfs_vm.c +++ b/arch/s390/hypfs/hypfs_vm.c @@ -279,7 +279,8 @@ int hypfs_vm_init(void) guest_query = local_guest; else return -EACCES; - return hypfs_dbfs_create_file(&dbfs_file_2fc); + hypfs_dbfs_create_file(&dbfs_file_2fc); + return 0; } void hypfs_vm_exit(void) diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index c681329fdeec..ccad1398abd4 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -456,9 +456,8 @@ static int __init hypfs_init(void) { int rc; - rc = hypfs_dbfs_init(); - if (rc) - return rc; + hypfs_dbfs_init(); + if (hypfs_diag_init()) { rc = -ENODATA; goto fail_dbfs_exit; @@ -467,10 +466,7 @@ static int __init hypfs_init(void) rc = -ENODATA; goto fail_hypfs_diag_exit; } - if (hypfs_sprp_init()) { - rc = -ENODATA; - goto fail_hypfs_vm_exit; - } + hypfs_sprp_init(); if (hypfs_diag0c_init()) { rc = -ENODATA; goto fail_hypfs_sprp_exit; @@ -489,7 +485,6 @@ static int __init hypfs_init(void) hypfs_diag0c_exit(); fail_hypfs_sprp_exit: hypfs_sprp_exit(); -fail_hypfs_vm_exit: hypfs_vm_exit(); fail_hypfs_diag_exit: hypfs_diag_exit(); -- 2.20.1