Fix some style problems in qobject
cover Fix some style problems in qobject
Some style problems in qobject directory are found by checkpatch.pl. Fix these style problems.
Zhang Han (4):
qobject: open brace '{' following struct go on the same line
qobject: code indent should never use tabs
qobject: spaces required around that operators
qobject: braces {} are necessary for all arms of this statement
qobject/json-parser.c | 3 +-- qobject/qdict.c | 12 +++++++----- qobject/qjson.c | 3 +-- 3 files changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 1/4 qobject: open brace '{' following struct go on the same line
Put open brace '{' on the same line of struct.
--- qobject/json-parser.c | 3 +-- qobject/qjson.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
qobject/json-parser.c +1 -2
@@ -31,8 +31,7 @@ struct JSONToken {char str[]; }; -typedef struct JSONParserContext -{ +typedef struct JSONParserContext { Error *err; JSONToken *current; GQueue *buf;
qobject/qjson.c +1 -2
@@ -22,8 +22,7 @@#include "qapi/qmp/qstring.h" #include "qemu/unicode.h" -typedef struct JSONParsingState -{ +typedef struct JSONParsingState { JSONMessageParser parser; QObject *result; Error *err;
Signature · 1 line
2.29.1.59.gf9b6481aed
Re: [PATCH 1/4] qobject: open brace '{' following struct go on the same line
Quoted 7 lines · Zhang Han
Put open brace '{' on the same line of struct.
Signed-off-by Zhang Han <[email protected]>--- qobject/json-parser.c | 3 +-- qobject/qjson.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
ping?
This patch set was submitted two weeks ago,and 2 of patches ([1/4], [4/4]) has been reviewd. Whose tree should it go via?
Other patches receive no replies.
Did I miss any response?
The link follows:
http://patchwork.ozlabs.org/project/qemu-devel/cover/[email protected]/
ping?This patch set about code style problem in qobject receives no replies.
Did I miss any response?
The link follows:
http://patchwork.ozlabs.org/project/qemu-devel/cover/[email protected]/
Quoted 3 lines · zhanghan (J)
ping?This patch set about code style problem in qobject receives no replies.
Did I miss any response?
The Christmas break ate your patches. My apologies!
[...]
PATCH 2/4 qobject: code indent should never use tabs
In reply to Zhang HanTransfer tabs to spaces.
--- qobject/qdict.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
qobject/qdict.c +2 -2
@@ -38,8 +38,8 @@ QDict *qdict_new(void)*/ static unsigned int tdb_hash (const char *name) { -unsigned value;/* Used to compute the hash value. */ -unsigned i;/* Used to cycle through random values. */ +unsigned value;/* Used to compute the hash value. */ +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++)
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 3/4 qobject: spaces required around that operators
In reply to Zhang HanAdd spaces around operators.
--- qobject/qdict.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
qobject/qdict.c +2 -2
@@ -42,8 +42,8 @@ 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++) - value = (value + (((const unsigned char *)name)[i] << (i*5 %24 ))); +for (value =0x238F13AF *strlen (name), i =0 ; name[i]; i++) + value = (value + (((const unsigned char *)name)[i] << (i *5 %24 )));return (1103515243 * value +12345 ); }
Signature · 1 line
2.29.1.59.gf9b6481aed
PATCH 4/4 qobject: braces {} are necessary for all arms of this statement
In reply to Zhang HanAdd braces {} for arms of if/for statement
--- qobject/qdict.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
qobject/qdict.c +4 -2
@@ -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 ; }
Signature · 1 line
2.29.1.59.gf9b6481aed
Re: [PATCH 4/4] qobject: braces {} are necessary for all arms of this statement
Quoted 6 lines · Zhang Han
Add braces {} for arms of if/for statement
Signed-off-by Zhang Han <[email protected]>--- qobject/qdict.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [PATCH 0/4] Fix some style problems in qobject
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
- [tag update] patchew/[email protected] -> patchew/[email protected] - [tag update] patchew/[email protected] -> patchew/[email protected] * [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
1caa0fd qobject: braces {} are necessary for all arms of this statement b0ca07e qobject: spaces required around that operators 0adae60 qobject: code indent should never use tabs
4eea991 qobject: open brace '{' following struct go on the same line
=== OUTPUT BEGIN ===
1/4 Checking commit 4eea9919361d (qobject: open brace '{' following struct go on the same line) 2/4 Checking commit 0adae6079b21 (qobject: code indent should never use tabs) 3/4 Checking commit b0ca07e6cac6 (qobject: spaces required around that operators)
ERROR: braces {} are necessary for all arms of this statement
#22: FILE: qobject/qdict.c:45:
+ for (value = 0x238F13AF * strlen(name), i = 0; name[i]; i++)
[...]
total: 1 errors, 0 warnings, 10 lines checked
Patch 3/4 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
4/4 Checking commit 1caa0fdbcda9 (qobject: braces {} are necessary for all arms of this statement) === OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]