From patchwork Tue Feb 13 10:13:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 200335 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp439928dyb; Tue, 13 Feb 2024 02:14:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUfzD3v6f84+kBwSschyziTr+4ihqpNK2n8eLepUdGLwp+emUUtV15ICJy+2OJCkDoTNu1gHZpZH3oOd5PhGwBX/lHLcQ== X-Google-Smtp-Source: AGHT+IGA5GyM1O2skgEHij+U5KRcSy7vRDdEj7RkfqfJ2NwUjAP/T/JiOmU/5VKe1KK2mcLXR9Rj X-Received: by 2002:ac2:5a01:0:b0:511:9416:7e10 with SMTP id q1-20020ac25a01000000b0051194167e10mr2065381lfn.14.1707819268597; Tue, 13 Feb 2024 02:14:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819268; cv=pass; d=google.com; s=arc-20160816; b=xj3zi1Mg4fNyBmV1j+E9Xgs0K/Ay4evC2sooq75BrQqsIIzE+kYbLdlk5osztZYX8X 1MFdvGfwgRPqRMeOkDs8awZpcrksWrPw+RAViGRvIRMwcD6+cCesvTUbyGubBhlGVeYb aPAYt+cj2Rbl7YN4XyCeNQpRlkGoybNntlX6nzw1LMCPof8dl6oG3kkED9whGFuQQiqf NhcPohZkUJyelvcQKKxDdCKbdfgvpfbqN/Z0ElC6edrcBjmFaaTf1Cr2tDoygThiaj+j jcLoslO292uU4/RDYg35gRiRIq8g4rC2aK6995HbpOg3rkjSXA3zkWDnZrP4Lg3CVjkf vnmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=gX6EQR0Z2M6oDKT9zZxi+ej3TF/XMNxtY72PkZCp0gY=; fh=Ak7CsNJmWrj6/sL/8TNiTzGD3FuwpCPZ7JK/r5QgrV0=; b=fnd2VqKKyWmmuVpnzM60Kz7lMZfCaPNSJ0togimc6H0w9Je/ciefh+4TN0h8/HsvS/ XlJGfJEL67VO8TIQoqoYJszN5MwzrqcyHOf4H2N1PdF//GjoFEHthPD6qtg274KSOp/x OrOh1OeY6vssxuUrLoXPM/gTLxvcI/9dS2x5sXqBU0ZusPXgb/l/+DUM71AiamPJq9xw gExTWYjfqfDHfkhB8F03natvfLc0qcOF4ONDGBpQjo/P+nB0vHFC56JCLYHP7wYeFz+N Z/n4FBpNXTmJ60hXAPtglTalW9mvHSHNurCO4Y/eRIlZmfIEnwG6NtrOV5yTMw6+HYRM KYsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K0yAQdle; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63323-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63323-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCV0PhDf7ZwvTTN6R2iZlEFHJ8OHfntAUEpdhIjaRzBNXbAqjIHrpUTucQhTZvPgAMF2keuVgyTHgKK8Xf6IBbmPkmhjUg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id x1-20020a05640226c100b005619f721cd2si2488930edd.78.2024.02.13.02.14.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:14:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63323-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K0yAQdle; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63323-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63323-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 356D21F220CF for ; Tue, 13 Feb 2024 10:14:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6F7F7286B3; Tue, 13 Feb 2024 10:13:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K0yAQdle" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCC862BB0E; Tue, 13 Feb 2024 10:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819213; cv=none; b=DDvv77hYZ3FSWfDXewmEkRKOrtLyf+V1BZgPcaZ5HARCabyR8L33Xex7ihgzSpWzszeTaXsGjisrwpjgydSVizP6Chu3BazftJz0yw7lwxxgJm1x6H+kQmYfOKKEN+ctcuBXezS5hj8vqq5k4uDOWa8Pm/uc+nVBxvzAluK5Vw4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819213; c=relaxed/simple; bh=3+IG0j3O1LBG7lwMQUhmH60xhIv6owNHQLirTIxa6kk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=CPaoXG8j9aFL22O0Yf/fPhupNBkYa4xrPQvUJ7nXt2GR7hRQX6Vr8j1I50gDGhmnv2Goedovhen6o/3a+g8BMrf5OcbToPv7/b2tMREK4NX1ulUsJNZA/m2O+eW1594mhIpNWygZcUdNUxTsjejmgJHZl4iqsyMIGn+yRHinUKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K0yAQdle; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2CDBC433C7; Tue, 13 Feb 2024 10:13:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707819213; bh=3+IG0j3O1LBG7lwMQUhmH60xhIv6owNHQLirTIxa6kk=; h=From:To:Cc:Subject:Date:From; b=K0yAQdleEJ+O3q3zOzf4XOypaOaV/eEjVm3b3YzNKsgRXtANa8APVm9A10agKVXC0 xXypXSc4MQXAt6rMsWRPRgg/9M0FYksQMoZK9IwhyynJzaYZtNTczewNt3NrJroWeE /wx+mFn+n+i0iFZy49CU5U43qMJpX3gb6wQLh1ErClWVifIMHr6HPCK1DR/XHYDKYA /bhctPo13V4f2xs0nJJNGP21zlj0FRL3qTagmBOPRevP6SaLu+StB9d6Fn8pDEuttY couhC2vlbrwPUnHPBQnPkG74p2lg6eoDhqIOOdzQKpZez00KyCFQJ2bW9jMB5C6Zxj EsVXm0GjGlS4g== From: Arnd Bergmann To: Jaroslav Kysela , Takashi Iwai Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Cedric Bregardis , Jean-Christian Hassler , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] ALSA: aw2: avoid casting function pointers Date: Tue, 13 Feb 2024 11:13:19 +0100 Message-Id: <20240213101327.460191-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790778297379196061 X-GMAIL-MSGID: 1790778297379196061 From: Arnd Bergmann 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: 98f2a97f207a ("[ALSA] Emagic Audiowerk 2 ALSA driver.") Signed-off-by: Arnd Bergmann --- sound/pci/aw2/aw2-saa7146.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/pci/aw2/aw2-saa7146.h b/sound/pci/aw2/aw2-saa7146.h index b5c5a71c0ac3..3a3de56b9b07 100644 --- a/sound/pci/aw2/aw2-saa7146.h +++ b/sound/pci/aw2/aw2-saa7146.h @@ -19,11 +19,12 @@ #define NUM_STREAM_CAPTURE_ANA 0 -typedef void (*snd_aw2_saa7146_it_cb) (void *); +struct snd_pcm_substream; +typedef void (*snd_aw2_saa7146_it_cb) (struct snd_pcm_substream *); struct snd_aw2_saa7146_cb_param { snd_aw2_saa7146_it_cb p_it_callback; - void *p_callback_param; + struct snd_pcm_substream *p_callback_param; }; /* definition of the chip-specific record */