lkml.org 
[lkml]   [2015]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 11/44] kdbus: Cosmetic fix of kdbus_name_is_valid()
Date
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@s15v.net>
---
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


\
 
 \ /
  Last update: 2015-10-08 14:01    [W:0.796 / U:1.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site