From patchwork Tue May 16 19:50:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp678406vqo; Tue, 16 May 2023 13:17:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61sQPyCd3R0Iz4voL6lFvWsR/W+f2ldUlodr1OuTGfX3+50k5wHgA4VoaZHfuOuLqbIDtF X-Received: by 2002:a05:6a00:1146:b0:643:8496:e41c with SMTP id b6-20020a056a00114600b006438496e41cmr50793192pfm.20.1684268274918; Tue, 16 May 2023 13:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684268274; cv=none; d=google.com; s=arc-20160816; b=Icowz/D7vwSfrd2B5S/zfu40K87HAgMazcJ57Sr+c7fgPqMkRK/0OxrbCqfwtfeL1m fI3CqIH2Xa5n5AHC50mPWbP4BiKqo4HsK/lSuWGwhAAqsyQKfgwTgSiz7whwG2tFeo4x WgeAsjY2UEjOMzBRwIFL/zJQJSels7iKEmYUIQdDnn2gxF75Fk+MLviknflWBa3eKo34 JNuGIRsgehlDHeJpj0nWG8UWOOXg9huk+FvFAyKQVwuOXLk/4N4VDVqoNaM/hpPsG7Bz ELTNwiCz/HHD/p5aq+FQ3hA4Puijqjqt3VcB6aG3r32IYRuSe945oq7l14/KMoiztjtO npSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=peJfNMkBkU+ef1zjxWCOq0SkCaYb533Le1hBO6f2uNM=; b=DJKJPxhV7EwIwpwgqhgyRSyPrKcJuDCHQiolsry5ozvgpzD7DnERFvReK/ubMis212 ulhioLY/X/7zrvgZwLyrAL4Sw+HqzueKi6aZRiYUITUiyZhLF7LGxPKKeMtPWrFyXS2+ YTRCIMiUNfhf2OZ0jDeSwfgsXan6BX5tdPvykVAlWEbnvHwfZYfIarWBnLCsWA8IH5Pd /tvKVcvFtv5YrhS0Ht/bbYf5L7/wxEpY6yTf4272ITIpfRm1gbAuvV9E3VCbK4oX0MFx 2HabGCnQUJ9lFLvTspvfJgfcGzXUslexzJifPP0OBaILD5lRHIkKJBSMpUBEaNQGah4N Jw6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nh1LnlD0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h187-20020a6253c4000000b006489d6fa83fsi16261522pfb.142.2023.05.16.13.17.40; Tue, 16 May 2023 13:17:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nh1LnlD0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbjEPTu4 (ORCPT + 99 others); Tue, 16 May 2023 15:50:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjEPTuz (ORCPT ); Tue, 16 May 2023 15:50:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6715913E for ; Tue, 16 May 2023 12:50:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F0A6262D8A for ; Tue, 16 May 2023 19:50:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 167C8C433D2; Tue, 16 May 2023 19:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684266653; bh=vrJbb+thE3XsnqrA0f75v2in+7O7pevNPGynZ++e5hM=; h=From:To:Cc:Subject:Date:From; b=nh1LnlD0t0THNvDVMhBt7li9Log+fQWxVGvdJw/NtuM/fsAVOhoizufYtKFp70Mv6 OoME9qlmwvFOZfroTn2r4GWypEvnRlAwMgEH/meA+3CNQl5CD9kubIgjl6K+GqRlBF JJCVNjIVvtPOMwOKQ+mHHu7XBX27qnk3gYqKoODkd2tsXwAA5NWSqn5Ya9RSEXCS2f tRKQ1aYIduQQmX9VKVJfy5wxQz0gthaWwe0PgijCmxmMNiT6+9zp4bIYroh/NF/z/R RHbaUT1SsDDr1M9OM0HbRx01n1wFvhmGyVEjiPJlITKOYHhj/buYg6FCbFMO3KlDMt nEog8AHZhFr3Q== From: Arnd Bergmann To: Jaroslav Kysela , Takashi Iwai Cc: Arnd Bergmann , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ALSA: cs46xx: mark snd_cs46xx_download_image as static Date: Tue, 16 May 2023 21:50:41 +0200 Message-Id: <20230516195046.550584-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766083290416759332?= X-GMAIL-MSGID: =?utf-8?q?1766083290416759332?= From: Arnd Bergmann snd_cs46xx_download_image() was originally called from dsp_spos.c, but is now local to cs46xx_lib.c. Mark it as 'static' to avoid a warning about it lacking a declaration, and '__maybe_unused' to avoid a warning about it being unused when CONFIG_SND_CS46XX_NEW_DSP is disabled: sound/pci/cs46xx/cs46xx_lib.c:534:5: error: no previous prototype for 'snd_cs46xx_download_image' Fixes: 89f157d9e6bf ("[ALSA] cs46xx - Fix PM resume") Signed-off-by: Arnd Bergmann --- sound/pci/cs46xx/cs46xx_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 62f45847b351..7d882b33d45e 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -531,7 +531,7 @@ static int load_firmware(struct snd_cs46xx *chip) return err; } -int snd_cs46xx_download_image(struct snd_cs46xx *chip) +static __maybe_unused int snd_cs46xx_download_image(struct snd_cs46xx *chip) { int idx, err; unsigned int offset = 0; From patchwork Tue May 16 19:50:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp677341vqo; Tue, 16 May 2023 13:15:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5qDlnrF1AkrLsf3Rg6vCNLfjTHNm4WYR55Hy18WIjIsjPuib0lO4bKPW0YaDzUMD+8uFN3 X-Received: by 2002:a17:903:41c2:b0:1a9:498a:1da2 with SMTP id u2-20020a17090341c200b001a9498a1da2mr47102675ple.56.1684268149238; Tue, 16 May 2023 13:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684268149; cv=none; d=google.com; s=arc-20160816; b=AuIaT6LPQEdo+MdT5LTdmn2mhNcImPMaSZW+hpR1mePxESdZMBGU436BncHe5l9BUY VU00XtiP6ol4gb+QJyb8xA6BkGoG1KhDqldcJjxgiN+SwGFYYhdGIbhosg3ZaGo5twCN tBSlm5CgfsKeuEq2P9+9MrRXI9xZQQxw/WXCctYvwtiOXYP5aklwhQY6WTz1EbRZBjPO ajncCWuj9ZK1d2oPMLPq+q5Y38raiKExui/oIYoVOT8I2o1EmZesOaFEEtBUYz4aa8RI tTgk8kLwl7z56c03EVgjTG9eXJy2UwUIcZsQTsCCKzoClYowQCIXTgcEQ7ibVAZJpjZ/ Z1WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qieSzapmqeulYvjpUTO827if4KiEBTGKjqpCWmVjw70=; b=S8ZqR679XbPPk1yq7/1s9LN589ajBesjdCQVgoTW8AcIEZCQ40aS2BeIyp/dxIqmq+ fz87riRs4NOVStT3Z0ewHPAFO5+ECys5mwdd1B0dfu1mjJyqc1PvG8+tdlYhQPqphoH5 R5NAuXdHKrWQD+Sopjyz56C/p9saGvvgOIZF023KUtNhe8V8omBiveEmVLXZm5fGdmth RY53GNEcKjVgrb4T3Nm6Erws5mEfFgqAJbm1QDrmToRxdC5cGQCyJb87ThwmPrd2W3VD YXkwMpdXnvamDHyuiP/hOGtXVfteqjjoCkEXiL+zmpRVsGnwedf7SgzKoLckv8UHyNTz RaDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m1IpgRBB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a656a8a000000b00528de9650b9si19075691pgu.696.2023.05.16.13.15.15; Tue, 16 May 2023 13:15:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m1IpgRBB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbjEPTvD (ORCPT + 99 others); Tue, 16 May 2023 15:51:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbjEPTvC (ORCPT ); Tue, 16 May 2023 15:51:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F2E7421D for ; Tue, 16 May 2023 12:51:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 98BD863E87 for ; Tue, 16 May 2023 19:51:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD352C4339E; Tue, 16 May 2023 19:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684266660; bh=rGDLa8XkgnE/YkvzsK/nYCgrTLKkwXQsOq22+QTAt04=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m1IpgRBBLrcl0WFodQf64TNhrUk59kE3r4bNQjvPn87giLfVs19v4wJGZfYcT3C0S qr/twKpbjzTxb3VqgZiwZNHaf1oUEoRgMHtW1cRZORyOtS4ChBGAc+h6jG5IFptuRB e3/UKJk74C5zz+CfQCPZW4oXXHftpPkahKs53p+0KmVYcT+ZwBEWySlrQba/GWyHzC 12PBOkJYLi8u8hEivmgWd/Dunf4/9CCazNePcOvvNv9RdqzUdtk+OTBQ6LOin1txIU DXgKMz6CS/nntkXuMiQ+WXLzFM2DxC5C1AoE5PZxAjQLPU3zHaBO9D9Pmx2KeVDPHd 0OddKsQDbL2sQ== From: Arnd Bergmann To: Jaroslav Kysela , Takashi Iwai Cc: Arnd Bergmann , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ALSA: oss: avoid missing-prototype warnings Date: Tue, 16 May 2023 21:50:42 +0200 Message-Id: <20230516195046.550584-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230516195046.550584-1-arnd@kernel.org> References: <20230516195046.550584-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766083158352899752?= X-GMAIL-MSGID: =?utf-8?q?1766083158352899752?= From: Arnd Bergmann Two functions are defined and used in pcm_oss.c but also optionally used from io.c, with an optional prototype. If CONFIG_SND_PCM_OSS_PLUGINS is disabled, this causes a warning as the functions are not static and have no prototype: sound/core/oss/pcm_oss.c:1235:19: error: no previous prototype for 'snd_pcm_oss_write3' [-Werror=missing-prototypes] sound/core/oss/pcm_oss.c:1266:19: error: no previous prototype for 'snd_pcm_oss_read3' [-Werror=missing-prototypes] Avoid this by making the prototypes unconditional. Signed-off-by: Arnd Bergmann --- sound/core/oss/pcm_plugin.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/core/oss/pcm_plugin.h b/sound/core/oss/pcm_plugin.h index 46e273bd4a78..50a6b50f5db4 100644 --- a/sound/core/oss/pcm_plugin.h +++ b/sound/core/oss/pcm_plugin.h @@ -141,6 +141,14 @@ int snd_pcm_area_copy(const struct snd_pcm_channel_area *src_channel, void *snd_pcm_plug_buf_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t size); void snd_pcm_plug_buf_unlock(struct snd_pcm_substream *plug, void *ptr); +#else + +static inline snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t drv_size) { return drv_size; } +static inline snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t clt_size) { return clt_size; } +static inline int snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) { return format; } + +#endif + snd_pcm_sframes_t snd_pcm_oss_write3(struct snd_pcm_substream *substream, const char *ptr, snd_pcm_uframes_t size, int in_kernel); @@ -151,14 +159,6 @@ snd_pcm_sframes_t snd_pcm_oss_writev3(struct snd_pcm_substream *substream, snd_pcm_sframes_t snd_pcm_oss_readv3(struct snd_pcm_substream *substream, void **bufs, snd_pcm_uframes_t frames); -#else - -static inline snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t drv_size) { return drv_size; } -static inline snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *handle, snd_pcm_uframes_t clt_size) { return clt_size; } -static inline int snd_pcm_plug_slave_format(int format, const struct snd_mask *format_mask) { return format; } - -#endif - #ifdef PLUGIN_DEBUG #define pdprintf(fmt, args...) printk(KERN_DEBUG "plugin: " fmt, ##args) #else