Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp347766pxb; Wed, 22 Sep 2021 03:41:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW7s2JkVElIfkqJ2cgpzXKIEjnHsoInuFhUexv9gWGDWuyX+nkv9bJaEMr0hdOM7ssh5yH X-Received: by 2002:a17:906:7097:: with SMTP id b23mr40087366ejk.270.1632307270198; Wed, 22 Sep 2021 03:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632307270; cv=none; d=google.com; s=arc-20160816; b=xQeMpKiHysa1tWYEHDVgiVajTRg8ijiF0PyB0lsVtDK+Nivo1bjg7Yt8cFZCCpSYya TvNLNI+0Vm7/uas+il5NRgyQxqmb0SE9/sVipFABth1lsUKKGct2NrKA8DEdDDgwPzLc Kvkcg17hJW5lKRiRH1iPWyHNgYhvhLOtplg44lDkEGGPBLrttw8AmkvhhZntpy49Bpdz HbNElXuTqcR8hz+h4Uzyy+M6x1pcDgYooRf1tw1MG0CzLzRZOT1F/WxW0mwOTtK3T99M W1zasCHMYFXZE+DNvK5q9ZAs8+NSOwCZLhdbOYNZ8sDHciloH/un1AgDTOMpN9kNXgD1 6z8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RK/A6szmx98mo88ueJWe8G2JWI5ofPbKpL+RFG4oa/k=; b=aXHwPLDzeZJaAoQmD2xi8znyHQUVopB18FVvC9EaTkemF7LeUwfm3M3LIQuANcqAuA NdeWmnSZPYHvxm7r9PU6oSlSyQh2y1lRnfVCCCrsK7S7OmOXH5qtiBJrRoOkTN4vw51S FnZgiBB7elact0zumLl0/gdSpalpQ1hMgqV1edqqNGRh6LtJU49mRbm+OfFxILBv5Dqq MOI+UYDI0X/2rm2evbqh7F04Fk7Vf/ZnRgQqo4rCT47NkUqAiAb5aieD2rr4NhKRMnUN 9m0ToVx7aH1ZiZesr86gEy4qIkkGHdRx6WYSm2HS03Zb8pAFijO8zwSdshNFJocKcymy xB8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rnnkUJn0; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c23si2187689edv.45.2021.09.22.03.40.46; Wed, 22 Sep 2021 03:41:10 -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=@kernel.org header.s=k20201202 header.b=rnnkUJn0; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235049AbhIVKkk (ORCPT + 99 others); Wed, 22 Sep 2021 06:40:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:48696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234734AbhIVKki (ORCPT ); Wed, 22 Sep 2021 06:40:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7FF16124A; Wed, 22 Sep 2021 10:39:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632307148; bh=/gc7+wOTA0t/zZJ425FFjXn+DjYzc8eMUW6GifvrrhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rnnkUJn0WU39rcKQfn/jPed6FTY7mF3iRgRKZsitvrugUkayo382ItD0I9O7Y7lME g9JN6FPXLQXmVPK5g3Jp9vIrpSm5LFZ+DYI5yMH7xvVVphqJQ3HvVIiDRsxK9ueQOR sXUFS0y4tR7caLpFZulhbVd8CMK+4OZ+i89iTl8tWjA+G94saKvinTp0MEbV+0ZOvE UzJTon0x5dPZsV7s6OQAGxiCNyj1VJ4xi22Ktgkeu+BUkHllCXONviGs/CDpPi22HU /VhzaEFw8e/k2QfrtXjkjLhqQ1AMRO2aL7+kZVHygJyRNZSHs2sqKBzkHoC+BM05if x7r15FL+ZxSSw== From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Yishai Hadas , Alex Williamson , Bjorn Helgaas , "David S. Miller" , Jakub Kicinski , Kirti Wankhede , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, Saeed Mahameed Subject: [PATCH mlx5-next 3/7] vfio/pci_core: Make the region->release() function optional Date: Wed, 22 Sep 2021 13:38:52 +0300 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yishai Hadas Make the region->release() function optional as in some cases there is nothing to do by driver as part of it. This is needed for coming patch from this series once we add mlx5_vfio_cpi driver to support live migration but we don't need a migration release function. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky --- drivers/vfio/pci/vfio_pci_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 68198e0f2a63..3ddc3adb24de 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -341,7 +341,8 @@ void vfio_pci_core_disable(struct vfio_pci_core_device *vdev) vdev->virq_disabled = false; for (i = 0; i < vdev->num_regions; i++) - vdev->region[i].ops->release(vdev, &vdev->region[i]); + if (vdev->region[i].ops->release) + vdev->region[i].ops->release(vdev, &vdev->region[i]); vdev->num_regions = 0; kfree(vdev->region); -- 2.31.1