qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/9] Replacing malloc and the like with GLib's variants


From: no-reply
Subject: Re: [PATCH 0/9] Replacing malloc and the like with GLib's variants
Date: Sat, 13 Mar 2021 08:54:47 -0800 (PST)

Patchew URL: 
20210313163653.37089-1-ma.mandourr@gmail.com/">https://patchew.org/QEMU/20210313163653.37089-1-ma.mandourr@gmail.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210313163653.37089-1-ma.mandourr@gmail.com
Subject: [PATCH 0/9] Replacing malloc and the like with GLib's variants 

=== 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/20210313094747.2966948-1-laurent@vivier.eu -> 
patchew/20210313094747.2966948-1-laurent@vivier.eu
 * [new tag]         patchew/20210313163653.37089-1-ma.mandourr@gmail.com -> 
patchew/20210313163653.37089-1-ma.mandourr@gmail.com
Switched to a new branch 'test'
a6a3a12 tools/virtiofsd: Replacing malloc-like calls with GLib's variants
159f751 tools/virtiofsd/fuse_opt.c: Replaced a malloc with GLib's g_try_malloc
b2cf8da tools/virtiofsd/buffer.c: replaced a calloc call with GLib's g_try_new0
5d20862 util/compatfd.c: Replaced a malloc with GLib's g_try_malloc
6a11f79 target/xtensa: Replaced malloc/free with GLib's variants.
7169f27 pc-bios/s390-ccw/netmain.c: Changed a malloc/free to GLib's variants
836befe hw/audio/fmopl.c: Replaced calls to malloc with GLib's variants
fb66b78 hw/audio/fmopl.c: Fixing some style errors.
ded3f81 bsd-user/elfload.c: Replaced calls to malloc/free with GLib variants

=== OUTPUT BEGIN ===
1/9 Checking commit ded3f81fd71b (bsd-user/elfload.c: Replaced calls to 
malloc/free with GLib variants)
2/9 Checking commit fb66b785f597 (hw/audio/fmopl.c: Fixing some style errors.)
ERROR: space required before the open parenthesis '('
#44: FILE: hw/audio/fmopl.c:610:
+    if((TL_TABLE = malloc(TL_MAX * 2 * sizeof(int32_t))) == NULL)

ERROR: do not use assignment in if condition
#44: FILE: hw/audio/fmopl.c:610:
+    if((TL_TABLE = malloc(TL_MAX * 2 * sizeof(int32_t))) == NULL)

ERROR: braces {} are necessary for all arms of this statement
#44: FILE: hw/audio/fmopl.c:610:
+    if((TL_TABLE = malloc(TL_MAX * 2 * sizeof(int32_t))) == NULL)
[...]

ERROR: that open brace { should be on the previous line
#46: FILE: hw/audio/fmopl.c:612:
+    if((SIN_TABLE = malloc(SIN_ENT * 4 *sizeof(int32_t *))) == NULL)
+    {

ERROR: spaces required around that '*' (ctx:WxV)
#46: FILE: hw/audio/fmopl.c:612:
+    if((SIN_TABLE = malloc(SIN_ENT * 4 *sizeof(int32_t *))) == NULL)
                                        ^

ERROR: space required before the open parenthesis '('
#46: FILE: hw/audio/fmopl.c:612:
+    if((SIN_TABLE = malloc(SIN_ENT * 4 *sizeof(int32_t *))) == NULL)

ERROR: do not use assignment in if condition
#46: FILE: hw/audio/fmopl.c:612:
+    if((SIN_TABLE = malloc(SIN_ENT * 4 *sizeof(int32_t *))) == NULL)

ERROR: that open brace { should be on the previous line
#51: FILE: hw/audio/fmopl.c:617:
+    if((AMS_TABLE = malloc(AMS_ENT * 2 * sizeof(int32_t))) == NULL)
+    {

ERROR: space required before the open parenthesis '('
#51: FILE: hw/audio/fmopl.c:617:
+    if((AMS_TABLE = malloc(AMS_ENT * 2 * sizeof(int32_t))) == NULL)

ERROR: do not use assignment in if condition
#51: FILE: hw/audio/fmopl.c:617:
+    if((AMS_TABLE = malloc(AMS_ENT * 2 * sizeof(int32_t))) == NULL)

ERROR: that open brace { should be on the previous line
#57: FILE: hw/audio/fmopl.c:623:
+    if((VIB_TABLE = malloc(VIB_ENT *2 * sizeof(int32_t))) == NULL)
+    {

ERROR: spaces required around that '*' (ctx:WxV)
#57: FILE: hw/audio/fmopl.c:623:
+    if((VIB_TABLE = malloc(VIB_ENT *2 * sizeof(int32_t))) == NULL)
                                    ^

ERROR: space required before the open parenthesis '('
#57: FILE: hw/audio/fmopl.c:623:
+    if((VIB_TABLE = malloc(VIB_ENT *2 * sizeof(int32_t))) == NULL)

ERROR: do not use assignment in if condition
#57: FILE: hw/audio/fmopl.c:623:
+    if((VIB_TABLE = malloc(VIB_ENT *2 * sizeof(int32_t))) == NULL)

total: 14 errors, 0 warnings, 76 lines checked

Patch 2/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

3/9 Checking commit 836befe9f057 (hw/audio/fmopl.c: Replaced calls to malloc 
with GLib's variants)
ERROR: space required before the open parenthesis '('
#29: FILE: hw/audio/fmopl.c:610:
+    if((TL_TABLE = g_try_new(int32_t, TL_MAX * 2)) == NULL)

ERROR: do not use assignment in if condition
#29: FILE: hw/audio/fmopl.c:610:
+    if((TL_TABLE = g_try_new(int32_t, TL_MAX * 2)) == NULL)

ERROR: braces {} are necessary for all arms of this statement
#29: FILE: hw/audio/fmopl.c:610:
+    if((TL_TABLE = g_try_new(int32_t, TL_MAX * 2)) == NULL)
[...]

ERROR: space required before the open parenthesis '('
#32: FILE: hw/audio/fmopl.c:612:
+    if((SIN_TABLE = g_try_new(int32_t *, SIN_ENT * 4)) == NULL)

ERROR: do not use assignment in if condition
#32: FILE: hw/audio/fmopl.c:612:
+    if((SIN_TABLE = g_try_new(int32_t *, SIN_ENT * 4)) == NULL)

ERROR: space required before the open parenthesis '('
#39: FILE: hw/audio/fmopl.c:617:
+    if((AMS_TABLE = g_try_new(int32_t, AMS_ENT * 2)) == NULL)

ERROR: do not use assignment in if condition
#39: FILE: hw/audio/fmopl.c:617:
+    if((AMS_TABLE = g_try_new(int32_t, AMS_ENT * 2)) == NULL)

ERROR: space required before the open parenthesis '('
#48: FILE: hw/audio/fmopl.c:623:
+    if((VIB_TABLE = g_try_new(int32_t, VIB_ENT * 2)) == NULL)

ERROR: do not use assignment in if condition
#48: FILE: hw/audio/fmopl.c:623:
+    if((VIB_TABLE = g_try_new(int32_t, VIB_ENT * 2)) == NULL)

ERROR: that open brace { should be on the previous line
#58: FILE: hw/audio/fmopl.c:630:
+    if((ENV_CURVE = g_try_new(int32_t, 2 * EG_ENT + 1)) == NULL)
+    {

ERROR: space required before the open parenthesis '('
#58: FILE: hw/audio/fmopl.c:630:
+    if((ENV_CURVE = g_try_new(int32_t, 2 * EG_ENT + 1)) == NULL)

ERROR: do not use assignment in if condition
#58: FILE: hw/audio/fmopl.c:630:
+    if((ENV_CURVE = g_try_new(int32_t, 2 * EG_ENT + 1)) == NULL)

total: 12 errors, 0 warnings, 75 lines checked

Patch 3/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

4/9 Checking commit 7169f277a76a (pc-bios/s390-ccw/netmain.c: Changed a 
malloc/free to GLib's variants)
5/9 Checking commit 6a11f79ebba6 (target/xtensa: Replaced malloc/free with 
GLib's variants.)
ERROR: g_free(NULL) is safe this check is probably not required
#97: FILE: target/xtensa/xtensa-isa.c:336:
     if (intisa->opname_lookup_table) {
+        g_free(intisa->opname_lookup_table);

ERROR: g_free(NULL) is safe this check is probably not required
#103: FILE: target/xtensa/xtensa-isa.c:341:
     if (intisa->state_lookup_table) {
+        g_free(intisa->state_lookup_table);

ERROR: g_free(NULL) is safe this check is probably not required
#109: FILE: target/xtensa/xtensa-isa.c:346:
     if (intisa->sysreg_lookup_table) {
+        g_free(intisa->sysreg_lookup_table);

ERROR: g_free(NULL) is safe this check is probably not required
#115: FILE: target/xtensa/xtensa-isa.c:351:
         if (intisa->sysreg_table[n]) {
+            g_free(intisa->sysreg_table[n]);

ERROR: g_free(NULL) is safe this check is probably not required
#122: FILE: target/xtensa/xtensa-isa.c:357:
     if (intisa->interface_lookup_table) {
+        g_free(intisa->interface_lookup_table);

ERROR: g_free(NULL) is safe this check is probably not required
#128: FILE: target/xtensa/xtensa-isa.c:362:
     if (intisa->funcUnit_lookup_table) {
+        g_free(intisa->funcUnit_lookup_table);

total: 6 errors, 0 warnings, 103 lines checked

Patch 5/9 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

6/9 Checking commit 5d208628105b (util/compatfd.c: Replaced a malloc with 
GLib's g_try_malloc)
7/9 Checking commit b2cf8da37f0e (tools/virtiofsd/buffer.c: replaced a calloc 
call with GLib's g_try_new0)
8/9 Checking commit 159f751ac549 (tools/virtiofsd/fuse_opt.c: Replaced a malloc 
with GLib's g_try_malloc)
9/9 Checking commit a6a3a12373a3 (tools/virtiofsd: Replacing malloc-like calls 
with GLib's variants)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
20210313163653.37089-1-ma.mandourr@gmail.com/testing.checkpatch/?type=message">http://patchew.org/logs/20210313163653.37089-1-ma.mandourr@gmail.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]