All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Han <zhanghan64@huawei.com>
To: <armbru@redhat.com>
Cc: alex.chen@huawei.com, hunongda@huawei.com,
	qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	zhang.zhanghailiang@huawei.com
Subject: [PATCH 4/4] qobject: braces {} are necessary for all arms of this statement
Date: Mon, 28 Dec 2020 15:11:29 +0800	[thread overview]
Message-ID: <20201228071129.24563-5-zhanghan64@huawei.com> (raw)
In-Reply-To: <20201228071129.24563-1-zhanghan64@huawei.com>

Add braces {} for arms of if/for statement

Signed-off-by: Zhang Han <zhanghan64@huawei.com>
---
 qobject/qdict.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/qobject/qdict.c b/qobject/qdict.c
index 05ec950e05..0a49b787ab 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -42,8 +42,9 @@ static unsigned int tdb_hash(const char *name)
     unsigned   i;      /* Used to cycle through random values. */
 
     /* Set the initial value from the key size. */
-    for (value = 0x238F13AF * strlen(name), i = 0; name[i]; i++)
+    for (value = 0x238F13AF * strlen(name), i = 0; name[i]; i++) {
         value = (value + (((const unsigned char *)name)[i] << (i * 5 % 24)));
+    }
 
     return (1103515243 * value + 12345);
 }
@@ -92,8 +93,9 @@ static QDictEntry *qdict_find(const QDict *qdict,
     QDictEntry *entry;
 
     QLIST_FOREACH(entry, &qdict->table[bucket], next)
-        if (!strcmp(entry->key, key))
+        if (!strcmp(entry->key, key)) {
             return entry;
+        }
 
     return NULL;
 }
-- 
2.29.1.59.gf9b6481aed



  parent reply	other threads:[~2020-12-28  7:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28  7:11 [PATCH 0/4] Fix some style problems in qobject Zhang Han
2020-12-28  7:11 ` [PATCH 1/4] qobject: open brace '{' following struct go on the same line Zhang Han
2020-12-28 11:12   ` Philippe Mathieu-Daudé
2021-01-14  2:22     ` [PATCH 0/4] Fix some style problems in qobject zhanghan (J)
2021-02-01  6:16       ` zhanghan (J)
2021-02-01 12:27         ` Markus Armbruster
2020-12-28  7:11 ` [PATCH 2/4] qobject: code indent should never use tabs Zhang Han
2020-12-28  7:11 ` [PATCH 3/4] qobject: spaces required around that operators Zhang Han
2020-12-28  7:11 ` Zhang Han [this message]
2020-12-28 11:13   ` [PATCH 4/4] qobject: braces {} are necessary for all arms of this statement Philippe Mathieu-Daudé
2020-12-28  7:45 ` [PATCH 0/4] Fix some style problems in qobject no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201228071129.24563-5-zhanghan64@huawei.com \
    --to=zhanghan64@huawei.com \
    --cc=alex.chen@huawei.com \
    --cc=armbru@redhat.com \
    --cc=hunongda@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.