Re: [PATCH 5/5] ASoC: mediatek: mt8188-mt6359: Use bitfield macros for registers

From: Alexandre Mergnat
Date: Thu Jun 08 2023 - 06:01:12 EST


On 08/06/2023 11:57, AngeloGioacchino Del Regno wrote:
-    int test_done_1, test_done_2;
+    u8 test_done_1, test_done_2;
      int cycle_1, cycle_2;

Shouldn't be unsigned too ?

I'm wondering if it would be better (probably in another patch) to change the data type of the other variables too, to match their use-case. (maybe it's already the case, I'm just wondering)


In theory, yes, cycle_1 and 2 should be unsigned, but the signedness of this
variable is getting used in the calibration logic later, as in the for loop
they are both being reinitialized to -1 ... so I couldn't just switch 'em to
unsigned.

Understood, thanks for your explanation.

--
Regards,
Alexandre