Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36919138rwd; Tue, 11 Jul 2023 07:18:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/KqGGFi5q0bI4snR+P9TDLnnQ8Jjj4xsZuVe5Wrl92N+axRVY2xvT8Vbe6tlP0XBPaCtb X-Received: by 2002:a2e:3c07:0:b0:2b6:b98e:fe8f with SMTP id j7-20020a2e3c07000000b002b6b98efe8fmr12632280lja.32.1689085116984; Tue, 11 Jul 2023 07:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689085116; cv=none; d=google.com; s=arc-20160816; b=jh7pjTa7sexZ/Oui6xz9gIPSkTMI4OnfokdvGIJWbUesKBJ5L3jDE68kGkQ3aTjL2o 2s558DOlRCbI9dTIPs1fwe2fKDYw9oJNrSKWZ+hL3I8KVQ039fJegTTsqVvv4RTjaIdY snys1VNxoQ1u4g1R88QrAK+oDbELqJ/w+QaQz2uxbzIgKTXS3wrE2RFKJhWntMEFYe0o zB8kCcTwCLH3bi4raSwKoXHSQg0BYC0W3W3NP4LdwRasyFrwIggXFjobdtI4E9tQhlv8 wa+fsAo80YDonrZTvwXoKYiiH4ciNnvqyXZS4GMiljWpuZHGd5g8cX7ShFPuKQ+XiGeW WANg== 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=nSELRnxi3WNW936UlC8GM9d7GKkUecfY1U1Y7wjl+uY=; fh=m90o3XbD+v5PtjaouMLofHD7GJu3dEeCXnfOfzea/Og=; b=X0Xf9wh5vuLGU4hetp1f7CxHczWeVBDTYnKpx/Z8/SPTHscMuwc/VnQU2AR9azpmz7 SkmHnp1OFl7W7Ygloz3fzQ9pW7p6BZK5hww5PQQGgnZfcwrIwjdYiTl3VF85MQVWjJ0v hREJguLW7Ntr7S08SDm0nhiC3SrVHWGOYoA8cWhDynfIHHuhiE2jnB2GSAHS3QNoqJuS EFnl2NuAmqu3/kV1RHAGZeiOq9vp2aqBycHofhVI6pixZHrOPcY63bn60HH46z2rEvPn BFodCpZAcM2ZU95gRGRU9MRireUMMIeBV6WR0pENtmJE1kduB15HqgREFPqK7klXgMEO JegA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linux.dev header.s=key1 header.b=xJyYazfc; 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=fail (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 fi26-20020a170906da1a00b0098653c15e94si2799145ejb.117.2023.07.11.07.18.11; Tue, 11 Jul 2023 07:18:36 -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=fail header.i=@linux.dev header.s=key1 header.b=xJyYazfc; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232690AbjGKNoZ (ORCPT + 99 others); Tue, 11 Jul 2023 09:44:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232326AbjGKNoX (ORCPT ); Tue, 11 Jul 2023 09:44:23 -0400 Received: from out-26.mta0.migadu.com (out-26.mta0.migadu.com [IPv6:2001:41d0:1004:224b::1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B05FAE6A for ; Tue, 11 Jul 2023 06:44:21 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689083060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nSELRnxi3WNW936UlC8GM9d7GKkUecfY1U1Y7wjl+uY=; b=xJyYazfcQNg5BkenFjHDBatlKKm0dhriClEVMtpSJ0VFseaNKgOJNiTxOUYiKr2cnh7/um z5uVCpJIXf9DPBH/tnLaP7PP4CYkNlRcgiB8Sgp3cf9dk1Aovox2BT0Ky6waQnsC7ENo6V Tlv9Vq/fuRA085J2lVe38D/l0AOB6/M= From: Sui Jingfeng To: Bjorn Helgaas , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sui@vger.kernel.org, Jingfeng@loongson.cn Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, loongson-kernel@lists.loongnix.cn, Sui Jingfeng Subject: [PATCH 3/6] PCI/VGA: drop the inline of vga_update_device_decodes() function Date: Tue, 11 Jul 2023 21:43:51 +0800 Message-Id: <20230711134354.755966-4-sui.jingfeng@linux.dev> In-Reply-To: <20230711134354.755966-1-sui.jingfeng@linux.dev> References: <20230711134354.755966-1-sui.jingfeng@linux.dev> MIME-Version: 1.0 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,T_SCC_BODY_TEXT_LINE,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 From: Sui Jingfeng The vga_update_device_decodes() function is NOT a trivial function, It is not performance critical either. So, drop the inline. This patch also make the parameter and argument consistent, use unsigned int type instead of the signed type to store the decode. Change the second argument of vga_update_device_decodes() function as 'unsigned int' type. Signed-off-by: Sui Jingfeng --- drivers/pci/vgaarb.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index 021116ed61cb..668139f7c247 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -860,24 +860,24 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev) return ret; } -/* this is called with the lock */ -static inline void vga_update_device_decodes(struct vga_device *vgadev, - int new_decodes) +/* This is called with the lock */ +static void vga_update_device_decodes(struct vga_device *vgadev, + unsigned int new_decodes) { struct device *dev = &vgadev->pdev->dev; - int old_decodes, decodes_removed, decodes_unlocked; + unsigned int old_decodes = vgadev->decodes; + unsigned int decodes_removed = ~new_decodes & old_decodes; + unsigned int decodes_unlocked = vgadev->locks & decodes_removed; - old_decodes = vgadev->decodes; - decodes_removed = ~new_decodes & old_decodes; - decodes_unlocked = vgadev->locks & decodes_removed; vgadev->decodes = new_decodes; - vgaarb_info(dev, "changed VGA decodes: olddecodes=%s,decodes=%s:owns=%s\n", - vga_iostate_to_str(old_decodes), - vga_iostate_to_str(vgadev->decodes), - vga_iostate_to_str(vgadev->owns)); + vgaarb_info(dev, + "VGA decodes changed: olddecodes=%s,decodes=%s:owns=%s\n", + vga_iostate_to_str(old_decodes), + vga_iostate_to_str(vgadev->decodes), + vga_iostate_to_str(vgadev->owns)); - /* if we removed locked decodes, lock count goes to zero, and release */ + /* If we removed locked decodes, lock count goes to zero, and release */ if (decodes_unlocked) { if (decodes_unlocked & VGA_RSRC_LEGACY_IO) vgadev->io_lock_cnt = 0; -- 2.25.1