Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5642586rwb; Wed, 9 Aug 2023 07:15:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEb+48sWf1BEkTq7gtO1grqEbRYHdyG/ifn5Ec6M7n3Pqy0LWYbrcclZn35OKQDecJKKMfA X-Received: by 2002:a17:902:f80e:b0:1bb:1523:b2d7 with SMTP id ix14-20020a170902f80e00b001bb1523b2d7mr2314444plb.14.1691590524536; Wed, 09 Aug 2023 07:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691590524; cv=none; d=google.com; s=arc-20160816; b=Qbe2GaBeywjc/wbvlEUj360IoFLtJ7RFyaOFGeVBvQeyvv3K4czQOyLulRjaqvTw/1 L7O67xzEjUfPPoe5tKsxFqZ/nkJQCFIgRmPnNywsqWyRuC/iniunNe/fghihzsvFGhrc L8MvQ4RXoIskeBL3ckVMu+YvA8ziOKRViDReZ94MhgNG+aLUVk/HJ4RMRmtw2rIVftzZ To2nFVQyzEnBWw9D0dPzxgFQjpQ3hnQykHLp7Jjx89p8mXFyZQX9WjC9llrYw6N8wJb8 BosxLJpKaR7cEM+sX82xiI/04/frhn2qRUjYBAUJfBrIJvldLrV1KDo+oc1I+pNfZ1GI feaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=DEmxQRC7UdtovqemCYI7SyIwwlWtQw7zTds4gjLVT8c=; fh=eudCOzzjES27yp8RaKCIvlzUzgpnjGp713UhqUsvDBU=; b=z1vVLz3BfxW9Dl/Z3fwnudAE+1+OMqNO6YEgOHEngOLIXE4Y9ywIoCdoKb4JhU+qHF m1/itHV6lEpkpD6Kx/lRQYRsF2khllA/DVJYqC8oiqetn0VhdfD4nFX8QtWuZo9OBOfC aZes32j0Gdt56nPMSzAmMS6MkZ5sn51H9g6SXftp2WR2E+ip9UIS7tf5+qLfMSA0ZID5 zYgg6zqdD11h2K5wbUHmmJKuenV5B3Y9puch2ATzojKnUvLYJ+ZoLjCxX54q+Y4stckz Qjo+nC87I4op7YKm4Zy2mf4sK3EkcJN7wicRncxQ4JPIAeVUsBE/dJE1BQdRduR5ATq9 Iv3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=evgr7JJe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u14-20020a170902e5ce00b001bbbbb61c67si9813493plf.542.2023.08.09.07.14.53; Wed, 09 Aug 2023 07:15:24 -0700 (PDT) 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=pass header.i=@intel.com header.s=Intel header.b=evgr7JJe; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231470AbjHINwX (ORCPT + 99 others); Wed, 9 Aug 2023 09:52:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230088AbjHINwW (ORCPT ); Wed, 9 Aug 2023 09:52:22 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55CFE1982; Wed, 9 Aug 2023 06:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691589141; x=1723125141; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=uaOJFHcQEX0cJiQto5OxAtbnVtlxJM0Xoo7ZPgoGdk8=; b=evgr7JJe1Zu+bDcS74YOQP1T/PWk7VscJT08Ez46CzZ3uaUL98uW9ibI 67DcEfHxR3Ne/nho94SbsI+oXL/1QLIOCRc/hR97w9xImj2WyWRnBOOWf NnuKqh9OkzOdeHf5guLFTcMK57fSGmv/lSpBPrGZ8XWClu3+l2Q17JmiI QhgeCkVKJNRsfeEF/7311HuOmZwXv321MJpKnr67v+IPaPgTRv9d0HxZ+ Lr6PuRao4lmvAwhJr57bu9BFY8mbfm7u0c8vmNe+HVIoiY2X/l6mFior/ PrLOpYZqNP68+710Gx8a/HUkzIs4rx16ZncxUc1f01hXzFb0utTSClihH w==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="437489679" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="437489679" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 06:52:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="855545569" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="855545569" Received: from cvogler-mobl1.ger.corp.intel.com ([10.252.40.229]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2023 06:52:11 -0700 Date: Wed, 9 Aug 2023 16:52:09 +0300 (EEST) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Sui Jingfeng cc: Bjorn Helgaas , Dave Airlie , Daniel Vetter , linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: Re: [PATCH v2 07/11] PCI/VGA: vga_client_register() return -ENODEV on failure, not -1 In-Reply-To: <20230808223412.1743176-8-sui.jingfeng@linux.dev> Message-ID: References: <20230808223412.1743176-1-sui.jingfeng@linux.dev> <20230808223412.1743176-8-sui.jingfeng@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Aug 2023, Sui Jingfeng wrote: > From: Sui Jingfeng > Changelog body is missing. > Fixes: 934f992c763a ("drm/i915: Recognise non-VGA display devices") > Signed-off-by: Sui Jingfeng > --- > drivers/pci/vgaarb.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c > index 811510253553..a6b8c0def35d 100644 > --- a/drivers/pci/vgaarb.c > +++ b/drivers/pci/vgaarb.c > @@ -964,7 +964,7 @@ EXPORT_SYMBOL(vga_set_legacy_decoding); > * > * To unregister just call vga_client_unregister(). > * > - * Returns: 0 on success, -1 on failure > + * Returns: 0 on success, -ENODEV on failure So this is the true substance of this change?? It doesn't warrant Fixes tag which requires a real problem to fix. An incorrect comment is not enough. I think the shortlog is a bit misleading as is because it doesn't in any way indicate the problem is only in a comment. > */ > int vga_client_register(struct pci_dev *pdev, > unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)) > @@ -975,16 +975,13 @@ int vga_client_register(struct pci_dev *pdev, > > spin_lock_irqsave(&vga_lock, flags); > vgadev = vgadev_find(pdev); > - if (!vgadev) > - goto bail; > - > - vgadev->set_decode = set_decode; > - ret = 0; > - > -bail: > + if (vgadev) { > + vgadev->set_decode = set_decode; > + ret = 0; > + } > spin_unlock_irqrestore(&vga_lock, flags); > - return ret; > > + return ret; No logic changes in this at all? I don't think it belongs to the same patch. I'm not sure if the new logic is improvement anyway. I'd prefer to initialize ret = 0 instead: int ret = 0; ... if (!vgadev) { err = -ENODEV; goto unlock; } ... unlock: ... -- i.