mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] zstd: fix assert() logic
@ 2022-09-27 17:22 Enrico Scholz
  2022-09-28  9:11 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Enrico Scholz @ 2022-09-27 17:22 UTC (permalink / raw)
  To: barebox; +Cc: Enrico Scholz

It should warn when condition does **not** hold

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 lib/zstd/common/zstd_deps.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/zstd/common/zstd_deps.h b/lib/zstd/common/zstd_deps.h
index 7a5bf44839c9..f06df065dec0 100644
--- a/lib/zstd/common/zstd_deps.h
+++ b/lib/zstd/common/zstd_deps.h
@@ -84,7 +84,7 @@ static uint64_t ZSTD_div64(uint64_t dividend, uint32_t divisor) {
 
 #include <linux/kernel.h>
 
-#define assert(x) WARN_ON((x))
+#define assert(x) WARN_ON(!(x))
 
 #endif /* ZSTD_DEPS_ASSERT */
 #endif /* ZSTD_DEPS_NEED_ASSERT */
-- 
2.37.3




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

* Re: [PATCH] zstd: fix assert() logic
  2022-09-27 17:22 [PATCH] zstd: fix assert() logic Enrico Scholz
@ 2022-09-28  9:11 ` Sascha Hauer
  2022-09-28  9:29   ` Enrico Scholz
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2022-09-28  9:11 UTC (permalink / raw)
  To: Enrico Scholz; +Cc: barebox

On Tue, Sep 27, 2022 at 07:22:17PM +0200, Enrico Scholz wrote:
> It should warn when condition does **not** hold
> 
> Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
> ---
>  lib/zstd/common/zstd_deps.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

That fixes only the warnings, not the regression, right?

Sascha

> 
> diff --git a/lib/zstd/common/zstd_deps.h b/lib/zstd/common/zstd_deps.h
> index 7a5bf44839c9..f06df065dec0 100644
> --- a/lib/zstd/common/zstd_deps.h
> +++ b/lib/zstd/common/zstd_deps.h
> @@ -84,7 +84,7 @@ static uint64_t ZSTD_div64(uint64_t dividend, uint32_t divisor) {
>  
>  #include <linux/kernel.h>
>  
> -#define assert(x) WARN_ON((x))
> +#define assert(x) WARN_ON(!(x))
>  
>  #endif /* ZSTD_DEPS_ASSERT */
>  #endif /* ZSTD_DEPS_NEED_ASSERT */
> -- 
> 2.37.3
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



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

* Re: [PATCH] zstd: fix assert() logic
  2022-09-28  9:11 ` Sascha Hauer
@ 2022-09-28  9:29   ` Enrico Scholz
  0 siblings, 0 replies; 3+ messages in thread
From: Enrico Scholz @ 2022-09-28  9:29 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Sascha Hauer <sha@pengutronix.de> writes:

> On Tue, Sep 27, 2022 at 07:22:17PM +0200, Enrico Scholz wrote:
>> It should warn when condition does **not** hold
>
> That fixes only the warnings, not the regression, right?

no; sorry.  I stumpled over it while looking at this regression.


Enrico



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

end of thread, other threads:[~2022-09-28  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 17:22 [PATCH] zstd: fix assert() logic Enrico Scholz
2022-09-28  9:11 ` Sascha Hauer
2022-09-28  9:29   ` Enrico Scholz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox