diff mbox series

[3/5] v4l2-fwnode: Don't zero parts of struct v4l2_fwnode_endpoint anymore

Message ID 20200930144811.16612-4-sakari.ailus@linux.intel.com
State Accepted
Commit c2505342ee5b9f6370ea6a90c87a44a0f3c6b5eb
Headers show
Series [1/5] adv748x: Zero entire struct v4l2_fwnode_endpoint | expand

Commit Message

Sakari Ailus Sept. 30, 2020, 2:48 p.m. UTC
Don't zero parts of the vep argument to v4l2_fwnode_endpoint_parse()
anymore as this can no longer be done while still supporting defaults on
multiple bus types.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/v4l2-core/v4l2-fwnode.c | 12 ------------
 1 file changed, 12 deletions(-)

Comments

Niklas Söderlund Oct. 2, 2020, 5:42 p.m. UTC | #1
Hi Sakari,

Thanks for your work.

On 2020-09-30 17:48:09 +0300, Sakari Ailus wrote:
> Don't zero parts of the vep argument to v4l2_fwnode_endpoint_parse()
> anymore as this can no longer be done while still supporting defaults on
> multiple bus types.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/v4l2-core/v4l2-fwnode.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
> index dfc53d11053f..44dd04b05e29 100644
> --- a/drivers/media/v4l2-core/v4l2-fwnode.c
> +++ b/drivers/media/v4l2-core/v4l2-fwnode.c
> @@ -416,20 +416,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
>  	enum v4l2_mbus_type mbus_type;
>  	int rval;
>  
> -	if (vep->bus_type == V4L2_MBUS_UNKNOWN) {
> -		/* Zero fields from bus union to until the end */
> -		memset(&vep->bus, 0,
> -		       sizeof(*vep) - offsetof(typeof(*vep), bus));
> -	}
> -
>  	pr_debug("===== begin parsing endpoint %pfw\n", fwnode);
>  
> -	/*
> -	 * Zero the fwnode graph endpoint memory in case we don't end up parsing
> -	 * the endpoint.
> -	 */
> -	memset(&vep->base, 0, sizeof(vep->base));
> -
>  	fwnode_property_read_u32(fwnode, "bus-type", &bus_type);
>  	pr_debug("fwnode video bus type %s (%u), mbus type %s (%u)\n",
>  		 v4l2_fwnode_bus_type_to_string(bus_type), bus_type,
> -- 
> 2.27.0
> 
>
Laurent Pinchart Oct. 4, 2020, 8:36 a.m. UTC | #2
Hi Sakari,

Thank you for the patch.

On Wed, Sep 30, 2020 at 05:48:09PM +0300, Sakari Ailus wrote:
> Don't zero parts of the vep argument to v4l2_fwnode_endpoint_parse()
> anymore as this can no longer be done while still supporting defaults on
> multiple bus types.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/v4l2-core/v4l2-fwnode.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
> index dfc53d11053f..44dd04b05e29 100644
> --- a/drivers/media/v4l2-core/v4l2-fwnode.c
> +++ b/drivers/media/v4l2-core/v4l2-fwnode.c
> @@ -416,20 +416,8 @@ static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
>  	enum v4l2_mbus_type mbus_type;
>  	int rval;
>  
> -	if (vep->bus_type == V4L2_MBUS_UNKNOWN) {
> -		/* Zero fields from bus union to until the end */
> -		memset(&vep->bus, 0,
> -		       sizeof(*vep) - offsetof(typeof(*vep), bus));
> -	}
> -
>  	pr_debug("===== begin parsing endpoint %pfw\n", fwnode);
>  
> -	/*
> -	 * Zero the fwnode graph endpoint memory in case we don't end up parsing
> -	 * the endpoint.
> -	 */
> -	memset(&vep->base, 0, sizeof(vep->base));
> -
>  	fwnode_property_read_u32(fwnode, "bus-type", &bus_type);
>  	pr_debug("fwnode video bus type %s (%u), mbus type %s (%u)\n",
>  		 v4l2_fwnode_bus_type_to_string(bus_type), bus_type,
diff mbox series

Patch

diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c
index dfc53d11053f..44dd04b05e29 100644
--- a/drivers/media/v4l2-core/v4l2-fwnode.c
+++ b/drivers/media/v4l2-core/v4l2-fwnode.c
@@ -416,20 +416,8 @@  static int __v4l2_fwnode_endpoint_parse(struct fwnode_handle *fwnode,
 	enum v4l2_mbus_type mbus_type;
 	int rval;
 
-	if (vep->bus_type == V4L2_MBUS_UNKNOWN) {
-		/* Zero fields from bus union to until the end */
-		memset(&vep->bus, 0,
-		       sizeof(*vep) - offsetof(typeof(*vep), bus));
-	}
-
 	pr_debug("===== begin parsing endpoint %pfw\n", fwnode);
 
-	/*
-	 * Zero the fwnode graph endpoint memory in case we don't end up parsing
-	 * the endpoint.
-	 */
-	memset(&vep->base, 0, sizeof(vep->base));
-
 	fwnode_property_read_u32(fwnode, "bus-type", &bus_type);
 	pr_debug("fwnode video bus type %s (%u), mbus type %s (%u)\n",
 		 v4l2_fwnode_bus_type_to_string(bus_type), bus_type,