All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	Colin Ian King <colin.king@canonical.com>,
	alsa-devel@alsa-project.org
Subject: Re: Sparse errors
Date: Wed, 26 May 2021 09:02:03 +0300	[thread overview]
Message-ID: <20210526060203.GH24442@kadam> (raw)
In-Reply-To: <6b86f44e-82e0-3530-b579-1b054f459880@linux.intel.com>

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


  reply	other threads:[~2021-05-26  6:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 19:32 Sparse errors Pierre-Louis Bossart
2021-05-26  6:02 ` Dan Carpenter [this message]
2021-05-26  7:40 ` Takashi Iwai
2021-05-26 14:17   ` Pierre-Louis Bossart
2021-05-26 15:21     ` Takashi Iwai
2021-05-26 15:24     ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2019-03-28 18:34 Bharath Vedartham
2019-03-28 18:37 ` Greg KH
2019-03-28 19:03   ` Ozgur Kara
2019-03-28 19:23   ` Bharath Vedartham
2019-03-28 18:57 ` Ozgur Kara
2019-03-28 19:24   ` Bharath Vedartham
2003-05-28  5:38 sparse errors Ryan Anderson
2003-05-28 14:16 ` Linus Torvalds
2003-05-28 14:35   ` Carl-Daniel Hailfinger
2003-05-28 14:51     ` Dave Jones
2003-05-28 14:39 ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210526060203.GH24442@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=colin.king@canonical.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.