Commit Graph

810 Commits

Author SHA1 Message Date
Yue Haibing c0241d7180 ALSA: gus: Remove unused declarations
snd_gf1_synth_init() and snd_gf1_synth_done() were declared but never
implenmented and used since the beginning of kernel git history.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Link: https://patch.msgid.link/20251112092007.3546539-1-yuehaibing@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-11-12 10:34:44 +01:00
Junrui Luo 0c4a13ba88 ALSA: wavefront: Fix integer overflow in sample size validation
The wavefront_send_sample() function has an integer overflow issue
when validating sample size. The header->size field is u32 but gets
cast to int for comparison with dev->freemem

Fix by using unsigned comparison to avoid integer overflow.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB7881B47789D1B060CE8BF4C3AFC2A@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-11-06 11:03:28 +01:00
Junrui Luo e11c5c13ce ALSA: wavefront: Clear substream pointers on close
Clear substream pointers in close functions to avoid leaving dangling
pointers, helping to improve code safety and
prevents potential issues.

Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Reported-by: Junrui Luo <moonafterrain@outlook.com>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
Link: https://patch.msgid.link/SYBPR01MB7881DF762CAB45EE42F6D812AFC2A@SYBPR01MB7881.ausprd01.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-11-06 11:02:48 +01:00
Takashi Iwai 4b97f8e614 ALSA: wavefront: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-19-tiwai@suse.de
2025-09-01 13:53:03 +02:00
Takashi Iwai ec4c3dcf15 ALSA: wss: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-18-tiwai@suse.de
2025-09-01 13:53:03 +02:00
Takashi Iwai 372b43467a ALSA: wss: Use guard() for mutex locks
Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-17-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 79112d6527 ALSA: sscape: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-16-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 7b4ac26689 ALSA: emu8000: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-15-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 5487fb09fa ALSA: sb: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-14-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai d994b2ba8f ALSA: sb: Use guard() for mutex locks
Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-13-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 949ffce4af ALSA: opti9xx: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-12-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 1e012ff2fb ALSA: opl3sa2: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-11-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 6aaf6dadd9 ALSA: msnd: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-10-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai ae2b22b467 ALSA: gus: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-9-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 3abb538fff ALSA: gus: Use guard() for mutex locks
Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

As replaced with the guard(mutex), no longer used snd_gf1_mem_lock()
is dropped, too.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-8-tiwai@suse.de
2025-09-01 13:53:02 +02:00
Takashi Iwai 98ea9c6a06 ALSA: es18xx: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-7-tiwai@suse.de
2025-09-01 13:53:01 +02:00
Takashi Iwai e5a5ad81c8 ALSA: es1688: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-6-tiwai@suse.de
2025-09-01 13:53:01 +02:00
Takashi Iwai 6f5d556a80 ALSA: cs423x: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-5-tiwai@suse.de
2025-09-01 13:53:01 +02:00
Takashi Iwai 14ba220697 ALSA: cs423x: Use guard() for mutex locks
Replace the manual mutex lock/unlock pairs with guard() for code
simplification.

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-4-tiwai@suse.de
2025-09-01 13:53:01 +02:00
Takashi Iwai ca1d5ca2e5 ALSA: cmi8330: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-3-tiwai@suse.de
2025-09-01 13:53:01 +02:00
Takashi Iwai 8c6a0bc917 ALSA: ad1816a: Use guard() for spin locks
Clean up the code using guard() for spin locks.

Merely code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-2-tiwai@suse.de
2025-09-01 13:53:01 +02:00
Takashi Iwai fc52ff69c5 ALSA: wss: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-39-tiwai@suse.de
2025-07-11 09:53:16 +02:00
Takashi Iwai 2e2a2feb91 ALSA: wavefront: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-38-tiwai@suse.de
2025-07-11 09:53:16 +02:00
Takashi Iwai 96b1776d01 ALSA: sscape: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-37-tiwai@suse.de
2025-07-11 09:53:16 +02:00
Takashi Iwai c8eef317e6 ALSA: sc6000: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-36-tiwai@suse.de
2025-07-11 09:53:15 +02:00
Takashi Iwai b4a82a97c4 ALSA: opti9xx: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-35-tiwai@suse.de
2025-07-11 09:53:15 +02:00
Takashi Iwai c7eaa0ebed ALSA: opl3sa2: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-34-tiwai@suse.de
2025-07-11 09:53:15 +02:00
Takashi Iwai 9c4e42967d ALSA: msnd: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-33-tiwai@suse.de
2025-07-11 09:53:15 +02:00
Takashi Iwai 72b1baa1d6 ALSA: gus: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-32-tiwai@suse.de
2025-07-11 09:53:15 +02:00
Takashi Iwai 74987a0cc4 ALSA: galaxy: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-31-tiwai@suse.de
2025-07-11 09:53:15 +02:00
Takashi Iwai 962dba349a ALSA: es18xx: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-30-tiwai@suse.de
2025-07-11 09:53:14 +02:00
Takashi Iwai 22095c0515 ALSA: es1688: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-29-tiwai@suse.de
2025-07-11 09:53:14 +02:00
Takashi Iwai 9a5cca8d83 ALSA: cs423x: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-28-tiwai@suse.de
2025-07-11 09:53:14 +02:00
Takashi Iwai 4e55e03e4c ALSA: cmi8330: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-27-tiwai@suse.de
2025-07-11 09:53:14 +02:00
Takashi Iwai 231d135055 ALSA: cmi8328: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-26-tiwai@suse.de
2025-07-11 09:53:14 +02:00
Takashi Iwai dd9de1a144 ALSA: als100: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-25-tiwai@suse.de
2025-07-11 09:53:14 +02:00
Takashi Iwai 461cef4d7d ALSA: adlib: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-24-tiwai@suse.de
2025-07-11 09:53:14 +02:00
Takashi Iwai 94d7b8beae ALSA: ad1816a: Use safer strscpy() instead of strcpy()
Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250710100727.22653-23-tiwai@suse.de
2025-07-11 09:53:13 +02:00
Thorsten Blum 043faef334 ALSA: ad1816a: Fix potential NULL pointer deref in snd_card_ad1816a_pnp()
Use pr_warn() instead of dev_warn() when 'pdev' is NULL to avoid a
potential NULL pointer dereference.

Cc: stable@vger.kernel.org
Fixes: 20869176d7 ("ALSA: ad1816a: Use standard print API")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250703200616.304309-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-07-04 09:04:12 +02:00
Takashi Iwai 4c267ae2ef ALSA: sb: Force to disable DMAs once when DMA mode is changed
When the DMA mode is changed on the (still real!) SB AWE32 after
playing a stream and closing, the previous DMA setup was still
silently kept, and it can confuse the hardware, resulting in the
unexpected noises.  As a workaround, enforce the disablement of DMA
setups when the DMA setup is changed by the kcontrol.

https://bugzilla.kernel.org/show_bug.cgi?id=218185
Link: https://patch.msgid.link/20250610064322.26787-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-06-10 08:45:43 +02:00
Takashi Iwai ed29e073ba ALSA: sb: Don't allow changing the DMA mode during operations
When a PCM stream is already running, one shouldn't change the DMA
mode via kcontrol, which may screw up the hardware.  Return -EBUSY
instead.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=218185
Link: https://patch.msgid.link/20250610064322.26787-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-06-10 08:45:33 +02:00
Ingo Molnar 41cb08555c treewide, timers: Rename from_timer() to timer_container_of()
Move this API to the canonical timer_*() namespace.

[ tglx: Redone against pre rc1 ]

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/aB2X0jCKQO56WdMt@gmail.com
2025-06-08 09:07:37 +02:00
Thorsten Blum e088806cf5 ALSA: sb: Replace deprecated strcpy() with strscpy()
strcpy() is deprecated; use strscpy() instead.

No functional changes intended.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250512105754.35595-2-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-13 10:57:51 +02:00
Dr. David Alan Gilbert 174d966428 ALSA: msnd: Remove midi code
Nothing calls snd_msndmidi_new()
  thus nothing sets chip->msndmidi_mpu
    The call to snd_msndmidi_input_read is gated on that being set,
    so snd_msndmidi_input_read() won't be called either.

This is probably a missing call to snd_msndmidi_new(), but since
this is ancient code, it's probably best to remove it (especially
since I don't have the hardware to test it).

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20250511172957.1001583-1-linux@treblig.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-12 09:55:09 +02:00
Kuninori Morimoto f67c90d60f ALSA: isa/gus: remove snd_gf1_lfo_xxx()
There is no snd_gf1_lfo_xxx() implementation, and no one is using it.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o6w2pqm8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-11 16:23:28 +02:00
Dr. David Alan Gilbert 5d51fdd122 ALSA: gus: Remove deadcode
snd_gus_use_dec(), snd_gus_use_inc() and snd_gf1_print_voice_registers()
last uses were removed in 2007 by
commit e5723b41ab ("[ALSA] Remove sequencer instrument layer")

Remove them.

While there, remove big #if 0 blocks next to the code being deleted.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Link: https://patch.msgid.link/20250508000225.195766-1-linux@treblig.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-05-08 11:52:25 +02:00
Thorsten Blum 080410fe61 ALSA: azt2320: Replace deprecated strcpy() with strscpy()
strcpy() is deprecated, use strscpy() instead.

Link: https://github.com/KSPP/linux/issues/88
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250407090832.743255-1-thorsten.blum@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-04-08 11:48:37 +02:00
Thomas Gleixner 8fa7292fee treewide: Switch/rename to timer_delete[_sync]()
timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
over and remove the historical wrapper inlines.

Conversion was done with coccinelle plus manual fixups where necessary.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2025-04-05 10:30:12 +02:00
Colin Ian King 7fa25e87fe ALSA: es18xx: Fix spelling mistake "grap" -> "grab"
There are spelling mistakes in dev_err messages. Fix them.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://patch.msgid.link/20250228083631.676877-1-colin.i.king@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-02-28 10:34:55 +01:00
Charles Han e747104c99 ALSA: opti9xx: fix inconsistent indenting warning in snd_opti9xx_configure()
Fix below inconsistent indenting smatch warning.
smatch warnings:
sound/isa/opti9xx/opti92x-ad1848.c:489 snd_opti9xx_configure()
warn: inconsistent indenting

Signed-off-by: Charles Han <hanchunchao@inspur.com>
Link: https://patch.msgid.link/20250227091810.18847-1-hanchunchao@inspur.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2025-02-27 12:26:49 +01:00