mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
aabdedf4d2
This driver creates an abstraction for different components by casting function
pointers to slightly incompatible types for each one to get the correct
argument even when the caller does not know those types. This is a
bit unreliable and not allowed in combination with control flow integrity
(KCFI):
sound/pci/ctxfi/ctatc.c:115:25: error: cast from 'int (*)(struct hw *, struct src_mgr **)' to 'create_t' (aka 'int (*)(struct hw *, void **)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
115 | [SRC] = { .create = (create_t)src_mgr_create,
| ^~~~~~~~~~~~~~~~~~~~~~~~
sound/pci/ctxfi/ctatc.c:116:20: error: cast from 'int (*)(struct src_mgr *)' to 'destroy_t' (aka 'int (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
116 | .destroy = (destroy_t)src_mgr_destroy },
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
sound/pci/ctxfi/ctatc.c:117:27: error: cast from 'int (*)(struct hw *, struct srcimp_mgr **)' to 'create_t' (aka 'int (*)(struct hw *, void **)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
117 | [SRCIMP] = { .create = (create_t)srcimp_mgr_create,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/pci/ctxfi/ctatc.c:118:20: error: cast from 'int (*)(struct srcimp_mgr *)' to 'destroy_t' (aka 'int (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
118 | .destroy = (destroy_t)srcimp_mgr_destroy },
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change these to always pass void pointers and move the abstraction one level
down.
Fixes:
|
||
---|---|---|
.. | ||
ct20k1reg.h | ||
ct20k2reg.h | ||
ctamixer.c | ||
ctamixer.h | ||
ctatc.c | ||
ctatc.h | ||
ctdaio.c | ||
ctdaio.h | ||
cthardware.c | ||
cthardware.h | ||
cthw20k1.c | ||
cthw20k1.h | ||
cthw20k2.c | ||
cthw20k2.h | ||
ctimap.c | ||
ctimap.h | ||
ctmixer.c | ||
ctmixer.h | ||
ctpcm.c | ||
ctpcm.h | ||
ctresource.c | ||
ctresource.h | ||
ctsrc.c | ||
ctsrc.h | ||
cttimer.c | ||
cttimer.h | ||
ctvmem.c | ||
ctvmem.h | ||
Makefile | ||
xfi.c |