[OPW,kernel] Staging: vt6655: removing the need of PRINT_K macro
diff mbox

Message ID 20131015084416.GA7734@Ashvini
State Changes Requested
Headers show

Commit Message

Ashvini Varatharaj Oct. 15, 2013, 8:44 a.m. UTC
Replacing PRINT_K statements with the default pr_debug()

Signed-off-by: Ashvini Varatharaj <ashvinivaratharaj@gmail.com>
---
 drivers/staging/vt6655/bssdb.c  |    4 ++--
 drivers/staging/vt6655/device.h |    2 +-
 drivers/staging/vt6655/iwctl.c  |   23 ++++++++++++-----------
 drivers/staging/vt6655/wmgr.c   |   11 ++++++-----
 4 files changed, 21 insertions(+), 19 deletions(-)
 create mode 100644 drivers/staging/vt6655/device,h

Comments

Greg Kroah-Hartman Oct. 15, 2013, 4:19 p.m. UTC | #1
On Tue, Oct 15, 2013 at 02:14:16PM +0530, Ashvini Varatharaj wrote:
> Replacing PRINT_K statements with the default pr_debug()

Why?  You just made the kernel log "noiser" because:

> --- a/drivers/staging/vt6655/device.h
> +++ b/drivers/staging/vt6655/device.h
> @@ -150,7 +150,7 @@
>  /*---------------------  Export Types  ------------------------------*/
>  
>  #define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); }
> -#define PRINT_K(p, args...) { if (PRIVATE_Message) printk(p, ##args); }
> +

PRINT_K() only did something if PRIVATE_Message was defined.  And two
lines up there is this:

#define PRIVATE_Message                 0

So these messages never did anything.

So they can just be deleted entirely, want to do that instead?

thanks,

greg k-h
Josh Triplett Oct. 20, 2013, 12:38 p.m. UTC | #2
On Tue, Oct 15, 2013 at 09:19:30AM -0700, Greg KH wrote:
> On Tue, Oct 15, 2013 at 02:14:16PM +0530, Ashvini Varatharaj wrote:
> > Replacing PRINT_K statements with the default pr_debug()
> 
> Why?  You just made the kernel log "noiser" because:
> 
> > --- a/drivers/staging/vt6655/device.h
> > +++ b/drivers/staging/vt6655/device.h
> > @@ -150,7 +150,7 @@
> >  /*---------------------  Export Types  ------------------------------*/
> >  
> >  #define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); }
> > -#define PRINT_K(p, args...) { if (PRIVATE_Message) printk(p, ##args); }
> > +
> 
> PRINT_K() only did something if PRIVATE_Message was defined.  And two
> lines up there is this:
> 
> #define PRIVATE_Message                 0
> 
> So these messages never did anything.

FWIW, converting these to pr_debug was my suggestion, on the theory that
the debug messages presumably had some value, and ought to be available
via dynamic debug or defining DEBUG rather than this custom
PRIVATE_Message define.  That said,

> So they can just be deleted entirely, want to do that instead?

if that's your preference, that's fine too.  But blame me for the
original suggestion to use pr_debug instead.

- Josh Triplett

Patch
diff mbox

diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
index a23b591..d053de6 100644
--- a/drivers/staging/vt6655/bssdb.c
+++ b/drivers/staging/vt6655/bssdb.c
@@ -1039,7 +1039,7 @@  start:
 				union iwreq_data  wrqu;
 				memset(&wrqu, 0, sizeof(wrqu));
 				wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-				PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n");
+				pr_debug("wireless_send_event--->SIOCGIWAP(disassociated)\n");
 				wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
 			}
 #endif
@@ -1223,7 +1223,7 @@  start:
 					union iwreq_data  wrqu;
 					memset(&wrqu, 0, sizeof(wrqu));
 					wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-					PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n");
+					pr_debug("wireless_send_event--->SIOCGIWAP(disassociated)\n");
 					wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
 				}
 #endif
diff --git a/drivers/staging/vt6655/device,h b/drivers/staging/vt6655/device,h
new file mode 100644
index 0000000..e69de29
diff --git a/drivers/staging/vt6655/device.h b/drivers/staging/vt6655/device.h
index ca1b857..56e5cdf 100644
--- a/drivers/staging/vt6655/device.h
+++ b/drivers/staging/vt6655/device.h
@@ -150,7 +150,7 @@ 
 /*---------------------  Export Types  ------------------------------*/
 
 #define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); }
-#define PRINT_K(p, args...) { if (PRIVATE_Message) printk(p, ##args); }
+
 
 //0:11A 1:11B 2:11G
 typedef enum _VIA_BB_TYPE
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 4bff8aa..98b93a3 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -145,7 +145,7 @@  int iwctl_siwscan(struct net_device *dev,
 	if (pDevice->byReAssocCount > 0) {   //reject scan when re-associating!
 //send scan event to wpa_Supplicant
 		union iwreq_data wrqu;
-		PRINT_K("wireless_send_event--->SIOCGIWSCAN(scan done)\n");
+		pr_debug("wireless_send_event--->SIOCGIWSCAN(scan done)\n");
 		memset(&wrqu, 0, sizeof(wrqu));
 		wireless_send_event(pDevice->dev, SIOCGIWSCAN, &wrqu, NULL);
 		return 0;
@@ -167,7 +167,8 @@  int iwctl_siwscan(struct net_device *dev,
 			} else
 				pItemSSID->len = req->essid_len;
 			pMgmt->eScanType = WMAC_SCAN_PASSIVE;
-			PRINT_K("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n", ((PWLAN_IE_SSID)abyScanSSID)->abySSID,
+			pr_debug("SIOCSIWSCAN:[desired_ssid=%s,len=%d]\n",
+				((PWLAN_IE_SSID)abyScanSSID)->abySSID,
 				((PWLAN_IE_SSID)abyScanSSID)->len);
 			bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, abyScanSSID);
 			spin_unlock_irq(&pDevice->lock);
@@ -654,7 +655,7 @@  int iwctl_siwap(struct net_device *dev,
 		//mike :add
 		if ((is_broadcast_ether_addr(pMgmt->abyDesireBSSID)) ||
 		    (memcmp(pMgmt->abyDesireBSSID, ZeroBSSID, 6) == 0)) {
-			PRINT_K("SIOCSIWAP:invalid desired BSSID return!\n");
+			pr_debug("SIOCSIWAP:invalid desired BSSID return!\n");
 			return rc;
 		}
 		//mike add: if desired AP is hidden ssid(there are two same BSSID in list),
@@ -669,7 +670,7 @@  int iwctl_siwap(struct net_device *dev,
 				}
 			}
 			if (uSameBssidNum >= 2) {  //hit: desired AP is in hidden ssid mode!!!
-				PRINT_K("SIOCSIWAP:ignore for desired AP in hidden mode\n");
+				pr_debug("SIOCSIWAP:ignore for desired AP in hidden mode\n");
 				return rc;
 			}
 		}
@@ -785,7 +786,7 @@  int iwctl_siwessid(struct net_device *dev,
 		// Just send an empty SSID list
 		memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
 		memset(pMgmt->abyDesireBSSID, 0xFF, 6);
-		PRINT_K("set essid to 'any' \n");
+		pr_debug("set essid to 'any'\n");
 #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
 		return 0;
 #endif
@@ -832,7 +833,7 @@  int iwctl_siwessid(struct net_device *dev,
 );
 
 				if (pCurr == NULL) {
-					PRINT_K("SIOCSIWESSID:hidden ssid site survey before associate.......\n");
+					pr_debug("SIOCSIWESSID:hidden ssid site survey before associate.......\n");
 					vResetCommandTimer((void *)pDevice);
 					pMgmt->eScanType = WMAC_SCAN_ACTIVE;
 					bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
@@ -1658,12 +1659,12 @@  int iwctl_siwauth(struct net_device *dev,
 	case IW_AUTH_WPA_VERSION:
 		wpa_version = wrq->value;
 		if (wrq->value == IW_AUTH_WPA_VERSION_DISABLED) {
-			PRINT_K("iwctl_siwauth:set WPADEV to disable at 1??????\n");
+			pr_debug("iwctl_siwauth:set WPADEV to disable at 1??????\n");
 			//pDevice->bWPADevEnable = false;
 		} else if (wrq->value == IW_AUTH_WPA_VERSION_WPA) {
-			PRINT_K("iwctl_siwauth:set WPADEV to WPA1******\n");
+			pr_debug("iwctl_siwauth:set WPADEV to WPA1******\n");
 		} else {
-			PRINT_K("iwctl_siwauth:set WPADEV to WPA2******\n");
+			pr_debug("iwctl_siwauth:set WPADEV to WPA2******\n");
 		}
 		//pDevice->bWPASuppWextEnabled =true;
 		break;
@@ -1840,7 +1841,7 @@  int iwctl_siwencodeext(struct net_device *dev,
 	u8 key_array[64];
 	int ret = 0;
 
-	PRINT_K("SIOCSIWENCODEEXT...... \n");
+	pr_debug("SIOCSIWENCODEEXT......\n");
 
 	blen = sizeof(*param);
 	buf = kmalloc((int)blen, (int)GFP_KERNEL);
@@ -1864,7 +1865,7 @@  int iwctl_siwencodeext(struct net_device *dev,
 		alg_name = WPA_ALG_CCMP;
 		break;
 	default:
-		PRINT_K("Unknown alg = %d\n", ext->alg);
+		pr_debug("Unknown alg = %d\n", ext->alg);
 		ret = -ENOMEM;
 		goto error;
 	}
diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c
index ed4b32b..856e5f5 100644
--- a/drivers/staging/vt6655/wmgr.c
+++ b/drivers/staging/vt6655/wmgr.c
@@ -1711,7 +1711,7 @@  s_vMgrRxDeauthentication(
 				union iwreq_data  wrqu;
 				memset(&wrqu, 0, sizeof(wrqu));
 				wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-				PRINT_K("wireless_send_event--->SIOCGIWAP(disauthen)\n");
+				pr_debug("wireless_send_event--->SIOCGIWAP(disauthen)\n");
 				wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
 			}
 #endif
@@ -2928,19 +2928,20 @@  static void  Encyption_Rebuild(
 			pMgmt->eAuthenMode = WMAC_AUTH_WPAPSK;
 			if (pCurr->abyPKType[0] == WPA_TKIP) {
 				pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;    //TKIP
-				PRINT_K("Encyption_Rebuild--->ssid reset config to [WPAPSK-TKIP]\n");
+				pr_debug("Encyption_Rebuild--->ssid reset config to [WPAPSK-TKIP]\n");
 			} else if (pCurr->abyPKType[0] == WPA_AESCCMP) {
 				pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;    //AES
-				PRINT_K("Encyption_Rebuild--->ssid reset config to [WPAPSK-AES]\n");
+				pr_debug("Encyption_Rebuild--->ssid reset config to [WPAPSK-AES]\n");
 			}
 		} else if (pCurr->bWPA2Valid == true) {  //WPA2-PSK
 			pMgmt->eAuthenMode = WMAC_AUTH_WPA2PSK;
 			if (pCurr->abyCSSPK[0] == WLAN_11i_CSS_TKIP) {
 				pDevice->eEncryptionStatus = Ndis802_11Encryption2Enabled;     //TKIP
-				PRINT_K("Encyption_Rebuild--->ssid reset config to [WPA2PSK-TKIP]\n");
+				pr_debug("Encyption_Rebuild--->ssid reset config to [WPA2PSK-TKIP]\n");
 			} else if (pCurr->abyCSSPK[0] == WLAN_11i_CSS_CCMP) {
 				pDevice->eEncryptionStatus = Ndis802_11Encryption3Enabled;    //AES
-				PRINT_K("Encyption_Rebuild--->ssid reset config to [WPA2PSK-AES]\n");
+				pr_debug("Encyption_Rebuild--->ssid reset config to [WPA2PSK-AES]\n");
+
 			}
 		}
 	}