Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: zstd: Fix unused variable warning
The variable `litLengthSum` is only used by an `assert()`, so when asserts are disabled the compiler doesn't see any usage and warns. This issue is already fixed upstream by PR #2838 [0]. It was reported by the Kernel test robot in [1]. Another approach would be to change zstd's disabled `assert()` definition to use the argument in a disabled branch, instead of ignoring the argument. I've avoided this approach because there are some small changes necessary to get zstd to build, and I would want to thoroughly re-test for performance, since that is slightly changing the code in every function in zstd. It seems like a trivial change, but some functions are pretty sensitive to small changes. However, I think it is a valid approach that I would like to see upstream take, so I've opened Issue #2868 to attempt this upstream. Lastly, I've chosen not to use __maybe_unused because all code in lib/zstd/ must eventually be upstreamed. Upstream zstd can't use __maybe_unused because it isn't portable across all compilers. [0] facebook/zstd#2838 [1] https://lore.kernel.org/linux-mm/[email protected]/T/ [2] facebook/zstd#2868 Link: https://lore.kernel.org/r/[email protected]/ Link: https://lore.kernel.org/r/[email protected]/ Reported-by: kernel test robot <[email protected]> Signed-off-by: Nick Terrell <[email protected]> Signed-off-by: Divyanshu-Modi <[email protected]> Change-Id: I05b4b77bb8d8a9e9e3c3bd0d5570596b4e82b0ac Signed-off-by: Divyanshu-Modi <[email protected]>
- Loading branch information