Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1061546rwl; Thu, 10 Aug 2023 06:03:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEe3t4/SF6SJ2wGFnelXMXUS4KOiuQMgr6JkvkEWAgMexgEAvIBtKNb2qrHRgpfh0jhxdTP X-Received: by 2002:a05:6808:114e:b0:3a3:6cb2:d5bf with SMTP id u14-20020a056808114e00b003a36cb2d5bfmr3508963oiu.4.1691672590747; Thu, 10 Aug 2023 06:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691672590; cv=none; d=google.com; s=arc-20160816; b=CIMqAHoxw9o0bms96GFp94hrv4ixJnZH3iEFivJO9Z2/k+7GaVPEUPgXWTlFbW6ozS LuRXeoH4PMHYjbAXQNPlheoVZk/u2PvsKmmtaWwXVThr4kNP+y2j9uclebOC6tBdWsje yvYznTLwe7LNc3sKId6uPlLTo5YlY2S7xDNoZQ9lTZVzFVXAjNE28jNbcx7d8g9OTPcG WCRYmNOmdPrCIE3bylP9EOSnI7cNOya4h8I5hf7+0s1kshyP4K1ucMAqneITPP2MvFLP 9kYXnNAFZylRJm32B/EGRa2s06rC9pPueZUbnHF7/f58buGI4QK0gpH3EKOcf2sm1NKt 4p+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=gqIFbhKBuUW51FybyZoKrutyLB27EyK86A0iiFShgwM=; fh=FxH5kLC75zwZo7Y7wWJ5kG4gmWfla3XCj7J3l2q+Cmc=; b=Umz7Y9QqyoPfoqYlmoPuDYR1Q12Y4SHDUtQ00DM60klPjfRUkkFFcFysZxaEf1dRAP Ol3ViQaJmg9R3w3dYBmkeR8dX1hKwhJBtzioiBPsT+Y0kX9dXwlRm0ztTW7uBoHR+yAt 3EuPUhmTEhxks9iS+XGExWE633TSskZRL6bz6UshrynSYyWuTUQq+5qvaEG81Vequ6yw 1vAG2iMVNtjAcJHfN4T7iKhN9poGZAjIT0CYzaOmEGFk6hFa1ZVYuUkjaZ+6ICzft0kU y/blc8SL55qOxAuzMdb8dUb/KjpEXNEyImDGlfVzPgS1oGZsCPnFnDwrpq4nRy32VG/e XuMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gn0k3dfR; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v135-20020a63618d000000b0056535e2b751si1555693pgb.782.2023.08.10.06.02.44; Thu, 10 Aug 2023 06:03:10 -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=@linux.dev header.s=key1 header.b=gn0k3dfR; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbjHJMSo (ORCPT + 99 others); Thu, 10 Aug 2023 08:18:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230407AbjHJMSn (ORCPT ); Thu, 10 Aug 2023 08:18:43 -0400 Received: from out-104.mta1.migadu.com (out-104.mta1.migadu.com [IPv6:2001:41d0:203:375::68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8F9C212B for ; Thu, 10 Aug 2023 05:18:42 -0700 (PDT) Message-ID: <38a37d61-529b-12c6-da32-25b780318175@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1691669920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gqIFbhKBuUW51FybyZoKrutyLB27EyK86A0iiFShgwM=; b=gn0k3dfRF5lr291o4BhbOFJQDK2XZYH3WIh2gwb/mYoGmO4N/2a2frr6tS+FyuiWLh+VlV VQA2D1MdWplq8qygIlv/Tf7hcdaSr3OJat+UzqK2gxZCSZcZ3bxgg8spLtSiHjRN6ieWJC rdw1uyuARFFFjesHbd9JYCfuxuS1r2g= Date: Thu, 10 Aug 2023 20:18:31 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v2 07/11] PCI/VGA: vga_client_register() return -ENODEV on failure, not -1 Content-Language: en-US To: =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= , suijingfeng Cc: Bjorn Helgaas , Dave Airlie , Daniel Vetter , linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, LKML References: <20230808223412.1743176-1-sui.jingfeng@linux.dev> <20230808223412.1743176-8-sui.jingfeng@linux.dev> <1f288175-a290-6f19-d562-cf98f613323c@linux.intel.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: <1f288175-a290-6f19-d562-cf98f613323c@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2023/8/10 20:13, Ilpo Järvinen wrote: > On Thu, 10 Aug 2023, suijingfeng wrote: >> On 2023/8/9 21:52, Ilpo Järvinen wrote: >>> On Wed, 9 Aug 2023, Sui Jingfeng wrote: >>> >>>> From: Sui Jingfeng >>>> >>> Changelog body is missing. >> >> I thought that probably the Fixes tag could be taken as the body of this >> commit, >> since there are no warnings when I check the whole series with checkpatch.pl. >> >> >>>> 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?? >>> >> Yes. >> >> >>> 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. >> But it's that commit(934f992c763a) alter the return value of >> vga_client_register(), >> which make the commit and code don't match anymore. > This is useful information, no point in withholding it which forces > others to figure it out by looking that commit up so put that detail into > the changelog body. > >>> I'd prefer to >>> initialize ret = 0 instead: >>> >>> int ret = 0; >>> ... >>> if (!vgadev) { >>> err = -ENODEV; >>> goto unlock; >>> } >>> ... >>> unlock: >>> ... >>> >> But this is same as the original coding style, no fundamental improve. >> The key point is to make the wrapped code between the spin_lock_irqsave() and >> spin_unlock_irqrestore() compact. >> my patch remove the necessary 'goto' statement and the 'bail' label. >> After apply my patch, the vga_client_register() function became as this: >> >> int vga_client_register(struct pci_dev *pdev, >>         unsigned int (*set_decode)(struct pci_dev *pdev, bool decode)) >> { >>     int ret = -ENODEV; >>     struct vga_device *vgadev; >>     unsigned long flags; >> >>     spin_lock_irqsave(&vga_lock, flags); >>     vgadev = vgadev_find(pdev); >>     if (vgadev) { >>         vgadev->set_decode = set_decode; >>         ret = 0; >>     } >>     spin_unlock_irqrestore(&vga_lock, flags); >> >>     return ret; >> } > I'm not too attached to either of the ways around since there's no > correctness issues here. Feel free to ignore my alternative suggestion > (make the separate patch out of it in anycase). OK, will be done at the next version.