Sparse errors
Dan Carpenter
dan.carpenter at oracle.com
Wed May 26 08:02:03 CEST 2021
On Tue, May 25, 2021 at 02:32:27PM -0500, Pierre-Louis Bossart wrote:
> Hi Takashi,
> Sparse reports a lot of new issues in our last checks with more options:
>
> export ARCH=x86_64 CF="-Wsparse-error -Wsparse-all -Wno-bitwise-pointer
> -Wno-pointer-arith -Wno-typesign -Wnoshadow -Wno-sizeof-bool"
> make -k sound/ C=2
>
> most are linked to the __user and pcm_format_t restricted types, but I found
> the simpler ones below which are useless comparisons. I can send a patch for
> the last but not sure how to address the first two.
>
> Thanks for your feedback
> -Pierre
>
> sound/core/info.c:95:38: error: self-comparison always evaluates to false
>
> if (pos < 0 || (long) pos != pos || (ssize_t) count < 0)
> return false;
>
> not sure what the second comparison is meant to check?
It's checking for if a 32 bit system is using the upper 32 bits of a
u64.
This one is valid, the rest are nonsense code.
regards,
dan carpenter
More information about the Alsa-devel
mailing list