Skip to content
Snippets Groups Projects
Commit f3c48ecc authored by Valentin Ilie's avatar Valentin Ilie Committed by David S. Miller
Browse files

drivers: connector: fixed coding style issues


V2: Replaced assignment in if statement.
Fixed coding style issues.

Signed-off-by: default avatarValentin Ilie <valentin.ilie@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ad8c9453
Branches
Tags
No related merge requests found
...@@ -325,11 +325,11 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg, ...@@ -325,11 +325,11 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
*/ */
static int __init cn_proc_init(void) static int __init cn_proc_init(void)
{ {
int err; int err = cn_add_callback(&cn_proc_event_id,
"cn_proc",
if ((err = cn_add_callback(&cn_proc_event_id, "cn_proc", &cn_proc_mcast_ctl);
&cn_proc_mcast_ctl))) { if (err) {
printk(KERN_WARNING "cn_proc failed to register\n"); pr_warn("cn_proc failed to register\n");
return err; return err;
} }
return 0; return 0;
......
...@@ -34,13 +34,14 @@ ...@@ -34,13 +34,14 @@
static struct cn_callback_entry * static struct cn_callback_entry *
cn_queue_alloc_callback_entry(struct cn_queue_dev *dev, const char *name, cn_queue_alloc_callback_entry(struct cn_queue_dev *dev, const char *name,
struct cb_id *id, struct cb_id *id,
void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) void (*callback)(struct cn_msg *,
struct netlink_skb_parms *))
{ {
struct cn_callback_entry *cbq; struct cn_callback_entry *cbq;
cbq = kzalloc(sizeof(*cbq), GFP_KERNEL); cbq = kzalloc(sizeof(*cbq), GFP_KERNEL);
if (!cbq) { if (!cbq) {
printk(KERN_ERR "Failed to create new callback queue.\n"); pr_err("Failed to create new callback queue.\n");
return NULL; return NULL;
} }
...@@ -71,7 +72,8 @@ int cn_cb_equal(struct cb_id *i1, struct cb_id *i2) ...@@ -71,7 +72,8 @@ int cn_cb_equal(struct cb_id *i1, struct cb_id *i2)
int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name, int cn_queue_add_callback(struct cn_queue_dev *dev, const char *name,
struct cb_id *id, struct cb_id *id,
void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) void (*callback)(struct cn_msg *,
struct netlink_skb_parms *))
{ {
struct cn_callback_entry *cbq, *__cbq; struct cn_callback_entry *cbq, *__cbq;
int found = 0; int found = 0;
...@@ -149,7 +151,7 @@ void cn_queue_free_dev(struct cn_queue_dev *dev) ...@@ -149,7 +151,7 @@ void cn_queue_free_dev(struct cn_queue_dev *dev)
spin_unlock_bh(&dev->queue_lock); spin_unlock_bh(&dev->queue_lock);
while (atomic_read(&dev->refcnt)) { while (atomic_read(&dev->refcnt)) {
printk(KERN_INFO "Waiting for %s to become free: refcnt=%d.\n", pr_info("Waiting for %s to become free: refcnt=%d.\n",
dev->name, atomic_read(&dev->refcnt)); dev->name, atomic_read(&dev->refcnt));
msleep(1000); msleep(1000);
} }
......
...@@ -185,7 +185,8 @@ static void cn_rx_skb(struct sk_buff *__skb) ...@@ -185,7 +185,8 @@ static void cn_rx_skb(struct sk_buff *__skb)
* May sleep. * May sleep.
*/ */
int cn_add_callback(struct cb_id *id, const char *name, int cn_add_callback(struct cb_id *id, const char *name,
void (*callback)(struct cn_msg *, struct netlink_skb_parms *)) void (*callback)(struct cn_msg *,
struct netlink_skb_parms *))
{ {
int err; int err;
struct cn_dev *dev = &cdev; struct cn_dev *dev = &cdev;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment