Thread (7 messages) flat view 7 messages, 4 authors, 2012-07-17

Re: [PATCH] drivers: connector: fixed coding style issues

From: Joe Perches <joe@perches.com>
Date: 2012-07-14 20:33:47

On Sat, 2012-07-14 at 23:26 +0300, Valentin Ilie wrote:
Fixed checkpatch warnings.
[]
quoted hunk ↗ jump to hunk
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
[]
quoted hunk ↗ jump to hunk
@@ -328,8 +328,8 @@ static int __init cn_proc_init(void)
 	int err;
 
 	if ((err = cn_add_callback(&cn_proc_event_id, "cn_proc",
-	 			   &cn_proc_mcast_ctl))) {
-		printk(KERN_WARNING "cn_proc failed to register\n");
+					&cn_proc_mcast_ctl))) {
+		pr_warn("cn_proc failed to register\n");
I don't believe the first part of this change is a checkpatch
message.  I think it would be better written by hoisting the
function outside the if like:

	err = cn_add_callback(&cn_proc_event_id, "cn_proc", &cn_proc_mcast_ctl)
	if (err) {
		pr_warn("cn_proc failed to register\n");
		return err;
	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help