From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: uvc_debugfs: remove unnecessary NULL check before debugfs_remove_recursive
Date: Tue, 07 Aug 2018 01:48:15 +0300 [thread overview]
Message-ID: <1774555.GGbckhaAKE@avalon> (raw)
In-Reply-To: <20171112081859.GA19079@embeddedor.com>
Hi Gustavo,
Thank you for the patch.
On Sunday, 12 November 2017 10:18:59 EEST Gustavo A. R. Silva wrote:
> NULL check before freeing functions like debugfs_remove_recursive
> is not needed.
"functions like debugfs_remove_recursive" seems a bit vague to me. I'd prefer
being more precise here, and say that "debugfs_remove_recursive() accepts a
NULL parameter and returns immediately, there's no need for a NULL check in
the caller.".
>
> This issue was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
> ---
> drivers/media/usb/uvc/uvc_debugfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_debugfs.c
> b/drivers/media/usb/uvc/uvc_debugfs.c index 368f8f8..6995aeb 100644
> --- a/drivers/media/usb/uvc/uvc_debugfs.c
> +++ b/drivers/media/usb/uvc/uvc_debugfs.c
> @@ -128,6 +128,5 @@ void uvc_debugfs_init(void)
>
> void uvc_debugfs_cleanup(void)
> {
> - if (uvc_debugfs_root_dir != NULL)
> - debugfs_remove_recursive(uvc_debugfs_root_dir);
> + debugfs_remove_recursive(uvc_debugfs_root_dir);
> }
There's another occurrence in uvc_debugfs_cleanup_stream(). I'll address it as
well in this patch. With that change and the commit message update,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
and applied to my tree.
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2018-08-07 0:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-12 8:18 [PATCH] usb: uvc_debugfs: remove unnecessary NULL check before debugfs_remove_recursive Gustavo A. R. Silva
2018-08-06 22:48 ` Laurent Pinchart [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1774555.GGbckhaAKE@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=garsilva@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).