perf lzma: Fix return value in lzma_is_compressed()
Subsystems (2)
PATCH 1/1 perf lzma: Fix return value in lzma_is_compressed()
lzma_is_compressed() returns -1 on error but is declared as bool. And -1 gets converted to true, which could be misleading. Return false instead to match the declared type.
Fixes 4b57fd44b61b ("perf tools: Add lzma_is_compressed function")
Cc <[email protected]>
Signed-off-by Miaoqian Lin <[email protected]>
--- tools/perf/util/lzma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/lzma.c +1 -1
@@ -120,7 +120,7 @@ bool lzma_is_compressed(const char *input)ssize_t rc;if (fd <0 ) -return -1 ; +return false; rc =read (fd, buf,sizeof (buf));close (fd);
Signature · 1 line
2.39.5 (Apple Git-154)
Quoted 16 lines · Miaoqian Lin
lzma_is_compressed()returns -1 on error but is declared as bool. And -1 gets converted to true, which could be misleading. Return false instead to match the declared type.Fixes 4b57fd44b61b ("perf tools: Add lzma_is_compressed function")Cc <[email protected]>Signed-off-by Miaoqian Lin <[email protected]>--- tools/perf/util/lzma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/lzma.c +0
-0
tools/perf/util/lzma.c bool lzma_is_compressed(const char *input) · line 126
Quoted 8 lines
tools/perf/util/lzma.c +1
-1@@ -120,7 +120,7 @@ bool lzma_is_compressed(const char *input)ssize_t rc;if (fd <0 ) -return -1 ; +return false; rc =read (fd, buf,sizeof (buf));close (fd);
Reviewed-by Dapeng Mi <[email protected]>