Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp484251pxb; Mon, 25 Oct 2021 12:08:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw6g/hElhhfTd4o3RixfbArjWEXfsZVF9CdpArCknxxhXA/rqkV+KALwuCfOM1L6IjzIHk X-Received: by 2002:a17:90b:164b:: with SMTP id il11mr38191011pjb.98.1635188896227; Mon, 25 Oct 2021 12:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635188896; cv=none; d=google.com; s=arc-20160816; b=L6N6F8aeD4/kvC5YD4Yd9eQo7QwmJnYkP7Ow83NxIxo9bX2fIW3iUqQvak/fRq7NoE GJUivq1H78VWtVUfZdR9DOkGBxuBgloeX/wj/GbR79v3DEFc8kiurQ9ObnhiSEEA9DX/ enNu7sNbsDYZjcJ9atgNVDOUFxAJdLx5evpK72JvuwYu2lZvhQqU/wxo9R09wTAp9+PV PJVgAVhjT14eTyNvb2oC+zphitfQ2L05805vuHf+n8Qwlk68K06IA8eC71OVdz9GRfjM u27NMCy5igAk+P2OGvXD65KhVJblabsnHlxFZcbIXZU+/epYo0pG+rldDtmliCWBQDtP m2FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=FR/LLES6l9zq5pctc2I8IdAlUDg/unC5pUMdB3wzd2c=; b=QeUcEYnS4+6mBjGwtCwF9YOG9oOQW5pHyvbIV/Xmz8D7VxXO0YJoPSckdkN9vouJYU vuqMCXzVS0KTir+clHttCpH9ZXfpUUN9miMtJyMrw49bPQLMLyRr9o8BGo+DF8IvDIyV u0LMH69vmUK7oxQ2Jvmff0F3+LeX3yo9bLKxUSms7+/bbq92xWVZZYp2wv/PMdOkDiUy 4UTVfsOix3QU7W464qsK17O6DhSPRC2HreeQSmheRlGcN2ksudH/HxlSXlGA665mpcdP zyoljYsAAkUYMZlfNe8NJsWKNYaSQSkBGaeDdytAW/npphTWONPk097/yEd8eT/TXFDY qp5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si29814637pfh.288.2021.10.25.12.07.58; Mon, 25 Oct 2021 12:08:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231437AbhJYPqm (ORCPT + 99 others); Mon, 25 Oct 2021 11:46:42 -0400 Received: from mga05.intel.com ([192.55.52.43]:5202 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbhJYPqk (ORCPT ); Mon, 25 Oct 2021 11:46:40 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="315885621" X-IronPort-AV: E=Sophos;i="5.87,180,1631602800"; d="scan'208";a="315885621" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 08:42:38 -0700 X-IronPort-AV: E=Sophos;i="5.87,180,1631602800"; d="scan'208";a="446684809" Received: from dscaswel-mobl2.ger.corp.intel.com (HELO [10.213.242.254]) ([10.213.242.254]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 08:42:29 -0700 Subject: Re: [PATCH] drm/i915: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) To: Wan Jiabing , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Maarten Lankhorst , Jason Ekstrand , Matthew Brost , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: kael_w@yeah.net References: <20211025113316.24424-1-wanjiabing@vivo.com> From: Matthew Auld Message-ID: <58331d3d-c3e3-0e82-eb7a-469c6e72d7a7@intel.com> Date: Mon, 25 Oct 2021 16:42:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20211025113316.24424-1-wanjiabing@vivo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/10/2021 12:32, Wan Jiabing wrote: > Fix following coccicheck warning: > ./drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:3117:15-22: WARNING: > ERR_CAST can be used with eb->requests[i]. > > Signed-off-by: Wan Jiabing Pushed to drm-intel-gt-next. Thanks. > --- > drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c > index 4d7da07442f2..eb2dcaf78d08 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c > @@ -3114,7 +3114,7 @@ eb_requests_create(struct i915_execbuffer *eb, struct dma_fence *in_fence, > /* Allocate a request for this batch buffer nice and early. */ > eb->requests[i] = i915_request_create(eb_find_context(eb, i)); > if (IS_ERR(eb->requests[i])) { > - out_fence = ERR_PTR(PTR_ERR(eb->requests[i])); > + out_fence = ERR_CAST(eb->requests[i]); > eb->requests[i] = NULL; > return out_fence; > } >