Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: llvm@lists.linux.dev, intel-xe@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/xe: Fix warning on impossible condition
Date: Wed, 3 Jan 2024 09:07:36 -0700	[thread overview]
Message-ID: <20240103160736.GA3837497@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20231218163301.3453285-1-lucas.demarchi@intel.com>

On Mon, Dec 18, 2023 at 08:33:01AM -0800, Lucas De Marchi wrote:
> Having a different value for op is not possible: this is already kept
> out of user-visible warning by the check in xe_wait_user_fence_ioctl()
> if op > MAX_OP. The warning is useful as if this switch() is not update
> when a new op is added, it should be triggered.
> 
> Fix warning as reported by 0-DAY CI Kernel:
> 
> 	drivers/gpu/drm/xe/xe_wait_user_fence.c:46:2: warning: variable 'passed' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
> 
> Closes: https://lore.kernel.org/oe-kbuild-all/202312170357.KPSinwPs-lkp@intel.com/
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

I am now seeing this warning in -next, can this be applied as a fix so
that our builds are not broken?

> ---
>  drivers/gpu/drm/xe/xe_wait_user_fence.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_wait_user_fence.c b/drivers/gpu/drm/xe/xe_wait_user_fence.c
> index b0a7896f7fcb..a75eeba7bfe5 100644
> --- a/drivers/gpu/drm/xe/xe_wait_user_fence.c
> +++ b/drivers/gpu/drm/xe/xe_wait_user_fence.c
> @@ -46,6 +46,7 @@ static int do_compare(u64 addr, u64 value, u64 mask, u16 op)
>  		break;
>  	default:
>  		XE_WARN_ON("Not possible");
> +		return -EINVAL;
>  	}
>  
>  	return passed ? 0 : 1;
> -- 
> 2.40.1
> 

  parent reply	other threads:[~2024-01-03 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 16:33 [PATCH] drm/xe: Fix warning on impossible condition Lucas De Marchi
2023-12-18 16:39 ` Rodrigo Vivi
2023-12-18 21:14 ` ✓ CI.Patch_applied: success for " Patchwork
2023-12-18 21:14 ` ✗ CI.checkpatch: warning " Patchwork
2023-12-18 21:15 ` ✓ CI.KUnit: success " Patchwork
2023-12-18 21:23 ` ✓ CI.Build: " Patchwork
2023-12-18 21:23 ` ✓ CI.Hooks: " Patchwork
2023-12-18 21:25 ` ✓ CI.checksparse: " Patchwork
2023-12-18 21:59 ` ✓ CI.BAT: " Patchwork
2024-01-03 16:07 ` Nathan Chancellor [this message]
2024-01-04  5:51   ` [PATCH] " Lucas De Marchi

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=20240103160736.GA3837497@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=llvm@lists.linux.dev \
    --cc=lucas.demarchi@intel.com \
    --cc=rodrigo.vivi@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