lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Sep 2014 13:03:03 +0200
From:	Thibaut Robert <thibaut.robert@...il.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Michalis Pappas <mpappas@...tmail.fm>,
	Davide Gianforte <davide@...gisdave.org>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Thibaut Robert <thibaut.robert@...il.com>
Subject: [PATCH] staging: gdm72xx: fix typo and coding style

Fix a typo in error message.
Add missing curling braces to conform to coding style.
Improve readibility.

Signed-off-by: Thibaut Robert <thibaut.robert@...il.com>
---
 drivers/staging/gdm72xx/netlink_k.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c
index 9d78bfc..31862e5 100644
--- a/drivers/staging/gdm72xx/netlink_k.c
+++ b/drivers/staging/gdm72xx/netlink_k.c
@@ -71,10 +71,11 @@ static void netlink_rcv_cb(struct sk_buff *skb)
 			if (dev) {
 				rcv_cb(dev, nlh->nlmsg_type, msg, mlen);
 				dev_put(dev);
-			} else
+			} else {
 				netdev_err(skb->dev,
 					   "dev_get_by_index(%d) is not found.\n",
 					   ifindex);
+			}
 		} else {
 			netdev_err(skb->dev, "Unregistered Callback\n");
 		}
@@ -120,9 +121,9 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
 	struct nlmsghdr *nlh;
 	int ret = 0;
 
-	if (group > ND_MAX_GROUP) {
-		pr_err("Group %d is invalied.\n", group);
-		pr_err("Valid group is 0 ~ %d.\n", ND_MAX_GROUP);
+	if (group < 0 || group > ND_MAX_GROUP) {
+		pr_err("Invalid group %d (valid groups are 0 to %d)\n",
+			group, ND_MAX_GROUP);
 		return -EINVAL;
 	}
 
@@ -147,10 +148,9 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
 
 	if (!ret)
 		return len;
-	if (ret != -ESRCH) {
+
+	if (ret != -ESRCH)
 		pr_err("netlink_broadcast g=%d, t=%d, l=%d, r=%d\n",
 		       group, type, len, ret);
-	}
-	ret = 0;
-	return ret;
+	return 0;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ