[PATCH v2 0/2] soc: mediatek: mtk-cmdq-helper: Various cleanups

AngeloGioacchino Del Regno posted 2 patches 1 month, 2 weeks ago
drivers/soc/mediatek/mtk-cmdq-helper.c | 230 ++++++++++++-------------
1 file changed, 106 insertions(+), 124 deletions(-)
[PATCH v2 0/2] soc: mediatek: mtk-cmdq-helper: Various cleanups
Posted by AngeloGioacchino Del Regno 1 month, 2 weeks ago
Changes in v2:
 - Dropped patch marking very likely/unlikely branches
 - Removed useless .mask=0 assignment in patch 2/2.

This series performs various cleanups to the MediaTek CMDQ Helper lib,
reducing code duplication and enhancing human readability.

This also avoids double initialization struct cmdq_instruction as,
in some cases, it was stack-initialized to zero and then overwritten
completely anyway a bit later.
I'd expect compilers to be somehow smart about that, but still, while
at it ... why not :-)

Tested on MT8192 Asurada, MT8195 Tomato Chromebooks.

AngeloGioacchino Del Regno (2):
  soc: mediatek: mtk-cmdq: Move mask build and append to function
  soc: mediatek: mtk-cmdq: Move cmdq_instruction init to declaration

 drivers/soc/mediatek/mtk-cmdq-helper.c | 230 ++++++++++++-------------
 1 file changed, 106 insertions(+), 124 deletions(-)

-- 
2.46.1
Re: [PATCH v2 0/2] soc: mediatek: mtk-cmdq-helper: Various cleanups
Posted by AngeloGioacchino Del Regno 1 month, 2 weeks ago
Il 08/10/24 11:32, AngeloGioacchino Del Regno ha scritto:
> Changes in v2:
>   - Dropped patch marking very likely/unlikely branches
>   - Removed useless .mask=0 assignment in patch 2/2.
> 
> This series performs various cleanups to the MediaTek CMDQ Helper lib,
> reducing code duplication and enhancing human readability.
> 
> This also avoids double initialization struct cmdq_instruction as,
> in some cases, it was stack-initialized to zero and then overwritten
> completely anyway a bit later.
> I'd expect compilers to be somehow smart about that, but still, while
> at it ... why not :-)
> 
> Tested on MT8192 Asurada, MT8195 Tomato Chromebooks.
> 

Matthias, just making you aware that I'll wait for your feedback before
replacing v1 with this one in the MTK soc tree.

No hurry, though.

Cheers

> AngeloGioacchino Del Regno (2):
>    soc: mediatek: mtk-cmdq: Move mask build and append to function
>    soc: mediatek: mtk-cmdq: Move cmdq_instruction init to declaration
> 
>   drivers/soc/mediatek/mtk-cmdq-helper.c | 230 ++++++++++++-------------
>   1 file changed, 106 insertions(+), 124 deletions(-)
>