staging: wlan-ng: Replace pr_debug with netdev_dbg

This patch replace pr_debug with netdev_dbg when appropriate net_device
structure is found.
Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+... when != i == NULL
(
pr_err@p(...);
|
pr_info@p(...);
|
pr_debug@p(...);
)
...+>
}

@rr@
identifier r.s, fld;
@@

struct s {
	...
	struct net_device *fld;
	... };

@@
identifier r.i, r.s, rr.fld;
position r.p;
@@
(
-pr_err@p
+netdev_err
	(
+ i->fld,
...)
|
-pr_info@p
+netdev_info
	(
+ i->fld,
...)
|
-pr_debug@p
+netdev_dbg
	(
+ i->fld,
...)
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Haneen Mohammed 2017-09-12 22:32:25 -06:00 committed by Greg Kroah-Hartman
parent e2614ef1b2
commit 0fb8997bac
1 changed files with 47 additions and 31 deletions

View File

@ -394,7 +394,8 @@ int prism2mgmt_scan_results(struct wlandevice *wlandev, void *msgp)
count = HFA384x_SCANRESULT_MAX; count = HFA384x_SCANRESULT_MAX;
if (req->bssindex.data >= count) { if (req->bssindex.data >= count) {
pr_debug("requested index (%d) out of range (%d)\n", netdev_dbg(wlandev->netdev,
"requested index (%d) out of range (%d)\n",
req->bssindex.data, count); req->bssindex.data, count);
result = 2; result = 2;
req->resultcode.data = P80211ENUM_resultcode_invalid_parameters; req->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
@ -684,7 +685,8 @@ int prism2mgmt_start(struct wlandevice *wlandev, void *msgp)
goto done; goto done;
failed: failed:
pr_debug("Failed to set a config option, result=%d\n", result); netdev_dbg(wlandev->netdev,
"Failed to set a config option, result=%d\n", result);
msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters; msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
done: done:
@ -1120,15 +1122,17 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
/* Disable monitor mode */ /* Disable monitor mode */
result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_DISABLE); result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_DISABLE);
if (result) { if (result) {
pr_debug("failed to disable monitor mode, result=%d\n", netdev_dbg(wlandev->netdev,
"failed to disable monitor mode, result=%d\n",
result); result);
goto failed; goto failed;
} }
/* Disable port 0 */ /* Disable port 0 */
result = hfa384x_drvr_disable(hw, 0); result = hfa384x_drvr_disable(hw, 0);
if (result) { if (result) {
pr_debug netdev_dbg
("failed to disable port 0 after sniffing, result=%d\n", (wlandev->netdev,
"failed to disable port 0 after sniffing, result=%d\n",
result); result);
goto failed; goto failed;
} }
@ -1140,8 +1144,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
HFA384x_RID_CNFWEPFLAGS, HFA384x_RID_CNFWEPFLAGS,
hw->presniff_wepflags); hw->presniff_wepflags);
if (result) { if (result) {
pr_debug netdev_dbg
("failed to restore wepflags=0x%04x, result=%d\n", (wlandev->netdev,
"failed to restore wepflags=0x%04x, result=%d\n",
hw->presniff_wepflags, result); hw->presniff_wepflags, result);
goto failed; goto failed;
} }
@ -1153,8 +1158,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
word); word);
if (result) { if (result) {
pr_debug netdev_dbg
("failed to restore porttype, result=%d\n", (wlandev->netdev,
"failed to restore porttype, result=%d\n",
result); result);
goto failed; goto failed;
} }
@ -1162,7 +1168,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
/* Enable the port */ /* Enable the port */
result = hfa384x_drvr_enable(hw, 0); result = hfa384x_drvr_enable(hw, 0);
if (result) { if (result) {
pr_debug("failed to enable port to presniff setting, result=%d\n", netdev_dbg(wlandev->netdev,
"failed to enable port to presniff setting, result=%d\n",
result); result);
goto failed; goto failed;
} }
@ -1182,8 +1189,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
&(hw->presniff_port_type)); &(hw->presniff_port_type));
if (result) { if (result) {
pr_debug netdev_dbg
("failed to read porttype, result=%d\n", (wlandev->netdev,
"failed to read porttype, result=%d\n",
result); result);
goto failed; goto failed;
} }
@ -1192,15 +1200,17 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
HFA384x_RID_CNFWEPFLAGS, HFA384x_RID_CNFWEPFLAGS,
&(hw->presniff_wepflags)); &(hw->presniff_wepflags));
if (result) { if (result) {
pr_debug netdev_dbg
("failed to read wepflags, result=%d\n", (wlandev->netdev,
"failed to read wepflags, result=%d\n",
result); result);
goto failed; goto failed;
} }
hfa384x_drvr_stop(hw); hfa384x_drvr_stop(hw);
result = hfa384x_drvr_start(hw); result = hfa384x_drvr_start(hw);
if (result) { if (result) {
pr_debug("failed to restart the card for sniffing, result=%d\n", netdev_dbg(wlandev->netdev,
"failed to restart the card for sniffing, result=%d\n",
result); result);
goto failed; goto failed;
} }
@ -1208,7 +1218,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
/* Disable the port */ /* Disable the port */
result = hfa384x_drvr_disable(hw, 0); result = hfa384x_drvr_disable(hw, 0);
if (result) { if (result) {
pr_debug("failed to enable port for sniffing, result=%d\n", netdev_dbg(wlandev->netdev,
"failed to enable port for sniffing, result=%d\n",
result); result);
goto failed; goto failed;
} }
@ -1225,7 +1236,8 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
hw->sniff_channel = word; hw->sniff_channel = word;
if (result) { if (result) {
pr_debug("failed to set channel %d, result=%d\n", netdev_dbg(wlandev->netdev,
"failed to set channel %d, result=%d\n",
word, result); word, result);
goto failed; goto failed;
} }
@ -1238,8 +1250,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE, HFA384x_RID_CNFPORTTYPE,
word); word);
if (result) { if (result) {
pr_debug netdev_dbg
("failed to set porttype %d, result=%d\n", (wlandev->netdev,
"failed to set porttype %d, result=%d\n",
word, result); word, result);
goto failed; goto failed;
} }
@ -1257,8 +1270,9 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
} }
if (result) { if (result) {
pr_debug netdev_dbg
("failed to set wepflags=0x%04x, result=%d\n", (wlandev->netdev,
"failed to set wepflags=0x%04x, result=%d\n",
word, result); word, result);
goto failed; goto failed;
} }
@ -1283,15 +1297,17 @@ int prism2mgmt_wlansniff(struct wlandevice *wlandev, void *msgp)
/* Enable the port */ /* Enable the port */
result = hfa384x_drvr_enable(hw, 0); result = hfa384x_drvr_enable(hw, 0);
if (result) { if (result) {
pr_debug netdev_dbg
("failed to enable port for sniffing, result=%d\n", (wlandev->netdev,
"failed to enable port for sniffing, result=%d\n",
result); result);
goto failed; goto failed;
} }
/* Enable monitor mode */ /* Enable monitor mode */
result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_ENABLE); result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_ENABLE);
if (result) { if (result) {
pr_debug("failed to enable monitor mode, result=%d\n", netdev_dbg(wlandev->netdev,
"failed to enable monitor mode, result=%d\n",
result); result);
goto failed; goto failed;
} }