Commit cade0fe4 authored by YAMANE Toshiaki's avatar YAMANE Toshiaki Committed by Greg Kroah-Hartman

staging/gdm72xx: Use netdev_ or pr_ printks in netlink_k.c

fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...

and add pr_fmt.
Signed-off-by: default avatarYAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2d839022
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/netlink.h> #include <linux/netlink.h>
...@@ -54,8 +56,8 @@ static void netlink_rcv_cb(struct sk_buff *skb) ...@@ -54,8 +56,8 @@ static void netlink_rcv_cb(struct sk_buff *skb)
if (skb->len < nlh->nlmsg_len || if (skb->len < nlh->nlmsg_len ||
nlh->nlmsg_len > ND_MAX_MSG_LEN) { nlh->nlmsg_len > ND_MAX_MSG_LEN) {
printk(KERN_ERR "Invalid length (%d,%d)\n", skb->len, netdev_err(skb->dev, "Invalid length (%d,%d)\n",
nlh->nlmsg_len); skb->len, nlh->nlmsg_len);
return; return;
} }
...@@ -69,10 +71,11 @@ static void netlink_rcv_cb(struct sk_buff *skb) ...@@ -69,10 +71,11 @@ static void netlink_rcv_cb(struct sk_buff *skb)
rcv_cb(dev, nlh->nlmsg_type, msg, mlen); rcv_cb(dev, nlh->nlmsg_type, msg, mlen);
dev_put(dev); dev_put(dev);
} else } else
printk(KERN_ERR "dev_get_by_index(%d) " netdev_err(skb->dev,
"is not found.\n", ifindex); "dev_get_by_index(%d) is not found.\n",
ifindex);
} else } else
printk(KERN_ERR "Unregistered Callback\n"); netdev_err(skb->dev, "Unregistered Callback\n");
} }
} }
...@@ -116,14 +119,14 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) ...@@ -116,14 +119,14 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
int ret = 0; int ret = 0;
if (group > ND_MAX_GROUP) { if (group > ND_MAX_GROUP) {
printk(KERN_ERR "Group %d is invalied.\n", group); pr_err("Group %d is invalied.\n", group);
printk(KERN_ERR "Valid group is 0 ~ %d.\n", ND_MAX_GROUP); pr_err("Valid group is 0 ~ %d.\n", ND_MAX_GROUP);
return -EINVAL; return -EINVAL;
} }
skb = alloc_skb(NLMSG_SPACE(len), GFP_ATOMIC); skb = alloc_skb(NLMSG_SPACE(len), GFP_ATOMIC);
if (!skb) { if (!skb) {
printk(KERN_ERR "netlink_broadcast ret=%d\n", ret); pr_err("netlink_broadcast ret=%d\n", ret);
return -ENOMEM; return -ENOMEM;
} }
...@@ -144,7 +147,7 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) ...@@ -144,7 +147,7 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
return len; return len;
else { else {
if (ret != -ESRCH) { if (ret != -ESRCH) {
printk(KERN_ERR "netlink_broadcast g=%d, t=%d, l=%d, r=%d\n", pr_err("netlink_broadcast g=%d, t=%d, l=%d, r=%d\n",
group, type, len, ret); group, type, len, ret);
} }
ret = 0; ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment