Skip to contentSkip to conversation

aes: Remove unused code (NDEBUG, u16)

PATCH Applied Stefan Weil 2 participants 3 messages Jun 29, 2013 – Jul 22, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aes: Remove unused code (NDEBUG, u16)

The current code includes assert.h very early (from qemu-common.h), so the definition of NDEBUG was without any effect.

In the initial version from 2004, NDEBUG was used to disable the assertions. Those assertions are not in time critical code, so it is no longer reasonable to disable them and the definition of NDEBUG can be removed.

Type u16 is also unused and therefore does not need a type definition.

---
 util/aes.c |    5 -----
 1 file changed, 5 deletions(-)
util/aes.c +0 -5
index 91e97fa..4b4d88e 100644
@@ -30,12 +30,7 @@
 #include "qemu-common.h"
 #include "qemu/aes.h"
 
-#ifndef NDEBUG
-#define NDEBUG
-#endif
-
 typedef uint32_t u32;
-typedef uint16_t u16;
 typedef uint8_t u8;
 
 /* This controls loop-unrolling in aes_core.c */
Signature · 1 line
1.7.10.4
#1 lore raw

Am 29.06.2013 17:10, schrieb Stefan Weil:

Quoted 21 lines

The current code includes assert.h very early (from qemu-common.h), so the definition of NDEBUG was without any effect.

In the initial version from 2004, NDEBUG was used to disable the assertions. Those assertions are not in time critical code, so it is no longer reasonable to disable them and the definition of NDEBUG can be removed.

Type u16 is also unused and therefore does not need a type definition.

---
 util/aes.c |    5 -----
 1 file changed, 5 deletions(-)
util/aes.c +0 -0
index 91e97fa..4b4d88e 100644
@@ -30,12 +30,7 @@
 #include "qemu-common.h"
 #include "qemu/aes.h"

util/aes.c line 36

Quoted 10 lines
util/aes.c +0 -5
 
-#ifndef NDEBUG
-#define NDEBUG
-#endif
-
 typedef uint32_t u32;
-typedef uint16_t u16;
 typedef uint8_t u8;
 
 /* This controls loop-unrolling in aes_core.c */

Please apply this patch to the qemu-trivial queue,
and maybe this one, too: http://patchwork.ozlabs.org/patch/257416/.

Thanks,
Stefan

#2 lore raw
Quoted 5 lines · Stefan Weil

Am 29.06.2013 17:10, schrieb Stefan Weil:

Quoted 4 lines

The current code includes assert.h very early (from qemu-common.h), so the definition of NDEBUG was without any effect.

Type u16 is also unused and therefore does not need a type definition.

Thanks, applied to the trivial patches queue.

/mjt