Skip to contentSkip to conversation

drivers: usb: atm: reduce noise

PATCH In review Enrico Weigelt, metux IT consult 2 participants 4 messages Dec 8, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drivers: usb: atm: reduce noise

If drivers work correctly, they should remain silent.

---
 drivers/usb/atm/cxacru.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/usb/atm/cxacru.c +0 -3
index e62a770a5d3b..0114cc54e622 100644
@@ -810,9 +810,6 @@ static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
 	mutex_unlock(&instance->poll_state_serialize);
 	mutex_unlock(&instance->adsl_state_serialize);
 
-	printk(KERN_INFO "%s%d: %s %pM\n", atm_dev->type, atm_dev->number,
-			usbatm_instance->description, atm_dev->esi);
-
 	if (start_polling)
 		cxacru_poll_status(&instance->poll_work.work);
 	return 0;
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/3 drivers: usb: atm: use atm_info() instead of atm_printk(KERN_INFO ...

Since we already have the useful atm_info() macro, use it instead of raw atm_printk()

---
 drivers/usb/atm/cxacru.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/atm/cxacru.c +3 -3
index 0114cc54e622..4d3947476f0e 100644
@@ -849,15 +849,15 @@ static void cxacru_poll_status(struct work_struct *work)
 
 		switch (instance->adsl_status) {
 		case 0:
-			atm_printk(KERN_INFO, usbatm, "ADSL state: running\n");
+			atm_info(usbatm, "ADSL state: running\n");
 			break;
 
 		case 1:
-			atm_printk(KERN_INFO, usbatm, "ADSL state: stopped\n");
+			atm_info(usbatm, "ADSL state: stopped\n");
 			break;
 
 		default:
-			atm_printk(KERN_INFO, usbatm, "Unknown adsl status %02x\n", instance->adsl_status);
+			atm_info(usbatm, "Unknown adsl status %02x\n", instance->adsl_status);
 			break;
 		}
 	}
Signature · 1 line
2.11.0
#2 lore raw

PATCH 3/3 drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk()

In reply to Enrico Weigelt, metux IT consult

Since we have the nice helpers pr_err() and pr_warn(), use them instead of raw printk().

---
 drivers/usb/atm/usbatm.c  | 2 +-
 drivers/usb/atm/xusbatm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/atm/usbatm.c +1 -1
index 56fe30d247da..1c90aa273a41 100644
@@ -1278,7 +1278,7 @@ EXPORT_SYMBOL_GPL(usbatm_usb_disconnect);
 static int __init usbatm_usb_init(void)
 {
 	if (sizeof(struct usbatm_control) > sizeof_field(struct sk_buff, cb)) {
-		printk(KERN_ERR "%s unusable with this kernel!\n", usbatm_driver_name);
+		pr_err("%s unusable with this kernel!\n", usbatm_driver_name);
 		return -EIO;
 	}
 
drivers/usb/atm/xusbatm.c +1 -1
index ffc9810070a3..0befbf63d1cc 100644
@@ -179,7 +179,7 @@ static int __init xusbatm_init(void)
 	    num_vendor != num_product ||
 	    num_vendor != num_rx_endpoint ||
 	    num_vendor != num_tx_endpoint) {
-		printk(KERN_WARNING "xusbatm: malformed module parameters\n");
+		pr_warn("xusbatm: malformed module parameters\n");
 		return -EINVAL;
 	}
 
Signature · 1 line
2.11.0
maintainer Acked-by on v1 3/3
#3 lore raw

Re: [PATCH 3/3] drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk()

Quoted 4 lines · metux IT consult

Since we have the nice helpers pr_err() and pr_warn(), use them instead of raw printk().

Quoted 32 lines
---
  drivers/usb/atm/usbatm.c  | 2 +-
  drivers/usb/atm/xusbatm.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
drivers/usb/atm/usbatm.c +1 -1
index 56fe30d247da..1c90aa273a41 100644
@@ -1278,7 +1278,7 @@ EXPORT_SYMBOL_GPL(usbatm_usb_disconnect);
  static int __init usbatm_usb_init(void)
  {
  	if (sizeof(struct usbatm_control) > sizeof_field(struct sk_buff, cb)) {
-		printk(KERN_ERR "%s unusable with this kernel!\n", usbatm_driver_name);
+		pr_err("%s unusable with this kernel!\n", usbatm_driver_name);
  		return -EIO;
  	}
 
drivers/usb/atm/xusbatm.c +1 -1
index ffc9810070a3..0befbf63d1cc 100644
@@ -179,7 +179,7 @@ static int __init xusbatm_init(void)
  	    num_vendor != num_product ||
  	    num_vendor != num_rx_endpoint ||
  	    num_vendor != num_tx_endpoint) {
-		printk(KERN_WARNING "xusbatm: malformed module parameters\n");
+		pr_warn("xusbatm: malformed module parameters\n");
  		return -EINVAL;
  	}