[PATCH] drm/i915/gvt: Fix klocwork issues about data size

Zhenyu Wang zhenyuw at linux.intel.com
Fri Mar 27 07:24:41 UTC 2020


On 2020.03.24 20:30:21 +0800, Tina Zhang wrote:
> Add llu suffix and cast operator to fix the klocwork warning about
> "Operands in a bitwise operation have different size"
> 
> Signed-off-by: Tina Zhang <tina.zhang at intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/scheduler.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c
> index 8436984cd1f6..4e11cfaf41f0 100644
> --- a/drivers/gpu/drm/i915/gvt/scheduler.c
> +++ b/drivers/gpu/drm/i915/gvt/scheduler.c
> @@ -304,8 +304,8 @@ shadow_context_descriptor_update(struct intel_context *ce,
>  	 * Update bits 0-11 of the context descriptor which includes flags
>  	 * like GEN8_CTX_* cached in desc_template
>  	 */
> -	desc &= ~(0x3 << GEN8_CTX_ADDRESSING_MODE_SHIFT);
> -	desc |= workload->ctx_desc.addressing_mode <<
> +	desc &= ~(0x3ull << GEN8_CTX_ADDRESSING_MODE_SHIFT);
> +	desc |= (u64)workload->ctx_desc.addressing_mode <<
>  		GEN8_CTX_ADDRESSING_MODE_SHIFT;
>  
>  	ce->lrc_desc = desc;
> -- 

Acked-by: Zhenyu Wang <zhenyuw at linux.intel.com>

Applied, thanks!

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20200327/defd96b6/attachment.sig>


More information about the intel-gvt-dev mailing list