lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250902164351.36828-1-bhanuseshukumar@gmail.com>
Date: Tue,  2 Sep 2025 22:13:51 +0530
From: bhanuseshukumar <bhanuseshukumar@...il.com>
To: rydberg@...math.org,
	dmitry.torokhov@...il.com
Cc: linux-input@...r.kernel.org,
	skhan@...uxfoundation.org,
	bhanuseshukumar@...il.com,
	linux-kernel@...r.kernel.org,
	linux-kernel-mentees@...ts.linuxfoundation.org
Subject: [PATCH] Input: bcm5974 - Driver cleanup by replacing dprintk with dev_dbg

	Debug printk messages are converted to dev_dbg based logs
	for better control over debug messages using dynamic logging.

Signed-off-by: bhanuseshukumar <bhanuseshukumar@...il.com>
---
 drivers/input/mouse/bcm5974.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index dfdfb59cc8b5..2791fe0c1932 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -156,13 +156,6 @@ MODULE_AUTHOR("Henrik Rydberg");
 MODULE_DESCRIPTION("Apple USB BCM5974 multitouch driver");
 MODULE_LICENSE("GPL");
 
-#define dprintk(level, format, a...)\
-	{ if (debug >= level) printk(KERN_DEBUG format, ##a); }
-
-static int debug = 1;
-module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, "Activate debugging output");
-
 /* button data structure */
 struct bt_data {
 	u8 unknown1;		/* constant */
@@ -547,11 +540,12 @@ static void setup_events_to_report(struct input_dev *input_dev,
 /* report button data as logical button state */
 static int report_bt_state(struct bcm5974 *dev, int size)
 {
+	struct usb_interface *intf = dev->intf;
+
 	if (size != sizeof(struct bt_data))
 		return -EIO;
 
-	dprintk(7,
-		"bcm5974: button data: %x %x %x %x\n",
+	dev_dbg(&intf->dev, "bcm5974: button data: %x %x %x %x\n",
 		dev->bt_data->unknown1, dev->bt_data->button,
 		dev->bt_data->rel_x, dev->bt_data->rel_y);
 
@@ -688,7 +682,7 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
 		goto out;
 	}
 
-	dprintk(2, "bcm5974: switched to %s mode.\n",
+	dev_dbg(&dev->intf->dev, "bcm5974: switched to %s mode.\n",
 		on ? "wellspring" : "normal");
 
  out:
@@ -718,7 +712,7 @@ static void bcm5974_irq_button(struct urb *urb)
 	}
 
 	if (report_bt_state(dev, dev->bt_urb->actual_length))
-		dprintk(1, "bcm5974: bad button package, length: %d\n",
+		dev_dbg(&intf->dev, "bcm5974: bad button package, length: %d\n",
 			dev->bt_urb->actual_length);
 
 exit:
@@ -753,7 +747,7 @@ static void bcm5974_irq_trackpad(struct urb *urb)
 		goto exit;
 
 	if (report_tp_state(dev, dev->tp_urb->actual_length))
-		dprintk(1, "bcm5974: bad trackpad package, length: %d\n",
+		dev_dbg(&intf->dev, "bcm5974: bad trackpad package, length: %d\n",
 			dev->tp_urb->actual_length);
 
 exit:
@@ -783,10 +777,11 @@ static void bcm5974_irq_trackpad(struct urb *urb)
 static int bcm5974_start_traffic(struct bcm5974 *dev)
 {
 	int error;
+	struct usb_interface *intf = dev->intf;
 
 	error = bcm5974_wellspring_mode(dev, true);
 	if (error) {
-		dprintk(1, "bcm5974: mode switch failed\n");
+		dev_dbg(&intf->dev, "bcm5974: mode switch failed\n");
 		goto err_out;
 	}
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ