mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Karan Sanghavi <karansanghvi98@gmail.com>,
	Yazen Ghannam <Yazen.Ghannam@amd.com>,
	Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] RAS/AMD/ATL: Fix unintended sign extension issue from coverity
Date: Mon, 4 Nov 2024 14:51:56 -0700	[thread overview]
Message-ID: <3c347f99-485c-453d-9b9a-9924abf1e868@linuxfoundation.org> (raw)
In-Reply-To: <20241104-coverity1593397signextension-v1-1-4cfae6532140@gmail.com>

On 11/4/24 11:34, Karan Sanghavi wrote:
> Explicit cast pc to u32 to avoid sign extension while left shift
> 
> Issue reported by coverity with CID: 1593397
> 
> Signed-off-by: Karan Sanghavi <karansanghvi98@gmail.com>
> ---
> Coverity  Link:
> https://scan7.scan.coverity.com/#/project-view/51975/11354?selectedIssue=1593397

Please include the coverity message instead of this link so
reviewers without coverity accounts can see the report.

> ---
>   drivers/ras/amd/atl/umc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ras/amd/atl/umc.c b/drivers/ras/amd/atl/umc.c
> index dc8aa12f63c8..916c867faaf8 100644
> --- a/drivers/ras/amd/atl/umc.c
> +++ b/drivers/ras/amd/atl/umc.c
> @@ -293,7 +293,7 @@ static unsigned long convert_dram_to_norm_addr_mi300(unsigned long addr)
>   	}
>   
>   	/* PC bit */
> -	addr |= pc << bit_shifts.pc;
> +	addr |= (u32)pc << bit_shifts.pc;

How did you determine this is the right fix and how did
test this change?

>   
>   	/* SID bits */
>   	for (i = 0; i < NUM_SID_BITS; i++) {
> 
> ---
> base-commit: 81983758430957d9a5cb3333fe324fd70cf63e7e
> change-id: 20241104-coverity1593397signextension-78c9b2c21d51
> 
> Best regards,

thanks,
-- Shuah

  reply	other threads:[~2024-11-04 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 18:34 Karan Sanghavi
2024-11-04 21:51 ` Shuah Khan [this message]
2024-11-05 16:20   ` Karan Sanghavi
2024-11-07 14:41     ` Yazen Ghannam

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=3c347f99-485c-453d-9b9a-9924abf1e868@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=Yazen.Ghannam@amd.com \
    --cc=bp@alien8.de \
    --cc=karansanghvi98@gmail.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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

all inboxes | Powered by JetHome®