Skip to content

Commit 60b4925

Browse files
Sui Jingfengbjorn-helgaas
authored andcommitted
PCI/VGA: Correct vga_update_device_decodes() parameter type
Previously vga_update_device_decodes() took "int new_decodes", but the callers pass "unsigned int new_decodes". Correct the vga_update_device_decodes() parameter type to "unsigned int" to match. In vga_arbiter_notify_clients(), the return from vgadev->set_decode() is "unsigned int" but was stored as "uint32_t new_decodes". Correct the new_decodes type to "unsigned int". [bhelgaas: use correct type for ->set_decode() return, commit log] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sui Jingfeng <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 04c1c3c commit 60b4925

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

drivers/pci/vgaarb.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -864,24 +864,23 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
864864
return ret;
865865
}
866866

867-
/* this is called with the lock */
868-
static inline void vga_update_device_decodes(struct vga_device *vgadev,
869-
int new_decodes)
867+
/* This is called with the lock */
868+
static void vga_update_device_decodes(struct vga_device *vgadev,
869+
unsigned int new_decodes)
870870
{
871871
struct device *dev = &vgadev->pdev->dev;
872-
int old_decodes, decodes_removed, decodes_unlocked;
872+
unsigned int old_decodes = vgadev->decodes;
873+
unsigned int decodes_removed = ~new_decodes & old_decodes;
874+
unsigned int decodes_unlocked = vgadev->locks & decodes_removed;
873875

874-
old_decodes = vgadev->decodes;
875-
decodes_removed = ~new_decodes & old_decodes;
876-
decodes_unlocked = vgadev->locks & decodes_removed;
877876
vgadev->decodes = new_decodes;
878877

879-
vgaarb_info(dev, "changed VGA decodes: olddecodes=%s,decodes=%s:owns=%s\n",
880-
vga_iostate_to_str(old_decodes),
881-
vga_iostate_to_str(vgadev->decodes),
882-
vga_iostate_to_str(vgadev->owns));
878+
vgaarb_info(dev, "VGA decodes changed: olddecodes=%s,decodes=%s:owns=%s\n",
879+
vga_iostate_to_str(old_decodes),
880+
vga_iostate_to_str(vgadev->decodes),
881+
vga_iostate_to_str(vgadev->owns));
883882

884-
/* if we removed locked decodes, lock count goes to zero, and release */
883+
/* If we removed locked decodes, lock count goes to zero, and release */
885884
if (decodes_unlocked) {
886885
if (decodes_unlocked & VGA_RSRC_LEGACY_IO)
887886
vgadev->io_lock_cnt = 0;
@@ -1472,7 +1471,7 @@ static void vga_arbiter_notify_clients(void)
14721471
{
14731472
struct vga_device *vgadev;
14741473
unsigned long flags;
1475-
uint32_t new_decodes;
1474+
unsigned int new_decodes;
14761475
bool new_state;
14771476

14781477
if (!vga_arbiter_used)

0 commit comments

Comments
 (0)