From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, g.liakhovetski@gmx.de,
s.nawrocki@samsung.com
Subject: Re: [PATCH v3 2/4] v4l: of: Instead of zeroing bus_type and bus field separately, unify this
Date: Tue, 07 Apr 2015 12:47:56 +0300 [thread overview]
Message-ID: <14728842.HyHhcxnctu@avalon> (raw)
In-Reply-To: <1428361053-20411-3-git-send-email-sakari.ailus@iki.fi>
Hello Sakari,
Thank you for the patch.
On Tuesday 07 April 2015 01:57:30 Sakari Ailus wrote:
> Clean the entire struct starting from bus_type. As more fields are added, no
> changes will be needed in the function to reset their value explicitly.
I would s/Clean/Clear/ or s/Clean/Zero/. Same for the comment in the code.
Apart from that,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
> ---
> drivers/media/v4l2-core/v4l2-of.c | 5 +++--
> include/media/v4l2-of.h | 1 +
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/v4l2-core/v4l2-of.c
> b/drivers/media/v4l2-core/v4l2-of.c index 83143d3..3ac6348 100644
> --- a/drivers/media/v4l2-core/v4l2-of.c
> +++ b/drivers/media/v4l2-core/v4l2-of.c
> @@ -149,8 +149,9 @@ int v4l2_of_parse_endpoint(const struct device_node
> *node, int rval;
>
> of_graph_parse_endpoint(node, &endpoint->base);
> - endpoint->bus_type = 0;
> - memset(&endpoint->bus, 0, sizeof(endpoint->bus));
> + /* Zero fields from bus_type to until the end */
> + memset(&endpoint->bus_type, 0, sizeof(*endpoint) -
> + offsetof(typeof(*endpoint), bus_type));
>
> rval = v4l2_of_parse_csi_bus(node, endpoint);
> if (rval)
> diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
> index f66b92c..5bbdfbf 100644
> --- a/include/media/v4l2-of.h
> +++ b/include/media/v4l2-of.h
> @@ -60,6 +60,7 @@ struct v4l2_of_bus_parallel {
> */
> struct v4l2_of_endpoint {
> struct of_endpoint base;
> + /* Fields below this line will be cleaned by v4l2_of_parse_endpoint() */
> enum v4l2_mbus_type bus_type;
> union {
> struct v4l2_of_bus_parallel parallel;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2015-04-07 9:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-06 22:57 [PATCH v3 0/4] Add link-frequencies to struct v4l2_of_endpoint Sakari Ailus
2015-04-06 22:57 ` [PATCH v3 1/4] v4l: of: Remove the head field in " Sakari Ailus
2015-04-07 10:11 ` Laurent Pinchart
2015-04-08 22:06 ` Sakari Ailus
2015-04-06 22:57 ` [PATCH v3 2/4] v4l: of: Instead of zeroing bus_type and bus field separately, unify this Sakari Ailus
2015-04-07 9:47 ` Laurent Pinchart [this message]
2015-04-08 22:08 ` Sakari Ailus
2015-04-06 22:57 ` [PATCH v3 3/4] v4l: of: Parse variable length properties --- link-frequencies Sakari Ailus
2015-04-07 10:02 ` Laurent Pinchart
2015-04-08 22:11 ` Sakari Ailus
2015-04-06 22:57 ` [PATCH v3 4/4] smiapp: Use v4l2_of_alloc_parse_endpoint() Sakari Ailus
2015-04-07 10:10 ` Laurent Pinchart
2015-04-08 22:13 ` Sakari Ailus
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=14728842.HyHhcxnctu@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski@gmx.de \
--cc=linux-media@vger.kernel.org \
--cc=s.nawrocki@samsung.com \
--cc=sakari.ailus@iki.fi \
/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