All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: drivers: opl3: fix useless self-comparison
@ 2021-05-26 19:29 Pierre-Louis Bossart
  2021-05-26 19:29 ` [PATCH 2/2] ALSA: pci: lx6464es: remove " Pierre-Louis Bossart
  2021-05-27  6:25 ` [PATCH 1/2] ALSA: drivers: opl3: fix " Takashi Iwai
  0 siblings, 2 replies; 4+ messages in thread
From: Pierre-Louis Bossart @ 2021-05-26 19:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Sparse throws the following warning:

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

This is likely a 16+ year old confusion between vp2 and vp.

Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/drivers/opl3/opl3_midi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c
index eb23c55323ae..e1b69c65c3c8 100644
--- a/sound/drivers/opl3/opl3_midi.c
+++ b/sound/drivers/opl3/opl3_midi.c
@@ -180,8 +180,7 @@ static int opl3_get_voice(struct snd_opl3 *opl3, int instr_4op,
 			if (vp2->state == SNDRV_OPL3_ST_ON_2OP) {
 				/* kill two voices, EXPENSIVE */
 				bp++;
-				voice_time = (voice_time > vp->time) ?
-					voice_time : vp->time;
+				voice_time = max(voice_time, vp2->time);
 			}
 		} else {
 			/* allocate 2op voice */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ALSA: pci: lx6464es: remove useless self-comparison
  2021-05-26 19:29 [PATCH 1/2] ALSA: drivers: opl3: fix useless self-comparison Pierre-Louis Bossart
@ 2021-05-26 19:29 ` Pierre-Louis Bossart
  2021-05-27  6:25   ` Takashi Iwai
  2021-05-27  6:25 ` [PATCH 1/2] ALSA: drivers: opl3: fix " Takashi Iwai
  1 sibling, 1 reply; 4+ messages in thread
From: Pierre-Louis Bossart @ 2021-05-26 19:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Sparse throws the following warning:

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

This comparison and error message make no sense, let's remove them.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/pci/lx6464es/lx_core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
index f884f5a6a61c..d3f58a3d17fb 100644
--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -674,10 +674,6 @@ int lx_stream_set_format(struct lx6464es *chip, struct snd_pcm_runtime *runtime,
 	u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe);
 	u32 channels = runtime->channels;
 
-	if (runtime->channels != channels)
-		dev_err(chip->card->dev, "channel count mismatch: %d vs %d",
-			   runtime->channels, channels);
-
 	mutex_lock(&chip->msg_lock);
 	lx_message_init(&chip->rmh, CMD_0C_DEF_STREAM);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ALSA: drivers: opl3: fix useless self-comparison
  2021-05-26 19:29 [PATCH 1/2] ALSA: drivers: opl3: fix useless self-comparison Pierre-Louis Bossart
  2021-05-26 19:29 ` [PATCH 2/2] ALSA: pci: lx6464es: remove " Pierre-Louis Bossart
@ 2021-05-27  6:25 ` Takashi Iwai
  1 sibling, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2021-05-27  6:25 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: alsa-devel, broonie

On Wed, 26 May 2021 21:29:56 +0200,
Pierre-Louis Bossart wrote:
> 
> Sparse throws the following warning:
> 
> sound/drivers/opl3/opl3_midi.c:183:60: error: self-comparison always
> evaluates to false
> 
> This is likely a 16+ year old confusion between vp2 and vp.
> 
> Suggested-by: Takashi Iwai <tiwai@suse.de>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ALSA: pci: lx6464es: remove useless self-comparison
  2021-05-26 19:29 ` [PATCH 2/2] ALSA: pci: lx6464es: remove " Pierre-Louis Bossart
@ 2021-05-27  6:25   ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2021-05-27  6:25 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: alsa-devel, broonie

On Wed, 26 May 2021 21:29:57 +0200,
Pierre-Louis Bossart wrote:
> 
> Sparse throws the following warning:
> 
> sound/pci/lx6464es/lx_core.c:677:34: error: self-comparison always
> evaluates to false
> 
> This comparison and error message make no sense, let's remove them.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-27  6:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 19:29 [PATCH 1/2] ALSA: drivers: opl3: fix useless self-comparison Pierre-Louis Bossart
2021-05-26 19:29 ` [PATCH 2/2] ALSA: pci: lx6464es: remove " Pierre-Louis Bossart
2021-05-27  6:25   ` Takashi Iwai
2021-05-27  6:25 ` [PATCH 1/2] ALSA: drivers: opl3: fix " Takashi Iwai

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.