kernel_samsung_a53x/sound/core/seq
Takashi Iwai 5368600924 ALSA: seq: fix function cast warnings
[ Upstream commit d7bf73809849463f76de42aad62c850305dd6c5d ]

clang-16 points out a control flow integrity (kcfi) issue when event
callbacks get converted to incompatible types:

sound/core/seq/seq_midi.c:135:30: error: cast from 'int (*)(struct snd_rawmidi_substream *, const char *, int)' to 'snd_seq_dump_func_t' (aka 'int (*)(void *, void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  135 |                 snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream);
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/core/seq/seq_virmidi.c:83:31: error: cast from 'int (*)(struct snd_rawmidi_substream *, const unsigned char *, int)' to 'snd_seq_dump_func_t' (aka 'int (*)(void *, void *, int)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
   83 |                         snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)snd_rawmidi_receive, vmidi->substream);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For addressing those errors, introduce wrapper functions that are used
for callbacks and bridge to the actual function call with pointer
cast.

The code was originally added with the initial ALSA merge in linux-2.5.4.

[ the patch description shamelessly copied from Arnd's original patch
  -- tiwai ]

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240213101020.459183-1-arnd@kernel.org
Link: https://lore.kernel.org/r/20240213135343.16411-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 08:44:53 +01:00
..
oss Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_clientmgr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_clientmgr.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_compat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_dummy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_fifo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_fifo.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_info.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_info.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_lock.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_lock.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_memory.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_memory.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_midi.c ALSA: seq: fix function cast warnings 2024-11-19 08:44:53 +01:00
seq_midi_emul.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_midi_event.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_ports.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_ports.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_prioq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_prioq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_queue.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_queue.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_system.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_system.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_timer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_timer.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
seq_virmidi.c ALSA: seq: fix function cast warnings 2024-11-19 08:44:53 +01:00