Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Sneh Mankad <sneh.mankad@oss.qualcomm.com>
To: Alok Tiwari <alok.a.tiwari@oracle.com>,
	andersson@kernel.org, konradybcio@kernel.org,
	linux-arm-msm@vger.kernel.org
Cc: alok.a.tiwarilinux@gmail.com
Subject: Re: [PATCH] soc: qcom: cmd-db: fix minor version decoding in debugfs output
Date: Mon, 30 Mar 2026 11:05:32 +0530	[thread overview]
Message-ID: <eed2185e-1754-4e5a-8a19-36b9f968c03a@oss.qualcomm.com> (raw)
In-Reply-To: <20260329191110.1476304-1-alok.a.tiwari@oracle.com>


On 30-Mar-26 12:41 AM, Alok Tiwari wrote:
> cmd-db encodes the version as major in the high byte and minor in the low
> byte. cmd_db_debugfs_dump() prints the full 16 bit value as the minor
> version, resulting in incorrect output.
>
> Extract minor from the low byte using (version & 0xff).
>
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
There should be a "fixes:" tag added since this is a fix.
> ---
>   drivers/soc/qcom/cmd-db.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
> index 84a75d8c4b70..eed7013c7676 100644
> --- a/drivers/soc/qcom/cmd-db.c
> +++ b/drivers/soc/qcom/cmd-db.c
> @@ -301,7 +301,7 @@ static int cmd_db_debugfs_dump(struct seq_file *seq, void *p)
>   
>   		version = le16_to_cpu(rsc->version);
>   		major = version >> 8;
> -		minor = version;
> +		minor = version & 0xff;

Minor is already a u8 type, so assigning a u16 type version to u8 type 
will automatically truncate the higher 8 bits.

Its the same reason why version is right shifted by 8 before being 
assigned to major variable.

I do not think there would be any difference in output with or without 
the change, do you have any example?

Thanks,
Sneh Mankad

>   
>   		seq_printf(seq, "Slave %s (v%u.%u)\n", name, major, minor);
>   		seq_puts(seq, "-------------------------\n");

  reply	other threads:[~2026-03-30  5:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-29 19:11 [PATCH] soc: qcom: cmd-db: fix minor version decoding in debugfs output Alok Tiwari
2026-03-30  5:35 ` Sneh Mankad [this message]
2026-03-30  6:03   ` ALOK TIWARI
2026-03-30 11:12     ` Dmitry Baryshkov
2026-03-30 13:18     ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eed2185e-1754-4e5a-8a19-36b9f968c03a@oss.qualcomm.com \
    --to=sneh.mankad@oss.qualcomm.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=alok.a.tiwarilinux@gmail.com \
    --cc=andersson@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox