diff mbox

aes: Remove unused code (NDEBUG, u16)

Message ID 1372518648-10862-1-git-send-email-sw@weilnetz.de
State Accepted
Headers show

Commit Message

Stefan Weil June 29, 2013, 3:10 p.m. UTC
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.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 util/aes.c |    5 -----
 1 file changed, 5 deletions(-)

Comments

Stefan Weil July 19, 2013, 6:51 p.m. UTC | #1
Am 29.06.2013 17:10, schrieb Stefan Weil:
> 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.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  util/aes.c |    5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/util/aes.c b/util/aes.c
> index 91e97fa..4b4d88e 100644
> --- a/util/aes.c
> +++ b/util/aes.c
> @@ -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 */


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

Thanks,
Stefan
Michael Tokarev July 22, 2013, 5:29 p.m. UTC | #2
19.07.2013 22:51, Stefan Weil wrote:
> Am 29.06.2013 17:10, schrieb Stefan Weil:
>> 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
diff mbox

Patch

diff --git a/util/aes.c b/util/aes.c
index 91e97fa..4b4d88e 100644
--- a/util/aes.c
+++ b/util/aes.c
@@ -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 */