Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: Use USEC_PER_MSEC rather than the hard coding
Date: Wed, 20 Mar 2024 16:58:11 -0400	[thread overview]
Message-ID: <ZftN44UvrDaqqivr@intel.com> (raw)
In-Reply-To: <20240320083325.3258720-1-himal.prasad.ghimiray@intel.com>

On Wed, Mar 20, 2024 at 02:03:25PM +0530, Himal Prasad Ghimiray wrote:
> Use USEC_PER_MSEC rather than the hard coded value of 1000.
> 
> Static analyzer Reported "casting either timeout_ms or
> 1000U to type u64" to avoid overflow-before-widen.
> Using USEC_PER_MSEC seems better and will help with static analyzer
> report cleanup.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_pcode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
> index b324dc2a5deb..627e094c7cbe 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.c
> +++ b/drivers/gpu/drm/xe/xe_pcode.c
> @@ -74,7 +74,7 @@ static int pcode_mailbox_rw(struct xe_gt *gt, u32 mbox, u32 *data0, u32 *data1,
>  	xe_mmio_write32(gt, PCODE_MAILBOX, PCODE_READY | mbox);
>  
>  	err = xe_mmio_wait32(gt, PCODE_MAILBOX, PCODE_READY, 0,
> -			     timeout_ms * 1000, NULL, atomic);
> +			     timeout_ms * USEC_PER_MSEC, NULL, atomic);
>  	if (err)
>  		return err;
>  
> -- 
> 2.25.1
> 

      parent reply	other threads:[~2024-03-20 20:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  8:33 [PATCH] drm/xe: Use USEC_PER_MSEC rather than the hard coding Himal Prasad Ghimiray
2024-03-20  8:25 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-20  8:25 ` ✓ CI.checkpatch: " Patchwork
2024-03-20  8:26 ` ✓ CI.KUnit: " Patchwork
2024-03-20  8:36 ` ✓ CI.Build: " Patchwork
2024-03-20  8:39 ` ✓ CI.Hooks: " Patchwork
2024-03-20  8:40 ` ✓ CI.checksparse: " Patchwork
2024-03-20  9:04 ` ✓ CI.BAT: " Patchwork
2024-03-20 20:58 ` Rodrigo Vivi [this message]

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=ZftN44UvrDaqqivr@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.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