diff mbox series

[2/7] media: coda: no need to check return value of debugfs_create functions

Message ID 20200818133608.462514-2-gregkh@linuxfoundation.org (mailing list archive)
State New, archived
Headers show
Series [1/7] media: cec: no need to check return value of debugfs_create functions | expand

Commit Message

Greg KH Aug. 18, 2020, 1:36 p.m. UTC
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 <p.zabel@pengutronix.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/media/platform/coda/coda-common.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Philipp Zabel Aug. 18, 2020, 1:56 p.m. UTC | #1
On Tue, 2020-08-18 at 15:36 +0200, Greg Kroah-Hartman wrote:
> 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 <p.zabel@pengutronix.de>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: linux-media@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Thank you,

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

> ---
>  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) {
diff mbox series

Patch

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) {