diff mbox series

[v2,1/2] ASoC: cs35l41: Add one more variable in the debug log

Message ID 20220328042210.37660-1-hui.wang@canonical.com (mailing list archive)
State Superseded
Headers show
Series [v2,1/2] ASoC: cs35l41: Add one more variable in the debug log | expand

Commit Message

Hui Wang March 28, 2022, 4:22 a.m. UTC
otp_map[].size is a key variable to compute the value of otp_val and
to update the bit_offset, it is helpful to debug if could put it in
the debug log.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
---
 sound/soc/codecs/cs35l41-lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lucas Tanure March 28, 2022, 8:40 a.m. UTC | #1
On 3/28/22 05:22, Hui Wang wrote:
> otp_map[].size is a key variable to compute the value of otp_val and
> to update the bit_offset, it is helpful to debug if could put it in
> the debug log.
> 
> Signed-off-by: Hui Wang <hui.wang@canonical.com>
> ---
>   sound/soc/codecs/cs35l41-lib.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/cs35l41-lib.c b/sound/soc/codecs/cs35l41-lib.c
> index e5a56bcbb223..d0a480c40231 100644
> --- a/sound/soc/codecs/cs35l41-lib.c
> +++ b/sound/soc/codecs/cs35l41-lib.c
> @@ -822,8 +822,8 @@ int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
>   	word_offset = otp_map_match->word_offset;
>   
>   	for (i = 0; i < otp_map_match->num_elements; i++) {
> -		dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d\n",
> -			bit_offset, word_offset, bit_sum % 32);
> +		dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d otp_map[i].size = %d\n",
> +			bit_offset, word_offset, bit_sum % 32, otp_map[i].size);

otp_map[i].size is u8, please use %u to print it.
And add an "," between "bit_sum mod" and "otp_map[i].size" to keep 
consistency.

>   		if (bit_offset + otp_map[i].size - 1 >= 32) {
>   			otp_val = (otp_mem[word_offset] &
>   					GENMASK(31, bit_offset)) >> bit_offset;
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs35l41-lib.c b/sound/soc/codecs/cs35l41-lib.c
index e5a56bcbb223..d0a480c40231 100644
--- a/sound/soc/codecs/cs35l41-lib.c
+++ b/sound/soc/codecs/cs35l41-lib.c
@@ -822,8 +822,8 @@  int cs35l41_otp_unpack(struct device *dev, struct regmap *regmap)
 	word_offset = otp_map_match->word_offset;
 
 	for (i = 0; i < otp_map_match->num_elements; i++) {
-		dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d\n",
-			bit_offset, word_offset, bit_sum % 32);
+		dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d otp_map[i].size = %d\n",
+			bit_offset, word_offset, bit_sum % 32, otp_map[i].size);
 		if (bit_offset + otp_map[i].size - 1 >= 32) {
 			otp_val = (otp_mem[word_offset] &
 					GENMASK(31, bit_offset)) >> bit_offset;