drm: of: Mark empty drm_of_get_data_lanes_count and drm_of_get_data_lanes_ep static
PATCH 1/3 drm: of: Mark empty drm_of_get_data_lanes_count and drm_of_get_data_lanes_ep static
Mark empty implementations of drm_of_get_data_lanes_count and drm_of_get_data_lanes_ep as static inline, just like the rest of empty implementations of various functions in drm_of.h . Add missing comma to drm_of_get_data_lanes_count_ep() .
--- include/drm/drm_of.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
include/drm/drm_of.h +8 -6
@@ -112,16 +112,18 @@ drm_of_lvds_get_data_mapping(const struct device_node *port)return -EINVAL ; } -int drm_of_get_data_lanes_count (const struct device_node *endpoint, -const unsigned int min,const unsigned int max) +static inline int +drm_of_get_data_lanes_count (const struct device_node *endpoint, +const unsigned int min,const unsigned int max) {return -EINVAL ; } -int drm_of_get_data_lanes_count_ep(const struct device_node *port, - int port_reg, int reg - const unsigned int min, - const unsigned int max) +static inline int +drm_of_get_data_lanes_count_ep (const struct device_node *port, +int port_reg,int reg, +const unsigned int min, +const unsigned int max) {return -EINVAL ; }
Signature · 1 line
2.35.1
PATCH 2/3 drm/bridge: tc358775: Fix drm_of_get_data_lanes_count_ep conversion
Initialize dsi_lanes to -1, so that in case the endpoint is missing, probe would fail as it did before the conversion, instead of depending on uninitialized variable and thus undefined behavior.
--- drivers/gpu/drm/bridge/tc358775.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358775.c +1 -1
@@ -529,7 +529,7 @@ static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc)struct device_node *endpoint;struct device_node *parent;struct device_node *remote; -int dsi_lanes; +int dsi_lanes =-1 ;/* * To get the data-lanes of dsi, we need to access the dsi0_out of port1
Signature · 1 line
2.35.1
Re: [PATCH 2/3] drm/bridge: tc358775: Fix drm_of_get_data_lanes_count_ep conversion
Quoted 13 lines · Marek Vasut
Initialize
dsi_lanesto -1, so that in case the endpoint is missing, probe would fail as it did before the conversion, instead of depending on uninitialized variable and thus undefined behavior.Fixes 56426faa1492 ("drm/bridge: tc358775: Convert to drm_of_get_data_lanes_count_ep")Reported-by kernel test robot <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Maxime Ripard <[email protected]>Cc Robert Foss <[email protected]>Cc Sam Ravnborg <[email protected]>
Quoted 1 line
PATCH 3/3 drm/bridge: rcar: Drop unused variables due to drm_of_get_data_lanes_count_ep
In reply to Marek VasutThe rcar_mipi_dsi_parse_dt() now contains two uninitialized variables due to conversion to common drm_of_get_data_lanes_count_ep() helper. Drop them.
--- drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c +0 -2
@@ -679,8 +679,6 @@ static const struct mipi_dsi_host_ops rcar_mipi_dsi_host_ops = {static int rcar_mipi_dsi_parse_dt (struct rcar_mipi_dsi *dsi) { -struct device_node *ep; -u32 data_lanes[4 ];int ret; ret =drm_of_get_data_lanes_count_ep (dsi->dev->of_node,1 ,0 ,1 ,4 );
Signature · 1 line
2.35.1
Re: [PATCH 3/3] drm/bridge: rcar: Drop unused variables due to drm_of_get_data_lanes_count_ep
Quoted 13 lines · Marek Vasut
The
rcar_mipi_dsi_parse_dt()now contains two uninitialized variables due to conversion to commondrm_of_get_data_lanes_count_ep()helper. Drop them.Fixes d643daaf1694 ("drm/bridge: rcar: Convert to drm_of_get_data_lanes_count_ep")Reported-by kernel test robot <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Maxime Ripard <[email protected]>Cc Robert Foss <[email protected]>Cc Sam Ravnborg <[email protected]>
Quoted 1 line
Quoted 14 lines · Marek Vasut
Mark empty implementations of
drm_of_get_data_lanes_countanddrm_of_get_data_lanes_epas static inline, just like the rest of empty implementations of various functions indrm_of.h. Add missing comma todrm_of_get_data_lanes_count_ep().Fixes fc801750b197 ("drm: of: Add drm_of_get_data_lanes_count and drm_of_get_data_lanes_ep")Reported-by kernel test robot <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Maxime Ripard <[email protected]>Cc Robert Foss <[email protected]>Cc Sam Ravnborg <[email protected]>
Quoted 1 line
Hi Marek,
Thank you for the patch.
Quoted 14 lines · Marek Vasut
Mark empty implementations of
drm_of_get_data_lanes_countanddrm_of_get_data_lanes_epas static inline, just like the rest of empty implementations of various functions indrm_of.h. Add missing comma todrm_of_get_data_lanes_count_ep().Fixes fc801750b197 ("drm: of: Add drm_of_get_data_lanes_count and drm_of_get_data_lanes_ep")Reported-by kernel test robot <[email protected]>Signed-off-by Marek Vasut <[email protected]>Cc Andrzej Hajda <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Maxime Ripard <[email protected]>Cc Robert Foss <[email protected]>Cc Sam Ravnborg <[email protected]>
Quoted 1 line
Quoted 9 lines
--- include/drm/drm_of.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)include/drm/drm_of.h +0
-0
include/drm/drm_of.h drm_of_lvds_get_data_mapping(const struct device_node *port) · line 117
Quoted 8 lines
include/drm/drm_of.h +3
-2@@ -112,16 +112,18 @@ drm_of_lvds_get_data_mapping(const struct device_node *port)return -EINVAL ; } -int drm_of_get_data_lanes_count (const struct device_node *endpoint, -const unsigned int min,const unsigned int max) +static inline int +drm_of_get_data_lanes_count (const struct device_node *endpoint, +const unsigned int min,const unsigned int max)
Unrelated to this patch, do we need "const" for the unsigned int arguments ?
Quoted 16 lines
include/drm/drm_of.h +5
-4{return -EINVAL ; } -int drm_of_get_data_lanes_count_ep(const struct device_node *port, - int port_reg, int reg - const unsigned int min, - const unsigned int max) +static inline int +drm_of_get_data_lanes_count_ep (const struct device_node *port, +int port_reg,int reg, +const unsigned int min, +const unsigned int max) {return -EINVAL ; }
Signature · 3 lines
Regards, Laurent Pinchart