Subject: Re: linux-next: build failure after merge of the pci tree

From: Bjorn Helgaas <[email-masked]>
Date: Mon, 30 Mar 2026 11:18:02 -0500

On Mon, Mar 30, 2026 at 03:51:47PM +0100, Mark Brown wrote:
> On Mon, Mar 30, 2026 at 11:48:58PM +0900, Simon Richter wrote:
> > On 3/30/26 23:06, Mark Brown wrote:
> 
> > > > After merging the pci tree, today's linux-next build (x86_64 allmodconfig)
> > > > failed like this:
> 
> > >> /tmp/next/build/drivers/gpu/drm/i915/display/intel_vga.c:
> > >> In function 'intel_vga_disable':
> > >> /tmp/next/build/drivers/gpu/drm/i915/display/intel_vga.c:68:9: error:
> > ignoring return value of 'vga_get_uninterruptible' declared with attribute
> > 'warn_unused_result' [-Werror=unused-result]
> > >>    68 |         vga_get_uninterruptible(pdev, VGA_RSRC_LEGACY_IO);
> > >>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> > > This is still present today.
> 
> > The fix for that should have gone in through drm-next. The version where the
> > warning occurs in line 68 is ancient however (that was changed[2] in
> > December).
> 
> The DRM tree is merged into -next after the PCI tree so that's not going
> to work, and in any case your tree really should work independently.

I dropped these these patches from the PCI tree for now, sorry for the
trouble:

  21b082bd2a45 ("PCI/VGA: Mark pci_set_vga_state() as __must_check")
  dc582b5ed4b7 ("PCI/VGA: Mark vga_get() and wrappers as __must_check")

For reference, I'm attaching the patches below.  We can deal with them
later.

commit 21b082bd2a45 ("PCI/VGA: Mark pci_set_vga_state() as __must_check")
Author: Simon Richter <[email-masked]>
Date:   Sun Mar 8 02:35:38 2026 +0900

    PCI/VGA: Mark pci_set_vga_state() as __must_check
    
    pci_set_vga_state() can return an error, usually on non-x86 or virtualized
    environments, so mark it as __must_check.
    
    The only caller so far is __vga_tryget() in vgaarb.
    
    Signed-off-by: Simon Richter <[email-masked]>
    Signed-off-by: Bjorn Helgaas <[email-masked]>
    Link: https://patch.msgid.link/[email-masked]

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 1c270f1d5123..aa1451d402d1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1720,8 +1720,8 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus,
 #define PCI_VGA_STATE_CHANGE_BRIDGE (1 << 0)
 #define PCI_VGA_STATE_CHANGE_DECODES (1 << 1)
 
-int pci_set_vga_state(struct pci_dev *pdev, bool decode,
-		      unsigned int command_bits, u32 flags);
+int __must_check pci_set_vga_state(struct pci_dev *pdev, bool decode,
+				   unsigned int command_bits, u32 flags);
 
 /*
  * Virtual interrupts allow for more interrupts to be allocated
commit dc582b5ed4b7 ("PCI/VGA: Mark vga_get() and wrappers as __must_check")
Author: Simon Richter <[email-masked]>
Date:   Sun Mar 8 02:35:36 2026 +0900

    PCI/VGA: Mark vga_get() and wrappers as __must_check
    
    The vga_get() function and the two wrappers vga_get_interruptible() and
    vga_get_uninterruptible() can return errors. As these are paired with
    vga_put(), which must only be called after vga_get() returned success, all
    callers need to check the return code.
    
    Signed-off-by: Simon Richter <[email-masked]>
    Signed-off-by: Bjorn Helgaas <[email-masked]>
    Link: https://patch.msgid.link/[email-masked]

diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 97129a1bbb7d..eed524c67c22 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -27,7 +27,8 @@ struct pci_dev;
 
 #ifdef CONFIG_VGA_ARB
 void vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes);
-int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible);
+int __must_check vga_get(struct pci_dev *pdev, unsigned int rsrc,
+			 int interruptible);
 void vga_put(struct pci_dev *pdev, unsigned int rsrc);
 struct pci_dev *vga_default_device(void);
 void vga_set_default_device(struct pci_dev *pdev);
@@ -39,8 +40,8 @@ static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
 		unsigned int decodes)
 {
 };
-static inline int vga_get(struct pci_dev *pdev, unsigned int rsrc,
-		int interruptible)
+static inline int __must_check vga_get(struct pci_dev *pdev, unsigned int rsrc,
+				       int interruptible)
 {
 	return 0;
 }
@@ -74,8 +75,8 @@ static inline int vga_client_register(struct pci_dev *pdev,
  *
  * On success, release the VGA resource again with vga_put().
  */
-static inline int vga_get_interruptible(struct pci_dev *pdev,
-					unsigned int rsrc)
+static inline int __must_check vga_get_interruptible(struct pci_dev *pdev,
+						     unsigned int rsrc)
 {
 	return vga_get(pdev, rsrc, 1);
 }
@@ -89,8 +90,8 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
  *
  * On success, release the VGA resource again with vga_put().
  */
-static inline int vga_get_uninterruptible(struct pci_dev *pdev,
-					  unsigned int rsrc)
+static inline int __must_check vga_get_uninterruptible(struct pci_dev *pdev,
+						       unsigned int rsrc)
 {
 	return vga_get(pdev, rsrc, 0);
 }