Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4901297rwb; Tue, 8 Aug 2023 16:15:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYr54toGXtNg6WmwrJozGFh0B+r359hJ7rDHB+JgkgZiqSWfI9nnDVL76SxahCEGC0UZF2 X-Received: by 2002:a05:6a21:338c:b0:138:836c:5370 with SMTP id yy12-20020a056a21338c00b00138836c5370mr948907pzb.42.1691536556042; Tue, 08 Aug 2023 16:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691536556; cv=none; d=google.com; s=arc-20160816; b=zjJ6FcRbO/ttkrf9wTPjooDo5vmL3Y7DN86MkuZKzLuSo2swppW9ry2mG6RMoWnrel n2VeupYA3Wqa+DoVBwVQKiy9gOOJQV2xRjLxs12mR1mL8ze/O68UATz9Wi7Td5W4FJpS ZrtOqVIo5JXhiIIn/9vT6XyUUC8US9D1AefCuiqexognDqgAivqr6PM+PFTvFDTMVHQu pw4co48fNZEY/ic4C/ACYW51zdoNFHLfuRiHthkiVyZTdeUn3s4SlCpTB1aUgFRPIR9i Nrbl2/Xq6HOxfO4D5W+K9/SEPdYNLsjLz3RWAxd9topdLt1C/1CE4A7I1Om73jtWCleY iKDQ== 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=mu/MhoXFJ/cEi4FsJokzAE/sQ7XHHhWDIZhXGhQKIk8=; fh=h/qQBkFaKiogfCTyanXYN9NAO5ByXUFFi2AYXRuKhCY=; b=tsN2RSIR52zE7B5txtWZ0rNJtpOI9hwo445zvlEz2+9SPZPfxyu3r/BMkW8AGH0lei FyJ+ONyZDr+F2rNgPXpon63WPUU64Joc2FkMzFW/PKqAERZqY43fhYEr/41wFSx+TKkk 9OuXpNBKHDdzW67x+tuPWHJQtwoqHIE9vCN2zqruryVrBdNXqmAVOGpS+/IRFAvsNw5n zBaZFqRca5Uz+yBmfqTQge7ONBAidsAx7liBr2yBXW+J7clxrTprJignbdU4KT82PG2F sAJqBVwMhmbf0qdgp6F+3+cugrVXDkEXNzJrD7qT432O0Lu+vC10WmeFcuP7xt14g/Dk SSuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Adl1tcB7; 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 b3-20020a056a000cc300b006871983a97dsi8047341pfv.33.2023.08.08.16.15.43; Tue, 08 Aug 2023 16:15:56 -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=Adl1tcB7; 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 S229480AbjHHWei (ORCPT + 99 others); Tue, 8 Aug 2023 18:34:38 -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: 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,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 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; } -/* 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.34.1