From nobody Wed Sep 17 03:31:45 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D414C4332F for ; Thu, 22 Dec 2022 21:15:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbiLVVPi (ORCPT ); Thu, 22 Dec 2022 16:15:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229754AbiLVVPf (ORCPT ); Thu, 22 Dec 2022 16:15:35 -0500 Received: from msg-2.mailo.com (msg-2.mailo.com [213.182.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B220414D1C for ; Thu, 22 Dec 2022 13:15:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1671743721; bh=wdZWXREs23UJurCPJSaRRURkt4bR1UNV3+Qmxgjy/wY=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=Rq7SDQLqgswGo4+TLDsSsZffMG16TZocNQpPGke+zZ49bjiyRG5MfrHQi4jDy7aKb SuCdgsRvG2BBdJK7xhMJmU36KwvlVV1HfwQ/aYBOoINF4LqQjh6XaYBYgeNo2RATs5 sSj1+or5XUSOya/Di72vgQD8G5rxi6WRJy097jeo= Received: by b-5.in.mailobj.net [192.168.90.15] with ESMTP via ip-206.mailobj.net [213.182.55.206] Thu, 22 Dec 2022 22:15:21 +0100 (CET) X-EA-Auth: x1X1YHVLLgk9fNauahX0z1zlVD+p3LfWBHpwaT7t1dquufMWtxg6rDDVcYt7XJRu1H+sXOFe1ZJX4yXwGMQ0/piD64dKEliL Date: Fri, 23 Dec 2022 02:45:00 +0530 From: Deepak R Varma To: Felix Kuehling , Alex Deucher , Christian =?iso-8859-1?Q?K=F6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar , Praveen Kumar , drv@mailo.com Subject: [PATCH] drm/amdkfd: Use resource_size() helper function Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the resource_size() function instead of a open coded computation resource size. It makes the code more readable. Issue identified using resource_size.cocci coccinelle semantic patch. Signed-off-by: Deepak R Varma --- Note: Proposed change compile tested only. 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 10048ce16aea..de8ce72344fc 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c @@ -1027,8 +1027,7 @@ int svm_migrate_init(struct amdgpu_device *adev) /* Disable SVM support capability */ pgmap->type =3D 0; if (pgmap->type =3D=3D MEMORY_DEVICE_PRIVATE) - 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); } -- 2.34.1