[PATCH] vgaarb: Downgrade userspace-triggerable messages to debug

Bjorn Helgaas bhelgaas at google.com
Fri Nov 18 14:11:58 UTC 2016


To avoid userspace-triggerable dmesg spam, downgrade messages in the sysfs
write parsing code to debug level.

Signed-off-by: Bjorn Helgaas <bhelgaas at google.com>
---
 drivers/gpu/vga/vgaarb.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 3a8e9c6..f1312a9 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1196,9 +1196,9 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
 			}
 			pdev = pci_get_domain_bus_and_slot(domain, bus, devfn);
 			if (!pdev) {
-				pr_err("invalid PCI address %04x:%02x:%02x.%x\n",
-					domain, bus, PCI_SLOT(devfn),
-					PCI_FUNC(devfn));
+				pr_debug("invalid PCI address %04x:%02x:%02x.%x\n",
+					 domain, bus, PCI_SLOT(devfn),
+					 PCI_FUNC(devfn));
 				ret_val = -ENODEV;
 				goto done;
 			}
@@ -1212,7 +1212,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
 		pr_debug("vgadev %p\n", vgadev);
 		if (vgadev == NULL) {
 			if (pdev) {
-				vgaarb_err(&pdev->dev, "not a VGA device\n");
+				vgaarb_dbg(&pdev->dev, "not a VGA device\n");
 				pci_dev_put(pdev);
 			}
 
@@ -1232,7 +1232,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf,
 			}
 		}
 		if (i == MAX_USER_CARDS) {
-			vgaarb_err(&pdev->dev, "maximum user cards (%d) number reached, ignoring this one!\n",
+			vgaarb_dbg(&pdev->dev, "maximum user cards (%d) number reached, ignoring this one!\n",
 				MAX_USER_CARDS);
 			pci_dev_put(pdev);
 			/* XXX: which value to return? */



More information about the dri-devel mailing list