Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4242308pxb; Mon, 27 Sep 2021 12:27:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx51cnIzyq46GVddyYqNJAAugkoulXyx0l/wEfFVpAQ95P2y7tNCJgo3AovsTpJUUO5l0sl X-Received: by 2002:a17:906:5586:: with SMTP id y6mr1973831ejp.189.1632770864123; Mon, 27 Sep 2021 12:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632770864; cv=none; d=google.com; s=arc-20160816; b=OKnhmvdZwfwOz8sUExDUSHHyPJuh9Frdsf2sy/OcOJj1RECJupeG83/tfkDQxyISZ4 3vMjDinsFKACSA3F984gaswIdjffSPIjyG2YU5ki19tvSlj+38BS7rYAwTOvAAXBDPCB yNPOe7mj1EHIIUnXt7iX8vPxbBRCr/e6iw5UM7pgxjelxSA/vUSGRmCdf/53trBLjv1G CUrM7WzcdZTtlrFPjoELJ1YNjyT9Q0aU3SujFIuLHhCR1bukZ/7iQ9Y5L0bE7QCydXvr NhoIDqHeyFAg01mf0/KnX9DAdxXc2kdZZsSPHdEI/5ioO/sJW4Ht4ZrJh8gwsHfYFgZX WBtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MCXAWoe2hPDnl6UuxlpuLdgfQU364PBppRCGEYPmVb0=; b=dwXRupxea4AFA+NERCpoIO6TCAVpZp7d2rl9uTPs49TeUc98Tcxs0OLkGL4AFIwfKl 7nogES0uyVDqGAnA20gdA5TaCwT3dTN+bIHtF210zydWgQLtJVK1YKaem0+/VKCCJThS J6FEJo/Lo3vJA60dJ8Br8t1oxqinTg/j+k6g/5ekKGmvW/1l5tsQdkM1Uvcl029hafna on2mbfucuXCot8Pm6uKF1o8kNBuAAZyMoaYi8A+3vfDp5xYTIhByAo81y+1lPjLaFxXr siVhXSkeagKQr4DrJp3AOyyRmCUgISJCs+DL7QMYxGWe0XoQ++8P9Nsg+Tr3u1xaVea4 J/yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mbGQxRgT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j30si19838434ejj.467.2021.09.27.12.27.19; Mon, 27 Sep 2021 12:27:44 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mbGQxRgT; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236399AbhI0T1i (ORCPT + 99 others); Mon, 27 Sep 2021 15:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236225AbhI0T1h (ORCPT ); Mon, 27 Sep 2021 15:27:37 -0400 Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E52EC061575 for ; Mon, 27 Sep 2021 12:25:59 -0700 (PDT) Received: by mail-ot1-x336.google.com with SMTP id g62-20020a9d2dc4000000b0054752cfbc59so20163314otb.1 for ; Mon, 27 Sep 2021 12:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MCXAWoe2hPDnl6UuxlpuLdgfQU364PBppRCGEYPmVb0=; b=mbGQxRgTqATeGY9NASfmguVg9jvSV3496BTmre+jw8LnT1PyWF8ESk/hhQZxTVuXRx RA7MY1ggMsy5TuPRrLIEOz2dvGlIe64Bbnb4wSr5ACfkekarDHL0ivpJsBmEvrtkfI0V zphtnmLnFCsr3w2K+6yIkZzaPhCki9gXOQ2fwxoWTu47/duXoQFDKIyVF3RrB2Yki8Pn XivF82i72WACsannApXQrVsjOSysc1txsJspoawaGIjVY/+sdyQLwtFX052+DrgaHNrK 7rEsSsKTQeDygsLqRtt8QIgDYWhWRBSZtaEg7elSQnKC3XWr1Uu8m63RL3JW3BXhnv1X nDAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MCXAWoe2hPDnl6UuxlpuLdgfQU364PBppRCGEYPmVb0=; b=FQczppgU76L5SnRrdcbgG8ZgolHr8AaM3/fTdC+BdFmhKFE32BhHZN+kjrz0jnhfRh 2M/Bqwu2Q6eLqmmRumfkHtcXpWh677UnILvK5mLazSPc1aYGsSGbeLZdFjjcI8bPI3/f wsltgN3nkMxgQ2KBtIFbHm7qnnYVAErOg6LCoG6eLep10NJpmTz8xT8/WvwvliIMWrZr x+aWjRkS6NmOpZaG7Qgvd+RoGjMYtGU8mYIIha+1RTRvQtVXXgk6peINviRD53bbthCt yY0Tbf3YhkU4N9GmrEd5ZWeZ2pemuCGUUJL5S2zlsiXXmv27UhGgyPqMJXqxJx1Pa84a tv5w== X-Gm-Message-State: AOAM5339F+dVCddLvhWVwXmvIXjRac3WbVXp4LUf/3F8E5QNTQ/Xa4e1 jGSGw9BDzQlkQspsrrV4sVthTqsPJbiJEbilKuE= X-Received: by 2002:a9d:6d14:: with SMTP id o20mr1475135otp.357.1632770758956; Mon, 27 Sep 2021 12:25:58 -0700 (PDT) MIME-Version: 1.0 References: <1632640580-61609-1-git-send-email-yang.lee@linux.alibaba.com> In-Reply-To: From: Alex Deucher Date: Mon, 27 Sep 2021 15:25:48 -0400 Message-ID: Subject: Re: [PATCH] drm/amdkfd: fix resource_size.cocci warnings To: Amos Jianjun Kong Cc: Yang Li , Dave Airlie , Daniel Vetter , "Kuehling, Felix" , "Deucher, Alexander" , Christian Koenig , amd-gfx list , Maling list - DRI developers , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Sun, Sep 26, 2021 at 3:10 PM Amos Jianjun Kong wrote: > > On Sun, Sep 26, 2021 at 3:17 PM Yang Li wrote: >> >> 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)); > > > Looks good. > Reviewed-by: Amos Kong > > >> >> return PTR_ERR(r); >> } >> >> -- >> 1.8.3.1 >>