qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] Small optimizations for code using g_malloc0 + memset/memcpy
@ 2015-10-08 19:35 Thomas Huth
  2015-10-08 19:35 ` [Qemu-devel] [PATCH 1/5] hw/dma/pxa2xx: Remove superfluous memset Thomas Huth
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Thomas Huth @ 2015-10-08 19:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

There are a couple of spots in the QEMU code which use g_malloc0,
directly followed by a memset or memcpy which fill the whole
allocated buffer. In this case it either does not make sense to
zero the buffer via g_malloc0 first (so g_malloc should be used
instead), or if the second command is a memset(..., 0, ...), then
the memset does not make much sense, of course, since the buffer
has already been zeroed by the g_malloc0.

Thomas Huth (5):
  hw/dma/pxa2xx: Remove superfluous memset
  hw/scsi/spapr_vscsi: Remove superfluous memset
  hw/input/tsc210x: Remove superfluous memset
  tests/i44fx-test: No need for zeroing memory before memset
  linux-user/syscall: Replace g_malloc0 + memcpy with g_memdup

 hw/dma/pxa2xx_dma.c   | 1 -
 hw/input/tsc210x.c    | 8 ++------
 hw/scsi/spapr_vscsi.c | 1 -
 linux-user/syscall.c  | 3 +--
 tests/i440fx-test.c   | 2 +-
 5 files changed, 4 insertions(+), 11 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-10-09  8:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-08 19:35 [Qemu-devel] [PATCH 0/5] Small optimizations for code using g_malloc0 + memset/memcpy Thomas Huth
2015-10-08 19:35 ` [Qemu-devel] [PATCH 1/5] hw/dma/pxa2xx: Remove superfluous memset Thomas Huth
2015-10-08 20:59   ` Eric Blake
2015-10-09  6:39     ` Thomas Huth
2015-10-08 19:35 ` [Qemu-devel] [PATCH 2/5] hw/scsi/spapr_vscsi: " Thomas Huth
2015-10-08 21:00   ` Eric Blake
2015-10-09  1:51   ` David Gibson
2015-10-08 19:35 ` [Qemu-devel] [PATCH 3/5] hw/input/tsc210x: " Thomas Huth
2015-10-08 23:34   ` Eric Blake
2015-10-09  6:40     ` Thomas Huth
2015-10-08 19:35 ` [Qemu-devel] [PATCH 4/5] tests/i44fx-test: No need for zeroing memory before memset Thomas Huth
2015-10-08 20:24   ` Laszlo Ersek
2015-10-09  6:36     ` Thomas Huth
2015-10-09  6:46     ` Markus Armbruster
2015-10-09  8:08       ` Laszlo Ersek
2015-10-08 19:35 ` [Qemu-devel] [PATCH 5/5] linux-user/syscall: Replace g_malloc0 + memcpy with g_memdup Thomas Huth
2015-10-08 23:32   ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).