Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2952244rdb; Tue, 13 Feb 2024 02:14:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWVxRJuy3KgZC3bCpLh1bawO7GAVhgx8DHqApNpJBqCuo3mMPC0h5Q+p2h505MWVcrKSFtpv7duP+1Ymh6oal/IENJcbDXah4UjEv1oiA== X-Google-Smtp-Source: AGHT+IEB8CNyZsUNr614Q92Ua7RAXgacBrHfYuVV3q7bpt13+uXF5KxUUmY6y3P0b8VYYxcKOe8c X-Received: by 2002:ac8:7fca:0:b0:42c:766f:606d with SMTP id b10-20020ac87fca000000b0042c766f606dmr7449270qtk.57.1707819258923; Tue, 13 Feb 2024 02:14:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819258; cv=pass; d=google.com; s=arc-20160816; b=gqWCs6PRA8EDQ67MSEGA6iubMpha1y1u2lSIrHfgnwawRoiz2lFoF2Ask7UNCMNvxV jy7ZsyNsrbUl/fVUd8Vh5Sv30ohlVUfA0VxMaMPA+ZNabihV00CHQgoBIJVgbF0CPIs3 JTGwmFweTTmPOt4eZwr27aH/l81gEQSLP5D7w/nZpcH3hL4AavawUfou+JhNWGOX0cx8 mfNMmW8Rnmx47AkD8hvKTpVubjhnPzyZyFqPuNHhNuvwTUGt7BUDcOq1OKyKqCTyHtP5 acq6M1vibfpfTipo6GR9uRnURxYL+Ak87OAfFZ6PygXTGg2mJWLF9Dpipy6asM+VR/M2 nOzA== 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=oqbP2yuwuijMxLBGCRKq+K0739nmhO+/LY2Syil+pig=; b=o5VjmEX27SnV65lSqg+59V3i8jDYUuGlozGvahcua2vNn0rn9zk/o8gD5TRIeR88G0 HtLxNBcEmbDnHWXDe6UrQZah1WrlV9P7ssqviO8Ewhi5MOfq7yRPvvKgFgLxS8+dMe9/ A34YJrbgrmcArWwh3aRRKN8pc69ZPJaAsoXME2NWrTUZFSNeMKtHKkL6WQZ40Vz2u7KX yVtGPSrNVyx6/20KV01mOYiUQf3TojoyIj2DXtgZjTtgQ1UjReOWU3Mr7+twbMp62D7J ruCaB72vxWsTZeCUi+SoDO6z7d02gR6/ceVdnuk9Iw/DTY1KRGGjIbhzLMIGeyYl2JKD 2Rpw==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWT14YlpTUTavdUVxC4J5ngi5ofnuYE15WvYkTpy3Qukug+2UixN3iEkT4AiNn1UU1VmDhN3mPiyE6gRs/iIwxACPhfgWuojNXHXKp2OA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b21-20020ac85bd5000000b0042c4483beacsi2603840qtb.545.2024.02.13.02.14.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:14:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63323-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AB1661C2179B for ; Tue, 13 Feb 2024 10:14:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0A3023750; Tue, 13 Feb 2024 10:13:34 +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 Content-Transfer-Encoding: 8bit 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 */ -- 2.39.2