From patchwork Fri Jun 14 09:47:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 10994965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DBC8924 for ; Fri, 14 Jun 2019 10:08:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D25927F2B for ; Fri, 14 Jun 2019 10:08:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70A0828437; Fri, 14 Jun 2019 10:08:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8BBE62841F for ; Fri, 14 Jun 2019 10:08:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 740631853; Fri, 14 Jun 2019 12:07:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 740631853 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560506900; bh=3EKPbZfTuw3jdy+uOtzan+eyFKB0tkwxzH161YVxSQk=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dVlYQF7PRtnTL32Zv16ytQPvKEDVYHMP31Ux4M7OB6EC3pEa9FljIAhd2JwK7bMAN RM6DuYu8EO4I61Pj5ZVGDl2f0/tnHed2kZrSunq4Vrxc8ObKffnmOSaxtMdV0jy7O0 YbcQiKqzR6xInTrS0YOqHfQNL0OCCDb5CJefaixM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DC585F896EA; Fri, 14 Jun 2019 12:07:29 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 82B03F896E3; Fri, 14 Jun 2019 12:07:28 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C3B9FF8076F for ; Fri, 14 Jun 2019 12:07:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C3B9FF8076F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="xX7OubIk" 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 4EE7321537; Fri, 14 Jun 2019 09:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560505696; bh=lewnruf08KpEZI1dNrw2nv+WDkht3JN3yjh14aAkQvs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xX7OubIkaBnuKF/GMShWWWq/2OMWQVOzaUGxKuR0J9OCtTnE9Yj9WKY0T/LsU9CLE dA5SuK3lxGprxfSVyiB/lXewanaSmnrwSX3OFZwL+FX97EuXRh5QgWALwBWbiQdomD ejcJp4xSzdTMjRK3rGUXDJr2aWvd7Do6YfNme8oo= From: Greg Kroah-Hartman To: Jaroslav Kysela , Takashi Iwai Date: Fri, 14 Jun 2019 11:47:54 +0200 Message-Id: <20190614094756.2965-3-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190614094756.2965-1-gregkh@linuxfoundation.org> References: <20190614094756.2965-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Cc: Greg Kroah-Hartman , alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood , patches@opensource.cirrus.com Subject: [alsa-devel] [PATCH 3/5] sound: soc: codecs: wm_adsp: no need to check return value of debugfs_create functions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Cc: Signed-off-by: Greg Kroah-Hartman Reviewed-by: Richard Fitzgerald --- sound/soc/codecs/wm_adsp.c | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index b26e6b825a90..8f301cb07745 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -731,41 +731,18 @@ static void wm_adsp2_init_debugfs(struct wm_adsp *dsp, struct dentry *root = NULL; int i; - if (!component->debugfs_root) { - adsp_err(dsp, "No codec debugfs root\n"); - goto err; - } - root = debugfs_create_dir(dsp->name, component->debugfs_root); - if (!root) - goto err; - - if (!debugfs_create_bool("booted", 0444, root, &dsp->booted)) - goto err; + debugfs_create_bool("booted", 0444, root, &dsp->booted); + debugfs_create_bool("running", 0444, root, &dsp->running); + debugfs_create_x32("fw_id", 0444, root, &dsp->fw_id); + debugfs_create_x32("fw_version", 0444, root, &dsp->fw_id_version); - if (!debugfs_create_bool("running", 0444, root, &dsp->running)) - goto err; - - if (!debugfs_create_x32("fw_id", 0444, root, &dsp->fw_id)) - goto err; - - if (!debugfs_create_x32("fw_version", 0444, root, &dsp->fw_id_version)) - goto err; - - for (i = 0; i < ARRAY_SIZE(wm_adsp_debugfs_fops); ++i) { - if (!debugfs_create_file(wm_adsp_debugfs_fops[i].name, - 0444, root, dsp, - &wm_adsp_debugfs_fops[i].fops)) - goto err; - } + for (i = 0; i < ARRAY_SIZE(wm_adsp_debugfs_fops); ++i) + debugfs_create_file(wm_adsp_debugfs_fops[i].name, 0444, root, + dsp, &wm_adsp_debugfs_fops[i].fops); dsp->debugfs_root = root; - return; - -err: - debugfs_remove_recursive(root); - adsp_err(dsp, "Failed to create debugfs\n"); } static void wm_adsp2_cleanup_debugfs(struct wm_adsp *dsp)