erofs-utils: lib: use another way to check power-of-2
PATCH 1/1 erofs-utils: lib: use another way to check power-of-2
Otherwise, Coverity will complain as "Operands don't affect result (CONSTANT_EXPRESSION_RESULT)", which I don't think that is an issue.
Coverity-id: 508261
Signed-off-by Gao Xiang <[email protected]>
--- lib/kite_deflate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kite_deflate.c +1 -1
@@ -834,7 +834,7 @@ static int kite_mf_init(struct kite_matchfinder *mf, unsigned int wsiz,return -EINVAL ; cfg = &kite_mfcfg[level]; -if (wsiz > kHistorySize32 || (1 <<ilog2 (wsiz)) != wsiz) +if (wsiz > kHistorySize32 || (wsiz & (wsiz -1 )))return -EINVAL ; mf->hash =calloc (0x10000 ,sizeof (mf->hash[0 ]));
Signature · 1 line
2.43.5