From: no-reply@patchew.org
To: annakoppad@gmail.com
Cc: famz@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc
Date: Thu, 29 Sep 2016 10:16:15 -0700 (PDT) [thread overview]
Message-ID: <20160929171603.448446.26572@ex-std-node742.prod.rhcloud.com> (raw)
In-Reply-To: <1475168226-13194-1-git-send-email-annakoppad@gmail.com>
Hi,
Your series seems to have some coding style problems. See output below for
more information:
Type: series
Message-id: 1475168226-13194-1-git-send-email-annakoppad@gmail.com
Subject: [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True
commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
echo "Checking PATCH $n/$total: $(git show --no-patch --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))
done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
34e7856 Convert uses of malloc to g_malloc
=== OUTPUT BEGIN ===
Checking PATCH 1/1: Convert uses of malloc to g_malloc...
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
Argument "m" isn't numeric in numeric eq (==) at ./scripts/checkpatch.pl line 2459.
Use of uninitialized value $1 in concatenation (.) or string at ./scripts/checkpatch.pl line 2460.
ERROR: spaces required around that '*' (ctx:VxV)
#57: FILE: bsd-user/elfload.c:1194:
+ elf_phdata = (struct elf_phdr *)g_malloc(elf_ex.e_phentsize*elf_ex.e_phnum);
^
ERROR: unnecessary cast may hide bugs, use g_new instead
#57: FILE: bsd-user/elfload.c:1194:
+ elf_phdata = (struct elf_phdr *)g_malloc(elf_ex.e_phentsize*elf_ex.e_phnum);
ERROR: unnecessary cast may hide bugs, use g_new instead
#66: FILE: bsd-user/elfload.c:1247:
+ elf_interpreter = (char *)g_malloc(elf_ppnt->p_filesz);
ERROR: space prohibited between function name and open parenthesis '('
#92: FILE: disas/m68k.c:1889:
+ opc_pointer[0] = g_malloc (sizeof (struct m68k_opcode *)
ERROR: space prohibited between function name and open parenthesis '('
#92: FILE: disas/m68k.c:1889:
+ opc_pointer[0] = g_malloc (sizeof (struct m68k_opcode *)
ERROR: space prohibited between function name and open parenthesis '('
#105: FILE: disas/sparc.c:2626:
+ hash_buf = g_malloc (sizeof (* hash_buf) * num_opcodes);
ERROR: space prohibited between function name and open parenthesis '('
#105: FILE: disas/sparc.c:2626:
+ hash_buf = g_malloc (sizeof (* hash_buf) * num_opcodes);
ERROR: space prohibited after that '*' (ctx:BxW)
#105: FILE: disas/sparc.c:2626:
+ hash_buf = g_malloc (sizeof (* hash_buf) * num_opcodes);
^
ERROR: space prohibited between function name and open parenthesis '('
#114: FILE: disas/sparc.c:2688:
+ g_malloc (sparc_num_opcodes * sizeof (sparc_opcode *));
ERROR: space prohibited between function name and open parenthesis '('
#114: FILE: disas/sparc.c:2688:
+ g_malloc (sparc_num_opcodes * sizeof (sparc_opcode *));
ERROR: code indent should never use tabs
#127: FILE: hw/audio/fmopl.c:621:
+^Iif( (TL_TABLE = g_malloc(TL_MAX*2*sizeof(INT32))) == NULL)$
ERROR: spaces required around that '*' (ctx:VxV)
#127: FILE: hw/audio/fmopl.c:621:
+ if( (TL_TABLE = g_malloc(TL_MAX*2*sizeof(INT32))) == NULL)
^
ERROR: spaces required around that '*' (ctx:VxV)
#127: FILE: hw/audio/fmopl.c:621:
+ if( (TL_TABLE = g_malloc(TL_MAX*2*sizeof(INT32))) == NULL)
^
ERROR: space prohibited after that open parenthesis '('
#127: FILE: hw/audio/fmopl.c:621:
+ if( (TL_TABLE = g_malloc(TL_MAX*2*sizeof(INT32))) == NULL)
ERROR: space required before the open parenthesis '('
#127: FILE: hw/audio/fmopl.c:621:
+ if( (TL_TABLE = g_malloc(TL_MAX*2*sizeof(INT32))) == NULL)
ERROR: do not use assignment in if condition
#127: FILE: hw/audio/fmopl.c:621:
+ if( (TL_TABLE = g_malloc(TL_MAX*2*sizeof(INT32))) == NULL)
ERROR: braces {} are necessary for all arms of this statement
#127: FILE: hw/audio/fmopl.c:621:
+ if( (TL_TABLE = g_malloc(TL_MAX*2*sizeof(INT32))) == NULL)
[...]
ERROR: code indent should never use tabs
#130: FILE: hw/audio/fmopl.c:623:
+^Iif( (SIN_TABLE = g_malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)$
ERROR: spaces required around that '*' (ctx:VxV)
#130: FILE: hw/audio/fmopl.c:623:
+ if( (SIN_TABLE = g_malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
^
ERROR: spaces required around that '*' (ctx:WxV)
#130: FILE: hw/audio/fmopl.c:623:
+ if( (SIN_TABLE = g_malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
^
ERROR: space prohibited after that open parenthesis '('
#130: FILE: hw/audio/fmopl.c:623:
+ if( (SIN_TABLE = g_malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
ERROR: space required before the open parenthesis '('
#130: FILE: hw/audio/fmopl.c:623:
+ if( (SIN_TABLE = g_malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
ERROR: do not use assignment in if condition
#130: FILE: hw/audio/fmopl.c:623:
+ if( (SIN_TABLE = g_malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
ERROR: code indent should never use tabs
#136: FILE: hw/audio/fmopl.c:628:
+^Iif( (AMS_TABLE = g_malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)$
ERROR: spaces required around that '*' (ctx:VxV)
#136: FILE: hw/audio/fmopl.c:628:
+ if( (AMS_TABLE = g_malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
^
ERROR: spaces required around that '*' (ctx:WxV)
#136: FILE: hw/audio/fmopl.c:628:
+ if( (AMS_TABLE = g_malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
^
ERROR: space prohibited after that open parenthesis '('
#136: FILE: hw/audio/fmopl.c:628:
+ if( (AMS_TABLE = g_malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
ERROR: space required before the open parenthesis '('
#136: FILE: hw/audio/fmopl.c:628:
+ if( (AMS_TABLE = g_malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
ERROR: do not use assignment in if condition
#136: FILE: hw/audio/fmopl.c:628:
+ if( (AMS_TABLE = g_malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
ERROR: code indent should never use tabs
#143: FILE: hw/audio/fmopl.c:634:
+^Iif( (VIB_TABLE = g_malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)$
ERROR: spaces required around that '*' (ctx:VxV)
#143: FILE: hw/audio/fmopl.c:634:
+ if( (VIB_TABLE = g_malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
^
ERROR: spaces required around that '*' (ctx:WxV)
#143: FILE: hw/audio/fmopl.c:634:
+ if( (VIB_TABLE = g_malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
^
ERROR: space prohibited after that open parenthesis '('
#143: FILE: hw/audio/fmopl.c:634:
+ if( (VIB_TABLE = g_malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
ERROR: space required before the open parenthesis '('
#143: FILE: hw/audio/fmopl.c:634:
+ if( (VIB_TABLE = g_malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
ERROR: do not use assignment in if condition
#143: FILE: hw/audio/fmopl.c:634:
+ if( (VIB_TABLE = g_malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
ERROR: code indent should never use tabs
#152: FILE: hw/audio/fmopl.c:1223:
+^Iptr = g_malloc(state_size);$
ERROR: code indent should never use tabs
#226: FILE: slirp/mbuf.c:74:
+^I^Im = (struct mbuf *)g_malloc(SLIRP_MSIZE);$
ERROR: unnecessary cast may hide bugs, use g_new instead
#226: FILE: slirp/mbuf.c:74:
+ m = (struct mbuf *)g_malloc(SLIRP_MSIZE);
ERROR: code indent should never use tabs
#235: FILE: slirp/mbuf.c:168:
+^I dat = (char *)g_malloc(size);$
ERROR: unnecessary cast may hide bugs, use g_new instead
#235: FILE: slirp/mbuf.c:168:
+ dat = (char *)g_malloc(size);
WARNING: line over 80 characters
#248: FILE: slirp/sbuf.c:55:
+ sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)g_malloc(size);
ERROR: code indent should never use tabs
#248: FILE: slirp/sbuf.c:55:
+^I^Isb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)g_malloc(size);$
ERROR: unnecessary cast may hide bugs, use g_new instead
#248: FILE: slirp/sbuf.c:55:
+ sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)g_malloc(size);
ERROR: unnecessary cast may hide bugs, use g_new instead
#261: FILE: slirp/socket.c:51:
+ so = (struct socket *)g_malloc(sizeof(struct socket));
ERROR: code indent should never use tabs
#274: FILE: slirp/tcp_subr.c:250:
+^Itp = (struct tcpcb *)g_malloc(sizeof(*tp));$
ERROR: unnecessary cast may hide bugs, use g_new instead
#274: FILE: slirp/tcp_subr.c:250:
+ tp = (struct tcpcb *)g_malloc(sizeof(*tp));
ERROR: space prohibited between function name and open parenthesis '('
#304: FILE: tests/tcg/cris/check_openpf1.c:20:
+ fnam = g_malloc (strlen (argv[0]) + 2);
ERROR: space prohibited between function name and open parenthesis '('
#304: FILE: tests/tcg/cris/check_openpf1.c:20:
+ fnam = g_malloc (strlen (argv[0]) + 2);
ERROR: code indent should never use tabs
#335: FILE: tests/tcg/test-mmap.c:452:
+^Idummybuf = g_malloc (pagesize);$
ERROR: space prohibited between function name and open parenthesis '('
#335: FILE: tests/tcg/test-mmap.c:452:
+ dummybuf = g_malloc (pagesize);
ERROR: code indent should never use tabs
#374: FILE: util/envlist.c:28:
+^Iif ((envlist = g_malloc(sizeof (*envlist))) == NULL)$
ERROR: space prohibited between function name and open parenthesis '('
#374: FILE: util/envlist.c:28:
+ if ((envlist = g_malloc(sizeof (*envlist))) == NULL)
ERROR: do not use assignment in if condition
#374: FILE: util/envlist.c:28:
+ if ((envlist = g_malloc(sizeof (*envlist))) == NULL)
ERROR: braces {} are necessary for all arms of this statement
#374: FILE: util/envlist.c:28:
+ if ((envlist = g_malloc(sizeof (*envlist))) == NULL)
[...]
ERROR: code indent should never use tabs
#383: FILE: util/envlist.c:164:
+^Iif ((entry = g_malloc(sizeof (*entry))) == NULL)$
ERROR: space prohibited between function name and open parenthesis '('
#383: FILE: util/envlist.c:164:
+ if ((entry = g_malloc(sizeof (*entry))) == NULL)
ERROR: do not use assignment in if condition
#383: FILE: util/envlist.c:164:
+ if ((entry = g_malloc(sizeof (*entry))) == NULL)
ERROR: code indent should never use tabs
#392: FILE: util/envlist.c:228:
+^Ipenv = env = g_malloc((envlist->el_count + 1) * sizeof (char *));$
ERROR: space prohibited between function name and open parenthesis '('
#392: FILE: util/envlist.c:228:
+ penv = env = g_malloc((envlist->el_count + 1) * sizeof (char *));
total: 58 errors, 1 warnings, 273 lines checked
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
next prev parent reply other threads:[~2016-09-29 17:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 16:57 [Qemu-devel] [PATCH] Convert uses of malloc to g_malloc Annapoornima Koppad
2016-09-29 17:10 ` Daniel P. Berrange
2016-09-29 18:07 ` Paolo Bonzini
2016-09-29 17:15 ` no-reply
2016-09-29 17:16 ` no-reply [this message]
2016-09-29 17:24 ` Thomas Huth
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=20160929171603.448446.26572@ex-std-node742.prod.rhcloud.com \
--to=no-reply@patchew.org \
--cc=annakoppad@gmail.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
/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.