From nobody Fri Apr 19 01:26:48 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1565433177; cv=none; d=zoho.com; s=zohoarc; b=W1f5kYYlQ+578sWb0A1XELiXA3RZIXO8mEcShgNwdELPpgWLo3aWWsVXj4Cx4UrA1IpxA4JlsoiLPMJbLoBlusCQExe5fU12ufs9Jg4BuieFULUataEANLhMsLo5jl3veI/Isa4PG4QjPDGUzg3PfetYcE9h7AGBjNgGJ30q4Q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565433177; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=gl1eE73/IaHsrGuu2Vbx5uxZdKpJjyaWEe17pgqL1Ew=; b=IcAk41WzTS9i8VIhKLMj+vndSt5NKPrDmg+cloYifnWq2ihVpc3UHKvOv6mPcASg3u9xRVFU2vLb+oCUOUcUe6rPbFVJFj3NreciuLIJNrxArFmgvLD0cMgMsxbmO7YMNqgyIz9FPwCnM69MfOzsoE1mimgiiWeBx1shbMOSN0w= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1565433177440372.1124826726957; Sat, 10 Aug 2019 03:32:57 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hwOeX-0003uP-QJ; Sat, 10 Aug 2019 10:31:13 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hwOeW-0003uK-Bj for xen-devel@lists.xenproject.org; Sat, 10 Aug 2019 10:31:12 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id f883af19-bb59-11e9-8980-bc764e045a96; Sat, 10 Aug 2019 10:31:11 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.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 DE5E42166E; Sat, 10 Aug 2019 10:31:09 +0000 (UTC) X-Inumbo-ID: f883af19-bb59-11e9-8980-bc764e045a96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565433070; bh=1VpqSEukS5sRGvDloeUS/AAIRLLZaGzwqQwNoch3q5U=; h=Date:From:To:Cc:Subject:From; b=puZu/Wn5vERBaeAJ3FXBSEM4mmBMDonlL39tIcojB+A7MHgNMC6zohYDFNSvE85EO ePUrjr2BUv+roD7V2Sp+CMqY0mUG3v7tqHjf9DnyYx1HZjVsuiw6Vj5jsBaQHQqY0E z0x7YUWsTvAr27z0Cl4hAiMNHOp7cwxqkDpnswVs= Date: Sat, 10 Aug 2019 12:31:08 +0200 From: Greg Kroah-Hartman To: Wei Liu , Paul Durrant , xen-devel@lists.xenproject.org Message-ID: <20190810103108.GA29487@kroah.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.1 (2019-06-15) Subject: [Xen-devel] [PATCH] xen-netback: no need to check return value of debugfs_create functions X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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: Wei Liu Cc: Paul Durrant Cc: xen-devel@lists.xenproject.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Wei Liu --- drivers/net/xen-netback/netback.c | 3 -- drivers/net/xen-netback/xenbus.c | 46 ++++++++----------------------- 2 files changed, 11 insertions(+), 38 deletions(-) diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/ne= tback.c index 1d9940d4e8c7..e018932abf49 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -1653,9 +1653,6 @@ static int __init netback_init(void) =20 #ifdef CONFIG_DEBUG_FS xen_netback_dbg_root =3D debugfs_create_dir("xen-netback", NULL); - if (IS_ERR_OR_NULL(xen_netback_dbg_root)) - pr_warn("Init of debugfs returned %ld!\n", - PTR_ERR(xen_netback_dbg_root)); #endif /* CONFIG_DEBUG_FS */ =20 return 0; diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xen= bus.c index 41034264bd34..f533b7372d59 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -170,50 +170,26 @@ DEFINE_SHOW_ATTRIBUTE(xenvif_ctrl); =20 static void xenvif_debugfs_addif(struct xenvif *vif) { - struct dentry *pfile; int i; =20 - if (IS_ERR_OR_NULL(xen_netback_dbg_root)) - return; - vif->xenvif_dbg_root =3D debugfs_create_dir(vif->dev->name, xen_netback_dbg_root); - if (!IS_ERR_OR_NULL(vif->xenvif_dbg_root)) { - for (i =3D 0; i < vif->num_queues; ++i) { - char filename[sizeof("io_ring_q") + 4]; - - snprintf(filename, sizeof(filename), "io_ring_q%d", i); - pfile =3D debugfs_create_file(filename, - 0600, - vif->xenvif_dbg_root, - &vif->queues[i], - &xenvif_dbg_io_ring_ops_fops); - if (IS_ERR_OR_NULL(pfile)) - pr_warn("Creation of io_ring file returned %ld!\n", - PTR_ERR(pfile)); - } + for (i =3D 0; i < vif->num_queues; ++i) { + char filename[sizeof("io_ring_q") + 4]; =20 - if (vif->ctrl_irq) { - pfile =3D debugfs_create_file("ctrl", - 0400, - vif->xenvif_dbg_root, - vif, - &xenvif_ctrl_fops); - if (IS_ERR_OR_NULL(pfile)) - pr_warn("Creation of ctrl file returned %ld!\n", - PTR_ERR(pfile)); - } - } else - netdev_warn(vif->dev, - "Creation of vif debugfs dir returned %ld!\n", - PTR_ERR(vif->xenvif_dbg_root)); + snprintf(filename, sizeof(filename), "io_ring_q%d", i); + debugfs_create_file(filename, 0600, vif->xenvif_dbg_root, + &vif->queues[i], + &xenvif_dbg_io_ring_ops_fops); + } + + if (vif->ctrl_irq) + debugfs_create_file("ctrl", 0400, vif->xenvif_dbg_root, vif, + &xenvif_ctrl_fops); } =20 static void xenvif_debugfs_delif(struct xenvif *vif) { - if (IS_ERR_OR_NULL(xen_netback_dbg_root)) - return; - debugfs_remove_recursive(vif->xenvif_dbg_root); vif->xenvif_dbg_root =3D NULL; } --=20 2.22.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel