Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2944136pxb; Sun, 26 Sep 2021 00:17:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrwFYCF/YuDXkAPH3dL/OPKmwaMcYBrOxHCZeCR3vlR+GgulXLoWBKcHU+pGC95B/5LhXr X-Received: by 2002:a5e:a609:: with SMTP id q9mr15617411ioi.23.1632640645017; Sun, 26 Sep 2021 00:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632640645; cv=none; d=google.com; s=arc-20160816; b=jxl6FK8Q23XcSKFyTzAz9d5PcBjSW/9UeG4FlxcgsdH8LKFRUA06lhSonO1qyO7bVH JPrv++nQG6+4wIjTBESzzrJPK0TXknb5wkmEb2HcMpUhpo109NiZFaaGcg0GWnSlehQ9 UEtKnlUd4DipHMPyF8IGIKPcW/KgSgEYIEi34RH4nmWB2TiS+CbnE+BK1NTmVrchmfLW rDzgv0rU0sjvLjTGam43Vr9lWkSJBALLtJv4oM3I8ETNL/Q5kVMHGMWRdsJnxw8DcO0C TqtceU6zR/1NGAUwgdHsDPKnr276foEUm2IRhINTiFYvqSEJEHxMt08VXKIiYD7Vt0XD 1+Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=uu7tySkUR5SO49zp0F2mGYLc5BLvde3QXUXvWgLo6c0=; b=yTMavjLRUOyfvasvjmD4YfMKSxxyVdHo6jT5MggBmV482g7gjm5F5GVNJHlMLWL36e 3P/oqHWzRF6JzflA7eswMsdA+/d9k8ra58DXuEA6FoF3FV3EONT94azOwkQKT84A9s19 eZsOwCTj1Y4F/jSwmQGeBn1IsTTLI6+P7sJ9zMlh79BbNhmgm2mg0d3kS0SccJ92nA3t aqjdlz9OLeuaZnf5gxRShXpPtYlB83juzXEV5n7Sj4WmiFOK3Q6MwG0B7o4FNjYT47Me st3dPVhfddtYAK1crWTIBGSwXq3TG3ijTbb7rrZFy8ah6ddXwIgw6C3Sq+OKisakENNC C15A== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n6si13485972jac.111.2021.09.26.00.17.12; Sun, 26 Sep 2021 00:17:25 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbhIZHSG (ORCPT + 99 others); Sun, 26 Sep 2021 03:18:06 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:44605 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbhIZHSF (ORCPT ); Sun, 26 Sep 2021 03:18:05 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0UpaywW-_1632640586; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UpaywW-_1632640586) by smtp.aliyun-inc.com(127.0.0.1); Sun, 26 Sep 2021 15:16:28 +0800 From: Yang Li To: airlied@linux.ie Cc: daniel@ffwll.ch, Felix.Kuehling@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] drm/amdkfd: fix resource_size.cocci warnings Date: Sun, 26 Sep 2021 15:16:20 +0800 Message-Id: <1632640580-61609-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use resource_size function on resource object instead of explicit computation. Clean up coccicheck warning: ./drivers/gpu/drm/amd/amdkfd/kfd_migrate.c:905:10-13: ERROR: Missing resource_size with res Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c index 4a16e3c..f53e17a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c @@ -901,8 +901,7 @@ int svm_migrate_init(struct amdgpu_device *adev) /* Disable SVM support capability */ pgmap->type = 0; - devm_release_mem_region(adev->dev, res->start, - res->end - res->start + 1); + devm_release_mem_region(adev->dev, res->start, resource_size(res)); return PTR_ERR(r); } -- 1.8.3.1