Message ID | Y6TI1O9adSP/OrnT@qemulion |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:504a:0:0:0:0:0 with SMTP id h10csp3412wrt; Thu, 22 Dec 2022 13:24:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXscQ318l3V8rMYzPV+QvyPrrxVWsBwNLeorHwI3gtmAVuPG5MvybnIgzCfrlHC1+Sa1T9c4 X-Received: by 2002:a05:6a20:b706:b0:a3:a1ee:47ca with SMTP id fg6-20020a056a20b70600b000a3a1ee47camr7972681pzb.46.1671744290250; Thu, 22 Dec 2022 13:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671744290; cv=none; d=google.com; s=arc-20160816; b=GQzTacZ5bk/egPBczcik1kxvfcjpfPDnNY3t0+/1FIH/cj00uBNecx3XKifAQPj48L SlSnNlkttRSKgxcelPeBtQP/HJO81rONLQQ3h0tfKs0DPpy+kbRQKDgJ8YKPtyp8RPjV fkkpBByWUAQM22dYeRzyOyW7vC89I+vdnAFaWUHcWF3XmOYgSZaGOI21C1+19qDouq4E hZn1G8sVRdufAe/B0dQ4twGzyorQTJqtFCD/y3+Mls5PQCAwkQegWsBDqC93rFIbLUp2 SDzOB9RrdwlKWu7KG9TAMeafXx/s3teFzmhC4Ra7ztWfBf83GXkWkPoKg4o4TTEMF+mJ WJTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=oboo/+atyHtBuU6Ta9/o3+3JtjtHbfx1g1OIRPA0glE=; b=uxFowcKUO4E5EzMzLRw0YWvzQmyR0NIGb4Dr3EksXqKfqrtdiq+XPyhQ5qLEUFj9wn Lq8SxKLgwB8y9qmlq7d/UfJH9qF0s7sLaaCIP0K1bcAZnqhydm6EBJ2LUYWihyoRQ3ze GG2SAFSzX2+zoenGmbVLTRQVwcVN45fJZtECA4KkvXIbONw4jQTo38HGVY5s77U5Oxu2 kiN/Jibpkt6yxdSWsEya0Ef5iNxcNDmRbXLLpuMBVbRARpTFHcBJDsmdI2EeO6VhcW4N vhNrwBFAcPniUhtA03jYhSccL1d2CiPDoL7bKs0H5HpjaK2OZVhgPuCYk9WbThSsigLI djCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Rq7SDQLq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a63b306000000b0046eed2ed669si1847971pgf.209.2022.12.22.13.24.20; Thu, 22 Dec 2022 13:24:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=Rq7SDQLq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbiLVVPh (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Thu, 22 Dec 2022 16:15:37 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <drv@mailo.com> To: Felix Kuehling <Felix.Kuehling@amd.com>, Alex Deucher <alexander.deucher@amd.com>, Christian =?iso-8859-1?q?K=F6nig?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, drv@mailo.com Subject: [PATCH] drm/amdkfd: Use resource_size() helper function Message-ID: <Y6TI1O9adSP/OrnT@qemulion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752950940535562776?= X-GMAIL-MSGID: =?utf-8?q?1752950940535562776?= |
Series |
drm/amdkfd: Use resource_size() helper function
|
|
Commit Message
Deepak R Varma
Dec. 22, 2022, 9:15 p.m. UTC
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 <drv@mailo.com>
---
Note: Proposed change compile tested only.
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--
2.34.1
Comments
On Fri, Dec 23, 2022 at 02:45:00AM +0530, Deepak R Varma wrote: > 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 <drv@mailo.com> > --- Hello, Requesting a review and feedback on this patch proposal? Thank you, ./drv
Am 2023-01-07 um 15:09 schrieb Deepak R Varma: > On Fri, Dec 23, 2022 at 02:45:00AM +0530, Deepak R Varma wrote: >> 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 <drv@mailo.com> >> --- > Hello, > Requesting a review and feedback on this patch proposal? I applied the patch to amd-staging-drm-next. Thanks, Felix > > Thank you, > ./drv > > >
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 = 0; if (pgmap->type == 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); }