diff mbox series

[4/5] block/vvfat: Remove pointless check of NDEBUG

Message ID 20230221232520.14480-5-philmd@linaro.org
State Superseded
Headers show
Series bulk: Replace assert(0) -> g_assert_not_reached() | expand

Commit Message

Philippe Mathieu-Daudé Feb. 21, 2023, 11:25 p.m. UTC
Since commit 262a69f428 ("osdep.h: Prohibit disabling
assert() in supported builds") 'NDEBUG' can not be defined,
so '#ifndef NDEBUG' is dead code. Remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 block/vvfat.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Richard Henderson Feb. 22, 2023, 12:09 a.m. UTC | #1
On 2/21/23 13:25, Philippe Mathieu-Daudé wrote:
> Since commit 262a69f428 ("osdep.h: Prohibit disabling
> assert() in supported builds") 'NDEBUG' can not be defined,
> so '#ifndef NDEBUG' is dead code. Remove it.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   block/vvfat.c | 3 ---
>   1 file changed, 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

> 
> diff --git a/block/vvfat.c b/block/vvfat.c
> index d7d775bd2c..fd45e86416 100644
> --- a/block/vvfat.c
> +++ b/block/vvfat.c
> @@ -2784,13 +2784,10 @@ static int handle_commits(BDRVVVFATState* s)
>               fail = -2;
>               break;
>           case ACTION_WRITEOUT: {
> -#ifndef NDEBUG
> -            /* these variables are only used by assert() below */
>               direntry_t* entry = array_get(&(s->directory),
>                       commit->param.writeout.dir_index);
>               uint32_t begin = begin_of_direntry(entry);
>               mapping_t* mapping = find_mapping_for_cluster(s, begin);
> -#endif
>   
>               assert(mapping);
>               assert(mapping->begin == begin);
diff mbox series

Patch

diff --git a/block/vvfat.c b/block/vvfat.c
index d7d775bd2c..fd45e86416 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2784,13 +2784,10 @@  static int handle_commits(BDRVVVFATState* s)
             fail = -2;
             break;
         case ACTION_WRITEOUT: {
-#ifndef NDEBUG
-            /* these variables are only used by assert() below */
             direntry_t* entry = array_get(&(s->directory),
                     commit->param.writeout.dir_index);
             uint32_t begin = begin_of_direntry(entry);
             mapping_t* mapping = find_mapping_for_cluster(s, begin);
-#endif
 
             assert(mapping);
             assert(mapping->begin == begin);