From: Simon Richter <Simon.Richter@hogyros.de>
To: linux-pci@vger.kernel.org
Cc: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Simon Richter <Simon.Richter@hogyros.de>
Subject: [PATCH v3 3/5] vgaarb: mark vga_get() and wrappers as __must_check
Date: Sun, 8 Mar 2026 02:35:36 +0900 [thread overview]
Message-ID: <20260307173538.763188-4-Simon.Richter@hogyros.de> (raw)
In-Reply-To: <20260307173538.763188-1-Simon.Richter@hogyros.de>
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 <Simon.Richter@hogyros.de>
---
include/linux/vgaarb.h | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
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);
}
--
2.47.3
next prev parent reply other threads:[~2026-03-07 17:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 17:35 [PATCH v3 0/5] Bridges without VGA support Simon Richter
2026-03-07 17:35 ` [PATCH v3 1/5] vgaarb: pass vga_get_uninterruptible() errors to userspace Simon Richter
2026-03-08 22:05 ` Claude review: " Claude Code Review Bot
2026-03-07 17:35 ` [PATCH v3 2/5] vgaarb: pass errors from pci_set_vga_state() up Simon Richter
2026-03-08 22:05 ` Claude review: " Claude Code Review Bot
2026-03-07 17:35 ` Simon Richter [this message]
2026-03-08 22:05 ` Claude review: vgaarb: mark vga_get() and wrappers as __must_check Claude Code Review Bot
2026-03-07 17:35 ` [PATCH v3 4/5] pci: check if VGA decoding was really activated Simon Richter
2026-03-08 22:05 ` Claude review: " Claude Code Review Bot
2026-03-07 17:35 ` [PATCH v3 5/5] pci: mark pci_set_vga_state() as __must_check Simon Richter
2026-03-08 22:05 ` Claude review: " Claude Code Review Bot
2026-03-08 22:05 ` Claude review: Bridges without VGA support Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260307173538.763188-4-Simon.Richter@hogyros.de \
--to=simon.richter@hogyros.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox