[1/4] media: platform: mtk-mdp3: Use cmdq_pkt_write when no mask is needed

Message ID 20240823-mdp3-comp-cleanups-v1-1-1f8c1395ecd3@collabora.com (mailing list archive)
State New
Headers
Series media: platform: mtk-mdp3: Cleanups for masking in cmdq operations |

Commit Message

Nícolas F. R. A. Prado Aug. 23, 2024, 9:31 p.m. UTC
  cmdq_pkt_write_mask() boils down to a cmdq_pkt_write() when the mask is
0xFFFFFFFF. Call cmdq_pkt_write() directly in those cases to simplify
the code.

Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
 drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

AngeloGioacchino Del Regno Sept. 10, 2024, 9:08 a.m. UTC | #1
Il 23/08/24 23:31, Nícolas F. R. A. Prado ha scritto:
> cmdq_pkt_write_mask() boils down to a cmdq_pkt_write() when the mask is
> 0xFFFFFFFF. Call cmdq_pkt_write() directly in those cases to simplify
> the code.
> 
> Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
  

Patch

diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
index ea2ea119dd2a..90658a22a525 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c
@@ -325,8 +325,7 @@  static int mdp_path_config_subfrm(struct mdp_cmdq_cmd *cmd,
 	/* Enable mux settings */
 	for (index = 0; index < ctrl->num_sets; index++) {
 		set = &ctrl->sets[index];
-		cmdq_pkt_write_mask(&cmd->pkt, set->subsys_id, set->reg,
-				    set->value, 0xFFFFFFFF);
+		cmdq_pkt_write(&cmd->pkt, set->subsys_id, set->reg, set->value);
 	}
 	/* Config sub-frame information */
 	for (index = (num_comp - 1); index >= 0; index--) {
@@ -381,8 +380,7 @@  static int mdp_path_config_subfrm(struct mdp_cmdq_cmd *cmd,
 	/* Disable mux settings */
 	for (index = 0; index < ctrl->num_sets; index++) {
 		set = &ctrl->sets[index];
-		cmdq_pkt_write_mask(&cmd->pkt, set->subsys_id, set->reg,
-				    0, 0xFFFFFFFF);
+		cmdq_pkt_write(&cmd->pkt, set->subsys_id, set->reg, 0);
 	}
 
 	return 0;