From patchwork Tue Aug 18 13:36:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11720895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C02BE14E3 for ; Tue, 18 Aug 2020 13:36:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D230206B5 for ; Tue, 18 Aug 2020 13:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757765; bh=3RDFnusPuTN/gUIFW524Igr1Ma20iPQgX1vJUa86zcc=; h=From:To:Cc:Subject:Date:List-ID:From; b=nGfe5N6EdY0N3tT5so2ltAbskuq3dLT6PmILvxeloXx+kJL8c7gtQ3yXc7TDQi9QZ o5kfmyR0N/0oOto0ICApsg0E8UqjkaFlMTXfGrVJjApqhRjOW6JjifPpoJQmPrxSdM avCZtYClkdt+NHxBbmTi+co4bUwtSu3gSl8XkHYY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726570AbgHRNgB (ORCPT ); Tue, 18 Aug 2020 09:36:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:45360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbgHRNfy (ORCPT ); Tue, 18 Aug 2020 09:35:54 -0400 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 219472076D; Tue, 18 Aug 2020 13:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757753; bh=3RDFnusPuTN/gUIFW524Igr1Ma20iPQgX1vJUa86zcc=; h=From:To:Cc:Subject:Date:From; b=YAji/SJ6m5Ii17h8yZsQkWBp16JjwEsppLu6q+XvKPAbDgAM2M1hUTrKQWdHdL7VE s+zIu5JLujEF+LFjSrPR+rfsGipkzKwQL4+5VxyRYENf+u8aYF+Q4nbv0RaMrWnuSI uVLyGF9hN2SwCQIez5mToI7C7U+Fh553z+dZGqb0= From: Greg Kroah-Hartman To: linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , Hans Verkuil , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH 1/7] media: cec: no need to check return value of debugfs_create functions Date: Tue, 18 Aug 2020 15:36:02 +0200 Message-Id: <20200818133608.462514-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/cec/core/cec-core.c | 27 ++++++++------------------- include/media/cec.h | 2 -- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index c599cd94dd62..562792f545ac 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -359,27 +359,16 @@ int cec_register_adapter(struct cec_adapter *adap, if (!top_cec_dir) return 0; - adap->cec_dir = debugfs_create_dir(dev_name(&adap->devnode.dev), top_cec_dir); - if (IS_ERR_OR_NULL(adap->cec_dir)) { - pr_warn("cec-%s: Failed to create debugfs dir\n", adap->name); - return 0; - } - adap->status_file = debugfs_create_devm_seqfile(&adap->devnode.dev, - "status", adap->cec_dir, cec_adap_status); - if (IS_ERR_OR_NULL(adap->status_file)) { - pr_warn("cec-%s: Failed to create status file\n", adap->name); - debugfs_remove_recursive(adap->cec_dir); - adap->cec_dir = NULL; - return 0; - } + adap->cec_dir = debugfs_create_dir(dev_name(&adap->devnode.dev), + top_cec_dir); + + debugfs_create_devm_seqfile(&adap->devnode.dev, "status", adap->cec_dir, + cec_adap_status); + if (!adap->ops->error_inj_show || !adap->ops->error_inj_parse_line) return 0; - adap->error_inj_file = debugfs_create_file("error-inj", 0644, - adap->cec_dir, adap, - &cec_error_inj_fops); - if (IS_ERR_OR_NULL(adap->error_inj_file)) - pr_warn("cec-%s: Failed to create error-inj file\n", - adap->name); + debugfs_create_file("error-inj", 0644, adap->cec_dir, adap, + &cec_error_inj_fops); #endif return 0; } diff --git a/include/media/cec.h b/include/media/cec.h index c48b5f2e4b50..cd35ae6b7560 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -248,8 +248,6 @@ struct cec_adapter { #endif struct dentry *cec_dir; - struct dentry *status_file; - struct dentry *error_inj_file; u32 sequence; From patchwork Tue Aug 18 13:36:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11720903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5A3414E3 for ; Tue, 18 Aug 2020 13:36:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD7AC20786 for ; Tue, 18 Aug 2020 13:36:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757801; bh=Zn57+X2Pp8OOL5pGLsjIsd2D2F+3QH7pq/MPYL4MiwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NIud3L6irkShLBEYhWhplrSXS/jt1Q7brnhkzfS/M7t6KPiHkyDZtGMnga8EJPmEa 94OPDlzhVyXdGxtMPa7WygYazi+62qF/wbEp1hss/tNLlPJwkFzQdDxWjaCc/axpSR I6yGkFACJVZwOXkFLQFMVPri1GZrcqBag7fIMIf4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbgHRNf6 (ORCPT ); Tue, 18 Aug 2020 09:35:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:45314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgHRNfv (ORCPT ); Tue, 18 Aug 2020 09:35:51 -0400 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 5B2A6206B5; Tue, 18 Aug 2020 13:35:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757750; bh=Zn57+X2Pp8OOL5pGLsjIsd2D2F+3QH7pq/MPYL4MiwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IZVM6NneDt5YBevtNAVmNFPIV+cxCCVRj7ZI9gSABnhI1k/3Kqd3HRWVxwGVwtc1v uRD6i5yfWx+gM++Hc2A9gWe04KRlVntql6B/5OeZmMAlwYiVeBgoBA+wnQozo5hOn5 j0yHZux+zDlc+a3QlQIwQj0g9GjOK+Ffrdd+G9lE= From: Greg Kroah-Hartman To: linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH 2/7] media: coda: no need to check return value of debugfs_create functions Date: Tue, 18 Aug 2020 15:36:03 +0200 Message-Id: <20200818133608.462514-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200818133608.462514-1-gregkh@linuxfoundation.org> References: <20200818133608.462514-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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: Philipp Zabel Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Philipp Zabel --- drivers/media/platform/coda/coda-common.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 3ab3d976d8ca..9020be29d8f2 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -1937,9 +1937,6 @@ int coda_alloc_aux_buf(struct coda_dev *dev, struct coda_aux_buf *buf, buf->blob.size = size; buf->dentry = debugfs_create_blob(name, 0644, parent, &buf->blob); - if (!buf->dentry) - dev_warn(dev->dev, - "failed to create debugfs entry %s\n", name); } return 0; @@ -3211,8 +3208,6 @@ static int coda_probe(struct platform_device *pdev) ida_init(&dev->ida); dev->debugfs_root = debugfs_create_dir("coda", NULL); - if (!dev->debugfs_root) - dev_warn(&pdev->dev, "failed to create debugfs root\n"); /* allocate auxiliary per-device buffers for the BIT processor */ if (dev->devtype->product == CODA_DX6) { From patchwork Tue Aug 18 13:36:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11720911 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B7051575 for ; Tue, 18 Aug 2020 13:37:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24AA4206B5 for ; Tue, 18 Aug 2020 13:37:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757822; bh=axA6OGzpfyAZ/ezh8rhvucD/432ettQbcxBBNuhqQS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lzZbZe5s44HbFLoxfiMPKVcOlVd8z5Ikvg5bU9K2hy6ti64D9aTeFeLzY4mAG6blT k5IqL77nRvoTTcB+IrwmXKVe3hV1aCl3NKHBjqZW3ToGKo0t6WDvjnNP9G45PYsxai 4IrRHgaXfnA2cyHE3ANDqx3A6rzSKRh5RZFkosz0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgHRNgm (ORCPT ); Tue, 18 Aug 2020 09:36:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:45428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbgHRNf7 (ORCPT ); Tue, 18 Aug 2020 09:35:59 -0400 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 6452C206B5; Tue, 18 Aug 2020 13:35:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757758; bh=axA6OGzpfyAZ/ezh8rhvucD/432ettQbcxBBNuhqQS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XeI/bnsFVetWO5lL/OkgNUHswpSU5zOg2XvqCYrdWkntnL+afrwkThFU8cKWd9s7Y OZIBPPYoklGiXzclyOpu6hpmv2GSI22XdYfjjjwmbqg/tdmYWf74w2VXe3qrlHbbwc 4tCPlMNCZG/54dTWiilZEEMvI2yktQU+vTu+iQ2s= From: Greg Kroah-Hartman To: linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , Kyungmin Park , Sylwester Nawrocki , Mauro Carvalho Chehab , Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] media: exynos4-is: no need to check return value of debugfs_create functions Date: Tue, 18 Aug 2020 15:36:04 +0200 Message-Id: <20200818133608.462514-3-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200818133608.462514-1-gregkh@linuxfoundation.org> References: <20200818133608.462514-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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: Kyungmin Park Cc: Sylwester Nawrocki Cc: Mauro Carvalho Chehab Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-media@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/exynos4-is/fimc-is.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c index a474014f0a0f..019bb47df915 100644 --- a/drivers/media/platform/exynos4-is/fimc-is.c +++ b/drivers/media/platform/exynos4-is/fimc-is.c @@ -756,18 +756,12 @@ static void fimc_is_debugfs_remove(struct fimc_is *is) is->debugfs_entry = NULL; } -static int fimc_is_debugfs_create(struct fimc_is *is) +static void fimc_is_debugfs_create(struct fimc_is *is) { - struct dentry *dentry; - is->debugfs_entry = debugfs_create_dir("fimc_is", NULL); - dentry = debugfs_create_file("fw_log", S_IRUGO, is->debugfs_entry, - is, &fimc_is_fops); - if (!dentry) - fimc_is_debugfs_remove(is); - - return is->debugfs_entry == NULL ? -EIO : 0; + debugfs_create_file("fw_log", S_IRUGO, is->debugfs_entry, is, + &fimc_is_fops); } static int fimc_is_runtime_resume(struct device *dev); @@ -853,9 +847,7 @@ static int fimc_is_probe(struct platform_device *pdev) if (ret < 0) goto err_pm; - ret = fimc_is_debugfs_create(is); - if (ret < 0) - goto err_sd; + fimc_is_debugfs_create(is); ret = fimc_is_request_firmware(is, FIMC_IS_FW_FILENAME); if (ret < 0) @@ -868,7 +860,6 @@ static int fimc_is_probe(struct platform_device *pdev) err_dfs: fimc_is_debugfs_remove(is); -err_sd: fimc_is_unregister_subdevs(is); err_pm: pm_runtime_put_noidle(dev); From patchwork Tue Aug 18 13:36:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11720901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 779B11744 for ; Tue, 18 Aug 2020 13:36:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54A172076D for ; Tue, 18 Aug 2020 13:36:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757799; bh=dhCRpjDpcp8vSuReLz/7iaxyclVQ56ycG3BZ+rHLZ0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Nje0ZAziu4V2SLcYKMx2DXxsvv+LF/FUW0zBNQh9JFoAu360JfGWRUxCf4lR69S03 ejRSfP7vOOru0eQkgKlQHcZbkN3Pywau05EY4AIeB9T4yCIMyzT7Hov2dVcB/5TYRM NXvYazm2Qpiu92pNul+WCovD98GKMglp+mIhyuoQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbgHRNgG (ORCPT ); Tue, 18 Aug 2020 09:36:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:45472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbgHRNgC (ORCPT ); Tue, 18 Aug 2020 09:36:02 -0400 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 C8F412076D; Tue, 18 Aug 2020 13:36:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757761; bh=dhCRpjDpcp8vSuReLz/7iaxyclVQ56ycG3BZ+rHLZ0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h4Ox0pkinZT/tOpaC00heBvjiZsqnezii+S5f3arYfqjTtG6HI4mqOk7df+SOlLSP MWX4VK4aXGdk/9VMzRczfSnzH1SSTJdW7LlIprp2rEQyY09RZMS/SjfWjaXC4ug9i4 VBkzV7WqmV0n9ZbxWF0qB9qOycCphrqlUjE12Qxg= From: Greg Kroah-Hartman To: linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , Minghsiu Tsai , Houlong Wei , Andrew-CT Chen , Tiffany Lin , Mauro Carvalho Chehab , Matthias Brugger , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] media: mtk-vpu: no need to check return value of debugfs_create functions Date: Tue, 18 Aug 2020 15:36:05 +0200 Message-Id: <20200818133608.462514-4-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200818133608.462514-1-gregkh@linuxfoundation.org> References: <20200818133608.462514-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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: Minghsiu Tsai Cc: Houlong Wei Cc: Andrew-CT Chen Cc: Tiffany Lin Cc: Mauro Carvalho Chehab Cc: Matthias Brugger Cc: linux-media@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/mtk-vpu/mtk_vpu.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c index d30c08983f56..36cb9b6131f7 100644 --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c @@ -849,10 +849,6 @@ static int mtk_vpu_probe(struct platform_device *pdev) #ifdef CONFIG_DEBUG_FS vpu_debugfs = debugfs_create_file("mtk_vpu", S_IRUGO, NULL, (void *)dev, &vpu_debug_fops); - if (!vpu_debugfs) { - ret = -ENOMEM; - goto cleanup_ipi; - } #endif /* Set PTCM to 96K and DTCM to 32K */ @@ -910,7 +906,6 @@ static int mtk_vpu_probe(struct platform_device *pdev) of_reserved_mem_device_release(dev); #ifdef CONFIG_DEBUG_FS debugfs_remove(vpu_debugfs); -cleanup_ipi: #endif memset(vpu->ipi_desc, 0, sizeof(struct vpu_ipi_desc) * IPI_MAX); vpu_mutex_destroy: From patchwork Tue Aug 18 13:36:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11720905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7DA4B1744 for ; Tue, 18 Aug 2020 13:36:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64A1820786 for ; Tue, 18 Aug 2020 13:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757802; bh=gL4zAM22UgQE+PipA9UIen3zyMO6OfT4nN9ybOsWnjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Gm2KcLwSs+LF37S3FKfBIWedWnGDuuCn7ptLcDrAA2W5YhyeI5RChHixis4GpZXmu gyhE9YcXu8Cahfj+vdfne3a+2eW+GPrzvAjDC46+wC5EpTZlW9QDMe14opL1nAMcbU a6Bbv6zXFylO7KkoIDDW32eL9YzJ+GpuEVNA+VZY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726840AbgHRNgl (ORCPT ); Tue, 18 Aug 2020 09:36:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:45532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726698AbgHRNgE (ORCPT ); Tue, 18 Aug 2020 09:36:04 -0400 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 67B5A207DA; Tue, 18 Aug 2020 13:36:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757763; bh=gL4zAM22UgQE+PipA9UIen3zyMO6OfT4nN9ybOsWnjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FamVaIy9upQcdF+LYSUsfuazAEw2bWBPtJ7jkuSW4Em4QThy3k52gWNCJWmN2G7IT TxNOET3ijSpkGAYD/iuKrheSz39SIiQtscfXkYak8I6c0zK1wMCXuhx/J2mT7vM20I UthKqD3y+hz4cACLNAqc13/2BIlQnlnuGxOnrJ2g= From: Greg Kroah-Hartman To: linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , Fabien Dessenne , Mauro Carvalho Chehab , Jean-Christophe Trotin , linux-kernel@vger.kernel.org Subject: [PATCH 5/7] media: sti: no need to check return value of debugfs_create functions Date: Tue, 18 Aug 2020 15:36:06 +0200 Message-Id: <20200818133608.462514-5-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200818133608.462514-1-gregkh@linuxfoundation.org> References: <20200818133608.462514-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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: Fabien Dessenne Cc: Mauro Carvalho Chehab Cc: Jean-Christophe Trotin Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- .../media/platform/sti/bdisp/bdisp-debug.c | 29 ++++--------------- drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 7 +---- drivers/media/platform/sti/bdisp/bdisp.h | 2 +- drivers/media/platform/sti/hva/hva-debugfs.c | 22 +++----------- 4 files changed, 12 insertions(+), 48 deletions(-) diff --git a/drivers/media/platform/sti/bdisp/bdisp-debug.c b/drivers/media/platform/sti/bdisp/bdisp-debug.c index 77ca7517fa3e..2b270093009c 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-debug.c +++ b/drivers/media/platform/sti/bdisp/bdisp-debug.c @@ -637,35 +637,18 @@ DEFINE_SHOW_ATTRIBUTE(last_nodes_raw); DEFINE_SHOW_ATTRIBUTE(last_request); DEFINE_SHOW_ATTRIBUTE(perf); -int bdisp_debugfs_create(struct bdisp_dev *bdisp) +void bdisp_debugfs_create(struct bdisp_dev *bdisp) { char dirname[16]; snprintf(dirname, sizeof(dirname), "%s%d", BDISP_NAME, bdisp->id); bdisp->dbg.debugfs_entry = debugfs_create_dir(dirname, NULL); - if (!bdisp->dbg.debugfs_entry) - goto err; - if (!bdisp_dbg_create_entry(regs)) - goto err; - - if (!bdisp_dbg_create_entry(last_nodes)) - goto err; - - if (!bdisp_dbg_create_entry(last_nodes_raw)) - goto err; - - if (!bdisp_dbg_create_entry(last_request)) - goto err; - - if (!bdisp_dbg_create_entry(perf)) - goto err; - - return 0; - -err: - bdisp_debugfs_remove(bdisp); - return -ENOMEM; + bdisp_dbg_create_entry(regs); + bdisp_dbg_create_entry(last_nodes); + bdisp_dbg_create_entry(last_nodes_raw); + bdisp_dbg_create_entry(last_request); + bdisp_dbg_create_entry(perf); } void bdisp_debugfs_remove(struct bdisp_dev *bdisp) diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c index af2d5eb782ce..7d50d6cd073d 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -1360,11 +1360,7 @@ static int bdisp_probe(struct platform_device *pdev) } /* Debug */ - ret = bdisp_debugfs_create(bdisp); - if (ret) { - dev_err(dev, "failed to create debugfs\n"); - goto err_v4l2; - } + bdisp_debugfs_create(bdisp); /* Power management */ pm_runtime_enable(dev); @@ -1401,7 +1397,6 @@ static int bdisp_probe(struct platform_device *pdev) pm_runtime_put(dev); err_dbg: bdisp_debugfs_remove(bdisp); -err_v4l2: v4l2_device_unregister(&bdisp->v4l2_dev); err_clk: if (!IS_ERR(bdisp->clock)) diff --git a/drivers/media/platform/sti/bdisp/bdisp.h b/drivers/media/platform/sti/bdisp/bdisp.h index e309cde379ca..3fb009d24791 100644 --- a/drivers/media/platform/sti/bdisp/bdisp.h +++ b/drivers/media/platform/sti/bdisp/bdisp.h @@ -209,6 +209,6 @@ int bdisp_hw_get_and_clear_irq(struct bdisp_dev *bdisp); int bdisp_hw_update(struct bdisp_ctx *ctx); void bdisp_debugfs_remove(struct bdisp_dev *bdisp); -int bdisp_debugfs_create(struct bdisp_dev *bdisp); +void bdisp_debugfs_create(struct bdisp_dev *bdisp); void bdisp_dbg_perf_begin(struct bdisp_dev *bdisp); void bdisp_dbg_perf_end(struct bdisp_dev *bdisp); diff --git a/drivers/media/platform/sti/hva/hva-debugfs.c b/drivers/media/platform/sti/hva/hva-debugfs.c index 7d12a5b5d914..a86a07b6fbc7 100644 --- a/drivers/media/platform/sti/hva/hva-debugfs.c +++ b/drivers/media/platform/sti/hva/hva-debugfs.c @@ -337,25 +337,11 @@ DEFINE_SHOW_ATTRIBUTE(regs); void hva_debugfs_create(struct hva_dev *hva) { hva->dbg.debugfs_entry = debugfs_create_dir(HVA_NAME, NULL); - if (!hva->dbg.debugfs_entry) - goto err; - if (!hva_dbg_create_entry(device)) - goto err; - - if (!hva_dbg_create_entry(encoders)) - goto err; - - if (!hva_dbg_create_entry(last)) - goto err; - - if (!hva_dbg_create_entry(regs)) - goto err; - - return; - -err: - hva_debugfs_remove(hva); + hva_dbg_create_entry(device); + hva_dbg_create_entry(encoders); + hva_dbg_create_entry(last); + hva_dbg_create_entry(regs); } void hva_debugfs_remove(struct hva_dev *hva) From patchwork Tue Aug 18 13:36:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11720897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C12EF16B1 for ; Tue, 18 Aug 2020 13:36:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A8B88206B5 for ; Tue, 18 Aug 2020 13:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757792; bh=2qNEoE6XtmSILCN5KRmGGUpLPbT+yPlnrqcOhfIc3W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dy3QnJ+URpyk/OrppTzquYqywDXOBRcbBWVwMI7ATxJDq9Hm86JNL74fM+Az7VQvV ZBeZRi3sfukUkwWA6YvV0FZOn5iwB+CkR6AAR13d9bdSBunWbn4+18ULFBsI5EZC6X MfqRDHFswmjLGIwef8N7XHADA51dCngmnSBXATsg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726480AbgHRNgM (ORCPT ); Tue, 18 Aug 2020 09:36:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:45568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbgHRNgH (ORCPT ); Tue, 18 Aug 2020 09:36:07 -0400 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 23B9C206B5; Tue, 18 Aug 2020 13:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757766; bh=2qNEoE6XtmSILCN5KRmGGUpLPbT+yPlnrqcOhfIc3W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BZQ4Mt8657P5Q7xQHrXf5KB4fKiKgT31lIxOWkCBP6NODeeQP3J6JXMeF5nKTt4wR vOedWGnSPhqN748Ny/3iUis0aGOfaMc2EQ57cf1mFe2TOr6hsCzrDmYFPD0vRocNOw A7daa75r0SWNAcoUilOURRm93keMjV0cvHaXKbys= From: Greg Kroah-Hartman To: linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , Mauro Carvalho Chehab , Alexios Zavras , Thomas Gleixner , Hans Verkuil , linux-kernel@vger.kernel.org Subject: [PATCH 6/7] media: radio: si476x: no need to check return value of debugfs_create functions Date: Tue, 18 Aug 2020 15:36:07 +0200 Message-Id: <20200818133608.462514-6-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200818133608.462514-1-gregkh@linuxfoundation.org> References: <20200818133608.462514-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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: Mauro Carvalho Chehab Cc: Greg Kroah-Hartman Cc: Alexios Zavras Cc: Thomas Gleixner Cc: Hans Verkuil Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/radio/radio-si476x.c | 66 ++++++------------------------ 1 file changed, 13 insertions(+), 53 deletions(-) diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c index b203296de977..485b2d2d977d 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c @@ -1344,60 +1344,24 @@ static const struct file_operations radio_rsq_primary_fops = { }; -static int si476x_radio_init_debugfs(struct si476x_radio *radio) +static void si476x_radio_init_debugfs(struct si476x_radio *radio) { - struct dentry *dentry; - int ret; + radio->debugfs = debugfs_create_dir(dev_name(radio->v4l2dev.dev), NULL); - dentry = debugfs_create_dir(dev_name(radio->v4l2dev.dev), NULL); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto exit; - } - radio->debugfs = dentry; - - dentry = debugfs_create_file("acf", S_IRUGO, - radio->debugfs, radio, &radio_acf_fops); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto cleanup; - } + debugfs_create_file("acf", S_IRUGO, radio->debugfs, radio, + &radio_acf_fops); - dentry = debugfs_create_file("rds_blckcnt", S_IRUGO, - radio->debugfs, radio, - &radio_rds_blckcnt_fops); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto cleanup; - } + debugfs_create_file("rds_blckcnt", S_IRUGO, radio->debugfs, radio, + &radio_rds_blckcnt_fops); - dentry = debugfs_create_file("agc", S_IRUGO, - radio->debugfs, radio, &radio_agc_fops); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto cleanup; - } + debugfs_create_file("agc", S_IRUGO, radio->debugfs, radio, + &radio_agc_fops); - dentry = debugfs_create_file("rsq", S_IRUGO, - radio->debugfs, radio, &radio_rsq_fops); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto cleanup; - } + debugfs_create_file("rsq", S_IRUGO, radio->debugfs, radio, + &radio_rsq_fops); - dentry = debugfs_create_file("rsq_primary", S_IRUGO, - radio->debugfs, radio, - &radio_rsq_primary_fops); - if (IS_ERR(dentry)) { - ret = PTR_ERR(dentry); - goto cleanup; - } - - return 0; -cleanup: - debugfs_remove_recursive(radio->debugfs); -exit: - return ret; + debugfs_create_file("rsq_primary", S_IRUGO, radio->debugfs, radio, + &radio_rsq_primary_fops); } @@ -1534,11 +1498,7 @@ static int si476x_radio_probe(struct platform_device *pdev) goto exit; } - rval = si476x_radio_init_debugfs(radio); - if (rval < 0) { - dev_err(&pdev->dev, "Could not create debugfs interface\n"); - goto exit; - } + si476x_radio_init_debugfs(radio); return 0; exit: From patchwork Tue Aug 18 13:36:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11720899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2296014E3 for ; Tue, 18 Aug 2020 13:36:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F02D12076D for ; Tue, 18 Aug 2020 13:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757799; bh=qKMe8yvEZAbay72M2tJtP0TdwY4VnJuiqPFS8BMNa0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Nn+QnlZmQ7CwE0vq23lpgXR38RHBBIq0rP/ctuj91ercxzd6pStvY+ObUnokiiL8R xIzVmrbLAT6S3Kd6hovFTigaiZKSzVFGb69AW//DIiKJ3u0RjnMmbNn6oYhc1Lj7yH u1/C2O2yScdvpKFxQxLheZqFMJIzhvkfYTNq58qY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgHRNgd (ORCPT ); Tue, 18 Aug 2020 09:36:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:45610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726660AbgHRNgJ (ORCPT ); Tue, 18 Aug 2020 09:36:09 -0400 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 DD6D22076D; Tue, 18 Aug 2020 13:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597757769; bh=qKMe8yvEZAbay72M2tJtP0TdwY4VnJuiqPFS8BMNa0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0/CpW8GIgXJ+2e+UUMPBIshWolNDL2nz14zrE9S5cvkhP5srhs5CEWVWhY3nV5XHv Yk2FF9E1kWK/QPZWhzfCzdhVj2RhcDvXD2OSz1K3LfHOZdt9GyvFh+Ns6ZPRtPXgai jby3SMBKDzcyew0UrS65uiFTfpNE7q59jTNi4MXk= From: Greg Kroah-Hartman To: linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , Laurent Pinchart , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH 7/7] media: usb: uvc: no need to check return value of debugfs_create functions Date: Tue, 18 Aug 2020 15:36:08 +0200 Message-Id: <20200818133608.462514-7-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200818133608.462514-1-gregkh@linuxfoundation.org> References: <20200818133608.462514-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/uvc/uvc_debugfs.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c index 2b8af4b54117..1a1258d4ffca 100644 --- a/drivers/media/usb/uvc/uvc_debugfs.c +++ b/drivers/media/usb/uvc/uvc_debugfs.c @@ -73,7 +73,6 @@ static struct dentry *uvc_debugfs_root_dir; void uvc_debugfs_init_stream(struct uvc_streaming *stream) { struct usb_device *udev = stream->dev->udev; - struct dentry *dent; char dir_name[33]; if (uvc_debugfs_root_dir == NULL) @@ -82,22 +81,11 @@ void uvc_debugfs_init_stream(struct uvc_streaming *stream) snprintf(dir_name, sizeof(dir_name), "%u-%u-%u", udev->bus->busnum, udev->devnum, stream->intfnum); - dent = debugfs_create_dir(dir_name, uvc_debugfs_root_dir); - if (IS_ERR_OR_NULL(dent)) { - uvc_printk(KERN_INFO, "Unable to create debugfs %s " - "directory.\n", dir_name); - return; - } - - stream->debugfs_dir = dent; + stream->debugfs_dir = debugfs_create_dir(dir_name, + uvc_debugfs_root_dir); - dent = debugfs_create_file("stats", 0444, stream->debugfs_dir, - stream, &uvc_debugfs_stats_fops); - if (IS_ERR_OR_NULL(dent)) { - uvc_printk(KERN_INFO, "Unable to create debugfs stats file.\n"); - uvc_debugfs_cleanup_stream(stream); - return; - } + debugfs_create_file("stats", 0444, stream->debugfs_dir, stream, + &uvc_debugfs_stats_fops); } void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream)