From nobody Sun Feb 8 06:54:34 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FE59C001B0 for ; Tue, 8 Aug 2023 22:34:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231150AbjHHWek (ORCPT ); Tue, 8 Aug 2023 18:34:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230461AbjHHWeg (ORCPT ); Tue, 8 Aug 2023 18:34:36 -0400 Received: from out-123.mta1.migadu.com (out-123.mta1.migadu.com [IPv6:2001:41d0:203:375::7b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8EE2136 for ; Tue, 8 Aug 2023 15:34:34 -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=1691534071; 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=mu/MhoXFJ/cEi4FsJokzAE/sQ7XHHhWDIZhXGhQKIk8=; b=Adl1tcB78U1uq/fZLe6GYcn43LbRpfgPBKK17xeIW5yXvQaRZ0n/Abirru9G+fZ9WkrwIg C9ZiabiIncjvC0hXZT2kaf7Z7KaAf0tycBNkaCe8u87wtDhLXUmSxsGGtI9dyQZg1sKAHZ tIGGl4udI9xcc1Tdsvdo23/Yipt8Ehs= From: Sui Jingfeng To: Bjorn Helgaas Cc: Dave Airlie , Daniel Vetter , linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: [PATCH v2 04/11] PCI/VGA: Drop the inline in the vga_update_device_decodes() function. Date: Wed, 9 Aug 2023 06:34:05 +0800 Message-Id: <20230808223412.1743176-5-sui.jingfeng@linux.dev> In-Reply-To: <20230808223412.1743176-1-sui.jingfeng@linux.dev> References: <20230808223412.1743176-1-sui.jingfeng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Sui Jingfeng The vga_update_device_decodes() function is not performance-critical. So drop the inline. This patch also makes the parameter consistent with the argument, using the 'unsigned int' type instead of the 'signed' type to store the decode. Change the second argument of the vga_update_device_decodes() function to '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 8742a51d450f..dc10a262fb5e 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; } =20 -/* 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 =3D &vgadev->pdev->dev; - int old_decodes, decodes_removed, decodes_unlocked; + unsigned int old_decodes =3D vgadev->decodes; + unsigned int decodes_removed =3D ~new_decodes & old_decodes; + unsigned int decodes_unlocked =3D vgadev->locks & decodes_removed; =20 - old_decodes =3D vgadev->decodes; - decodes_removed =3D ~new_decodes & old_decodes; - decodes_unlocked =3D vgadev->locks & decodes_removed; vgadev->decodes =3D new_decodes; =20 - vgaarb_info(dev, "changed VGA decodes: olddecodes=3D%s,decodes=3D%s:owns= =3D%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=3D%s,decodes=3D%s:owns=3D%s\n", + vga_iostate_to_str(old_decodes), + vga_iostate_to_str(vgadev->decodes), + vga_iostate_to_str(vgadev->owns)); =20 - /* 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 =3D 0; --=20 2.34.1