Skip to contentSkip to conversation

media: platform: mtk-mdp3: work around unused-variable warning

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 18, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: platform: mtk-mdp3: work around unused-variable warning

From: Arnd Bergmann <[email protected]>

When CONFIG_OF is disabled, the 'data' variable is not used at all because of_match_node() turns into a dummy macro:

drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c: In function 'mdp_comp_sub_create':
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:1038:36: error: unused variable 'data' [-Werror=unused-variable]
1038 | const struct mtk_mdp_driver_data *data = mdp->mdp_data;
| ^~~~

Remove the variable again by moving the pointer dereference into the of_match_node call.

Fixes b385b991ef2f ("media: platform: mtk-mdp3: chip config split about subcomponents")
---
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +1 -2
index 75c92e282fa2..19a4a085f73a 100644
@@ -1035,7 +1035,6 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
 {
 	struct device *dev = &mdp->pdev->dev;
 	struct device_node *node, *parent;
-	const struct mtk_mdp_driver_data *data = mdp->mdp_data;
 
 	parent = dev->of_node->parent;
 
@@ -1045,7 +1044,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
 		int id, alias_id;
 		struct mdp_comp *comp;
 
-		of_id = of_match_node(data->mdp_sub_comp_dt_ids, node);
+		of_id = of_match_node(mdp->mdp_data->mdp_sub_comp_dt_ids, node);
 		if (!of_id)
 			continue;
 		if (!of_device_is_available(node)) {
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When CONFIG_OF is disabled, the 'data' variable is not used at all because of_match_node() turns into a dummy macro:

drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c: In function 'mdp_comp_sub_create':
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c:1038:36: error: unused variable 'data' [-Werror=unused-variable]
1038 | const struct mtk_mdp_driver_data *data = mdp->mdp_data;
| ^~~~

Quoted 5 lines

Remove the variable again by moving the pointer dereference into the of_match_node call.

Fixes b385b991ef2f ("media: platform: mtk-mdp3: chip config split about subcomponents")
Quoted 25 lines
---
  drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/media/platform/mediatek/mdp3/mtk-mdp3-comp.c +1 -2
index 75c92e282fa2..19a4a085f73a 100644
@@ -1035,7 +1035,6 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
  {
  	struct device *dev = &mdp->pdev->dev;
  	struct device_node *node, *parent;
-	const struct mtk_mdp_driver_data *data = mdp->mdp_data;
 
  	parent = dev->of_node->parent;
 
@@ -1045,7 +1044,7 @@ static int mdp_comp_sub_create(struct mdp_dev *mdp)
  		int id, alias_id;
  		struct mdp_comp *comp;
 
-		of_id = of_match_node(data->mdp_sub_comp_dt_ids, node);
+		of_id = of_match_node(mdp->mdp_data->mdp_sub_comp_dt_ids, node);
  		if (!of_id)
  			continue;
  		if (!of_device_is_available(node)) {