Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp653387pxb; Wed, 16 Feb 2022 01:05:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyToElSAn1Ey6OfTJfIEeqlMBq0bLbmze9X+vuEu6Pn3N5Fz9YjKoXeX5xilPpg1hRJGqUQ X-Received: by 2002:a17:90a:3f09:b0:1b8:e615:a261 with SMTP id l9-20020a17090a3f0900b001b8e615a261mr617068pjc.196.1645002307927; Wed, 16 Feb 2022 01:05:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645002307; cv=none; d=google.com; s=arc-20160816; b=plt02kmymzwTpNc1FIi3Hq0aAzR1+mGkuQ39N8+LLDUEeggq94ansXxah4Qxug52vF ootpAWrFemjX8hKbviChEYetNnt2LisrJWMngN8uJf+a6oscJLhKalDcmWWlOgR84DAw 491WKNJGJWU8yoZ5YXt8MrKmbyTkqFh3NFVCG7MMw+JY06xMRKcnhGE1g3m2h50YTWm2 UEZ58NJ7n7zkre0TOznC45GYyPlG0zbyT1bGqcQ1v/kjSPihE3q2K4ofRjXW1/JGs9nU iJlPwTE4axpAv4HyYughDchQoiQ91feTA78rnsjhHeBz2qVWHKm69hXbmQvob1ZfscBv bwcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=CjszhAvdE3cd50CznAY7L2QignrCC8SqyJaHpW1XI7E=; b=Cu8PSyUOX3Ks+UdfTa5WRgpYKfGHctB0zKuMiwy1CGXTMMSfLOc7++5nww2z5IafsZ Zc6hSOlCrJqg2u36cXUWJLKWZaM4MI0h4wzdh4drRmmE9xxRYfg9SoDp1KAV/AfaLl2l jI6hOgy0cPd9VenuqDoH0rdkMhGIzIKUzSa47+wCqwIoHb+dON9t2umhdFweCayaQBPj QSEWK0eZPw2Cw0fnrMeV8xIQuAwWQbUhb1stmdW/qlaDC7pu0BxROJWXEdx1FwPdmXfs +/Z3DVcIwh4/wLXSA7nphOn7jMTDKHUwyGX53cxxzZy/dujBk6BGVDQJJTndWZ7CvJm5 OAxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KgKF8cKy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h1si4818979pgv.192.2022.02.16.01.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 01:05:07 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KgKF8cKy; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AFE449681C; Wed, 16 Feb 2022 01:02:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbiBPJC3 (ORCPT + 99 others); Wed, 16 Feb 2022 04:02:29 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:52096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230518AbiBPJC2 (ORCPT ); Wed, 16 Feb 2022 04:02:28 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D78586E38; Wed, 16 Feb 2022 01:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645002136; x=1676538136; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=mwF1U5j+drzsRrwL7zZWjzrwyGUiQkfyhUKOWPFbLPM=; b=KgKF8cKykpQqZ3HjSpxnJFWn/ty/XllRG4ENAYkEKT2w8eHWA6DZ8PpC LOObUtcrKyAqwu9TksdAxF8Jz6XmWt/eLnJNVk2Lu6EyND/EAHpYFuuaT nNm9fYbqpWjn6N79rGhVfl/TlYrVfDGWssjAzSo7ACtn42dKgYXXdsuMP Ugi6rwp42pJiAEVddYmZ7lTrCXzCFBHfIb7emeT0Ld3a4JAftatKxzavH pnYQbWr/HY50heNdAC1zF6k/OhyRGMr3YinCcefkzKRBm8KcaNagZySAj JS9iQt9pnCeLNe3sTmLsp6QzualmJ/5lc8xJLMJ6jyGf8fX+++8urOUnj w==; X-IronPort-AV: E=McAfee;i="6200,9189,10259"; a="275137222" X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="275137222" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 01:02:15 -0800 X-IronPort-AV: E=Sophos;i="5.88,373,1635231600"; d="scan'208";a="704216865" Received: from rbilei-mobl.ger.corp.intel.com (HELO localhost) ([10.252.13.113]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2022 01:02:10 -0800 From: Jani Nikula To: Jiapeng Chong Cc: joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, tvrtko.ursulin@linux.intel.com, airlied@linux.ie, daniel@ffwll.ch, sumit.semwal@linaro.org, christian.koenig@amd.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Jiapeng Chong , Abaci Robot Subject: Re: [PATCH] drm/i915/gt: fix unsigned integer to signed assignment In-Reply-To: <20220216083849.91239-1-jiapeng.chong@linux.alibaba.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220216083849.91239-1-jiapeng.chong@linux.alibaba.com> Date: Wed, 16 Feb 2022 11:02:06 +0200 Message-ID: <87h78z5gmp.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 Feb 2022, Jiapeng Chong wrote: > Eliminate the follow smatch warning: > > drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:4640 > guc_create_virtual() warn: assigning (-2) to unsigned variable > 've->base.instance'. > > drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c:4641 > guc_create_virtual() warn: assigning (-2) to unsigned variable > 've->base.uabi_instance'. > > Reported-by: Abaci Robot > Signed-off-by: Jiapeng Chong The report seems to be valid, but I don't think this is the fix. Where do we even check for invalid instance/uabi_instance in code? BR, Jani. > --- > drivers/gpu/drm/i915/gt/intel_engine_types.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h > index 36365bdbe1ee..dc7cc06c68e7 100644 > --- a/drivers/gpu/drm/i915/gt/intel_engine_types.h > +++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h > @@ -328,10 +328,10 @@ struct intel_engine_cs { > intel_engine_mask_t logical_mask; > > u8 class; > - u8 instance; > + s8 instance; > > u16 uabi_class; > - u16 uabi_instance; > + s16 uabi_instance; > > u32 uabi_capabilities; > u32 context_size; -- Jani Nikula, Intel Open Source Graphics Center