Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp801991pxb; Tue, 12 Apr 2022 13:52:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzznH4bnnkql9E1GIsw2n7FR8bXx53WAbyvqTfLNda5s8/NrVzGVdRdqKd2PIHn1bnpWMbZ X-Received: by 2002:a63:314c:0:b0:39d:aeef:52a2 with SMTP id x73-20020a63314c000000b0039daeef52a2mr395677pgx.232.1649796760726; Tue, 12 Apr 2022 13:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649796760; cv=none; d=google.com; s=arc-20160816; b=OsuDpP9htvRgjfCag2UHRrBpO0UTkHMikSCMsJ/modA/OG7j4+lxvH2TyXyt6yxgJY zkihot2YHOSyllGRU1AEMnMWZksBltqbI9FYbmpzMURsIhIZqxyRsEdGan3NdfxWhnvr keKnLeweqbPmrEKCSNhtxSl09mpdAGKMHNo4leOsdzwiCDrkneRkfrI+pgzkrzAZ+9cv Y10vExPOraVVTxBWZ7SEEVMkM+o41ogXD337eO7DJGChp3RIgo0Uw8ePpSlztN7JgV5z QR/T56jbGgjZg+F9msCmmBq8Id/9h5qKXPJzC24LDQKv8wkN0VHU5uzXlHsEiznlr0iI V/tg== 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=dAUUHwptIFdrrfi6cWIpxk8Sd8oMGmhzP5h1ggglDjs=; b=ba+AOX17HtL3xxobqR9dbQzMRaFOUVz8b0WBuohNPHkVjK0KWsrnQ3kW2qriUX/nxD gVyJcw6MtUyS0jb5ycGNm3xthCDEhQm5+NR0DCJuz4R4rEDuMt7XBfAJLWPThHeiuaxq VdWljJBZjQtdbMGcgCQPEb/g8xvYy9o+AT4TTBWx8kAsT9c5XlVSC72WrNoAMs6alL6n fJcmf4ya6E2LMnhHTBTyGoxaTFmjXTfMMOzXwJjk71yqjnXZ0WPA6zjXegfrEzsc8yyF HiABnNz4LpGNa4ouvyYRcD3luxumJkXRcVl00x2jA3WsOfL0HBDbvJKwjb89s86LNyzd fh9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=aM3WBRHa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 70-20020a621749000000b00505fc04af47si2887719pfx.157.2022.04.12.13.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:52:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=aM3WBRHa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D8DD4A91C; Tue, 12 Apr 2022 13:19:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347019AbiDKOQl (ORCPT + 99 others); Mon, 11 Apr 2022 10:16:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347008AbiDKOQe (ORCPT ); Mon, 11 Apr 2022 10:16:34 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E5F2BF68 for ; Mon, 11 Apr 2022 07:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=dAUUHwptIFdrrfi6cWIpxk8Sd8oMGmhzP5h1ggglDjs=; b=aM3WBRHazlkCh4F74OK5TsFET4 xJM7CW1jqTb8D57hDiB5j5Quq267T3Jwlehy2FrobIMKRdV7WnmXE1LN0Njtk7aFnWILeRqOKe10h 3B7ty6TESpt88/t7VdRvzsdW1W0m615OuUz6l2rDEhzay8uf60jEZ7bPD5O5VlJXVVSVvlvj2QEon D2z89usVuDaR4ndoQVKHp066+VimdQGlosLIcXozidTGcVMU6q2rUdYPi43hOSXRMuWRd+HbiTf48 FRUHBId6b40F0sc3BkhSnrNScf3DciYwRwdYdxgqLAj2FHSC2L3WPA/GOUDp9n6EVVdizDAsaGlhO 7EUPnW8w==; Received: from [2001:4bb8:18e:76f5:3747:ef85:d03d:53e4] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndunz-009KHo-HZ; Mon, 11 Apr 2022 14:14:11 +0000 From: Christoph Hellwig To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Zhenyu Wang , Zhi Wang Cc: Jason Gunthorpe , intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/34] drm/i915/gvt: remove module refcounting in intel_gvt_{,un}register_hypervisor Date: Mon, 11 Apr 2022 16:13:30 +0200 Message-Id: <20220411141403.86980-2-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220411141403.86980-1-hch@lst.de> References: <20220411141403.86980-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org THIS_MODULE always is reference when a symbol called by it is used, so don't bother with the additional reference. Signed-off-by: Christoph Hellwig --- drivers/gpu/drm/i915/gvt/gvt.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c index f0b69e4dcb525..623424766c359 100644 --- a/drivers/gpu/drm/i915/gvt/gvt.c +++ b/drivers/gpu/drm/i915/gvt/gvt.c @@ -308,10 +308,6 @@ intel_gvt_register_hypervisor(const struct intel_gvt_mpt *m) m->type != INTEL_GVT_HYPERVISOR_XEN) return -EINVAL; - /* Get a reference for device model module */ - if (!try_module_get(THIS_MODULE)) - return -ENODEV; - intel_gvt_host.mpt = m; intel_gvt_host.hypervisor_type = m->type; gvt = (void *)kdev_to_i915(intel_gvt_host.dev)->gvt; @@ -321,7 +317,6 @@ intel_gvt_register_hypervisor(const struct intel_gvt_mpt *m) if (ret < 0) { gvt_err("Failed to init %s hypervisor module\n", supported_hypervisors[intel_gvt_host.hypervisor_type]); - module_put(THIS_MODULE); return -ENODEV; } gvt_dbg_core("Running with hypervisor %s in host mode\n", @@ -335,6 +330,5 @@ intel_gvt_unregister_hypervisor(void) { void *gvt = (void *)kdev_to_i915(intel_gvt_host.dev)->gvt; intel_gvt_hypervisor_host_exit(intel_gvt_host.dev, gvt); - module_put(THIS_MODULE); } EXPORT_SYMBOL_GPL(intel_gvt_unregister_hypervisor); -- 2.30.2