alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Takashi Iwai <tiwai@suse.de>, alsa-devel@alsa-project.org
Cc: Colin Ian King <colin.king@canonical.com>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Sparse errors
Date: Tue, 25 May 2021 14:32:27 -0500	[thread overview]
Message-ID: <6b86f44e-82e0-3530-b579-1b054f459880@linux.intel.com> (raw)

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?

sound/drivers/opl3/opl3_midi.c:183:60: error: self-comparison always 
evaluates to false

This indeed makes no sense. the voice_time and vp->time are not changed 
in the loop, the test is either redundant or something else is missing.

sound/pci/lx6464es/lx_core.c:677:34: error: self-comparison always 
evaluates to false

That seems like dead code indeed:

	u32 channels = runtime->channels;

	if (runtime->channels != channels)
		dev_err(chip->card->dev, "channel count mismatch: %d vs %d",
			   runtime->channels, channels);

             reply	other threads:[~2021-05-25 19:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 19:32 Pierre-Louis Bossart [this message]
2021-05-26  6:02 ` Sparse errors Dan Carpenter
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

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=6b86f44e-82e0-3530-b579-1b054f459880@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).