[PATCH] ALSA: ump: remove unnecessary check on blk

Luo Yifan posted 1 patch 2 weeks, 1 day ago
sound/core/ump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ALSA: ump: remove unnecessary check on blk
Posted by Luo Yifan 2 weeks, 1 day ago
The unsigned expression 'blk' will never be negative, so remove the
unnecessary check.

Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
---
 sound/core/ump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/ump.c b/sound/core/ump.c
index cf22a17e3..af763939e 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -366,7 +366,7 @@ int snd_ump_block_new(struct snd_ump_endpoint *ump, unsigned int blk,
 {
 	struct snd_ump_block *fb, *p;
 
-	if (blk < 0 || blk >= SNDRV_UMP_MAX_BLOCKS)
+	if (blk >= SNDRV_UMP_MAX_BLOCKS)
 		return -EINVAL;
 
 	if (snd_ump_get_block(ump, blk))
-- 
2.27.0
Re: [PATCH] ALSA: ump: remove unnecessary check on blk
Posted by Takashi Iwai 2 weeks, 1 day ago
On Fri, 08 Nov 2024 04:27:02 +0100,
Luo Yifan wrote:
> 
> The unsigned expression 'blk' will never be negative, so remove the
> unnecessary check.
> 
> Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>

Thanks, applied now.


Takashi