[PATCH 11/44] kdbus: Cosmetic fix of kdbus_name_is_valid()

From: Sergei Zviagintsev
Date: Thu Oct 08 2015 - 07:44:33 EST


Initialize `dot' during declaration but not in the for-loop, as it is
not used as a loop cursor.

Signed-off-by: Sergei Zviagintsev <sergei@xxxxxxxx>
---
ipc/kdbus/names.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index 6b31b38ac2ad..4dea83defc8e 100644
--- a/ipc/kdbus/names.c
+++ b/ipc/kdbus/names.c
@@ -530,10 +530,10 @@ void kdbus_name_release_all(struct kdbus_name_registry *reg,
*/
bool kdbus_name_is_valid(const char *p, bool allow_wildcard)
{
- bool dot, found_dot = false;
+ bool dot = true, found_dot = false;
const char *q;

- for (dot = true, q = p; *q; q++) {
+ for (q = p; *q; q++) {
if (*q == '.') {
if (dot)
return false;
--
1.8.3.1

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