All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	Zhanjun Dong <zhanjun.dong@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/xe : Fix mixed enum type warning
Date: Thu, 21 Mar 2024 14:51:41 +0200	[thread overview]
Message-ID: <877chvn3xe.fsf@intel.com> (raw)
In-Reply-To: <20240321113210.3311749-1-himal.prasad.ghimiray@intel.com>

On Thu, 21 Mar 2024, Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> wrote:
> The issue arises from comparing an unsigned integer with a macro-defined
> value. To address this, cast the macro-defined value to the same data
> type as the other operand.

I don't think the explanations are convincing, as this has nothing to do
with enums. And in general just adding casts to ignore warnings is not
the way to go.

BR,
Jani.

>
> Cc: Zhanjun Dong <zhanjun.dong@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> ---
> Coverity Reports "Parse warning (PW.MIXED_ENUM_TYPE)
> 1. mixed_enum_type enumerated type mixed with another type"
>
>  drivers/gpu/drm/xe/xe_gt_mcr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.c b/drivers/gpu/drm/xe/xe_gt_mcr.c
> index 866bbd26ba3f..027cb60c60c1 100644
> --- a/drivers/gpu/drm/xe/xe_gt_mcr.c
> +++ b/drivers/gpu/drm/xe/xe_gt_mcr.c
> @@ -311,7 +311,7 @@ void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group,
>  {
>  	int dss_per_grp = dss_per_group(gt);
>  
> -	xe_gt_assert(gt, dss < XE_MAX_DSS_FUSE_BITS);
> +	xe_gt_assert(gt, dss < (unsigned int)XE_MAX_DSS_FUSE_BITS);
>  
>  	*group = dss / dss_per_grp;
>  	*instance = dss % dss_per_grp;

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2024-03-21 12:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 11:32 [PATCH] drm/xe : Fix mixed enum type warning Himal Prasad Ghimiray
2024-03-21 12:51 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-21 12:51 ` ✓ CI.checkpatch: " Patchwork
2024-03-21 12:51 ` Jani Nikula [this message]
2024-03-21 12:52 ` ✓ CI.KUnit: " Patchwork
2024-03-21 13:03 ` ✓ CI.Build: " Patchwork
2024-03-21 13:06 ` ✓ CI.Hooks: " Patchwork
2024-03-21 13:09 ` ✓ CI.checksparse: " Patchwork
2024-03-21 13:37 ` ✓ CI.BAT: " Patchwork

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=877chvn3xe.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=zhanjun.dong@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.