All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH v2 0/4] Small optimizations for code using g_malloc0 + memset/memcpy
@ 2015-10-09 15:56 ` Thomas Huth
  0 siblings, 0 replies; 18+ messages in thread
From: Thomas Huth @ 2015-10-09 15:56 UTC (permalink / raw)
  To: qemu-devel, 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.

v2:
- Switched some of the g_malloc0()s to g_new0()s where appropriate
- Added Reviewed-by-s
- The spapr_vscsi patch has been picked up by David already, so not
  sending it again

Thomas Huth (4):
  hw/dma/pxa2xx: 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  | 3 +--
 hw/input/tsc210x.c   | 8 ++------
 linux-user/syscall.c | 3 +--
 tests/i440fx-test.c  | 2 +-
 4 files changed, 5 insertions(+), 11 deletions(-)

-- 
1.8.3.1



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

end of thread, other threads:[~2015-10-29  7:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09 15:56 [Qemu-trivial] [PATCH v2 0/4] Small optimizations for code using g_malloc0 + memset/memcpy Thomas Huth
2015-10-09 15:56 ` [Qemu-devel] " Thomas Huth
2015-10-09 15:56 ` [Qemu-trivial] [PATCH v2 1/4] hw/dma/pxa2xx: Remove superfluous memset Thomas Huth
2015-10-09 15:56   ` [Qemu-devel] " Thomas Huth
2015-10-09 22:58   ` [Qemu-trivial] " Eric Blake
2015-10-09 22:58     ` Eric Blake
2015-10-09 15:56 ` [Qemu-trivial] [PATCH v2 2/4] hw/input/tsc210x: " Thomas Huth
2015-10-09 15:56   ` [Qemu-devel] " Thomas Huth
2015-10-09 19:13   ` [Qemu-trivial] " Eric Blake
2015-10-09 19:13     ` Eric Blake
2015-10-09 15:56 ` [Qemu-trivial] [PATCH v2 3/4] tests/i44fx-test: No need for zeroing memory before memset Thomas Huth
2015-10-09 15:56   ` [Qemu-devel] " Thomas Huth
2015-10-09 15:56 ` [Qemu-trivial] [PATCH v2 4/4] linux-user/syscall: Replace g_malloc0 + memcpy with g_memdup Thomas Huth
2015-10-09 15:56   ` [Qemu-devel] " Thomas Huth
2015-10-12 13:23   ` [Qemu-trivial] " Riku Voipio
2015-10-12 13:23     ` Riku Voipio
2015-10-29  7:53 ` [Qemu-trivial] [PATCH v2 0/4] Small optimizations for code using g_malloc0 + memset/memcpy Michael Tokarev
2015-10-29  7:53   ` [Qemu-devel] " Michael Tokarev

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.