1. 13 Feb, 2024 2 commits
    • Arnd Bergmann's avatar
      ALSA: aw2: avoid casting function pointers · 022a13a1
      Arnd Bergmann authored
      clang-16 started warning about incompatible function pointers here:
      
      sound/pci/aw2/aw2-alsa.c:363:11: error: cast from 'void (*)(struct snd_pcm_substream *)' to 'snd_aw2_saa7146_it_cb' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
        363 |                                                     (snd_aw2_saa7146_it_cb)
            |                                                     ^~~~~~~~~~~~~~~~~~~~~~~
        364 |                                                     snd_pcm_period_elapsed,
            |                                                     ~~~~~~~~~~~~~~~~~~~~~~
      sound/pci/aw2/aw2-alsa.c:392:10: error: cast from 'void (*)(struct snd_pcm_substream *)' to 'snd_aw2_saa7146_it_cb' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
        392 |                                                    (snd_aw2_saa7146_it_cb)
            |                                                    ^~~~~~~~~~~~~~~~~~~~~~~
        393 |                                                    snd_pcm_period_elapsed,
            |                                                    ~~~~~~~~~~~~~~~~~~~~~~
      
      Add a forward declaration for struct snd_pcm_substrea to allow it to just
      use the correct prototype.
      
      Fixes: 98f2a97f ("[ALSA] Emagic Audiowerk 2 ALSA driver.")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20240213101327.460191-1-arnd@kernel.orgSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      022a13a1
    • Arnd Bergmann's avatar
      ALSA: ctxfi: avoid casting function pointers · aabdedf4
      Arnd Bergmann authored
      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: 8cc72361 ("ALSA: SB X-Fi driver merge")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20240213101303.460008-1-arnd@kernel.orgSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      aabdedf4
  2. 12 Feb, 2024 29 commits
  3. 09 Feb, 2024 3 commits
  4. 04 Feb, 2024 1 commit
  5. 02 Feb, 2024 1 commit
  6. 30 Jan, 2024 4 commits