From patchwork Mon Feb 26 11:17:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 129624 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp83532lja; Mon, 26 Feb 2018 03:17:29 -0800 (PST) X-Google-Smtp-Source: AH8x226D3Cf6y1D3zuc0kjI5zFeAo3bB9FpWDuJ5N9P1pK+RBPIAFlJJYZCR9vacHc/WB2EqgPFu X-Received: by 10.223.147.36 with SMTP id 33mr8317832wro.133.1519643849039; Mon, 26 Feb 2018 03:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519643849; cv=none; d=google.com; s=arc-20160816; b=IVxPgbWj6P/n3CW99kXLgTGhaf6oz9U10EE6VLi8weV2QCVlCndiXxa3Q06mCTIxpz QJg9MVDEfoUB5vxaFwK4NXjBKs3GkvNSdbwRi/24CroE9Po0c4EQ6XtLNyoFOXR9WclW gXw8/D5RBCIc+lYpvx8ecpQjApl3d9Ud8BSUWCEviBi0okk3J/lreRmbXeacB9cvJ78Y aItruxQWsssfq+BfHlrWl9zt1klOC8XoasHtM93SKzumzNgFJtWcxqn7zQ3h2rqaNjka bR+G32jp3SsqRMwW5t/1O/azM/db8XXURHGWuO3YTfLKjF+5iCxpbZpbJlGscJS+w+nj 3PFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=BFdy+4GfdRJek/UehKOxwYswqDhAL9CgibLGpISalv0=; b=W/WpaA18kL5cgRGldZvav4sKphq5WvZjMlOARKD73uiKbS9F1v4Vc5qnEl3CeCrBXg +s0n2GQW4LvMHVivv7vBnOHBVfyo3t1aC/VNi4ux5ZKTDDVJ7Mva/yD20qMbgECTLovk yNKuP0E8thrwX2WS7tSm8e3lDBZfA1YHH/wRPfwtJh5UyYbsjXYV2+7xkNqbNko1oCM+ OyYaBRjQP7EJ9AaUo9iVSbzOp0f7y5hzuTycqKok8uBO+pMBSujPfHuwVzxsn8P1nW1v 0ktEo6M/l1RK3aOFlhWRWMyX+WWHe/PZROKd8uGSlKRgwpvjBppXiSAOrSgExN2rwLhy IkdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=mICYKY7m; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id j1si1956014wrc.494.2018.02.26.03.17.28; Mon, 26 Feb 2018 03:17:29 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=mICYKY7m; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id A3FD8267A52; Mon, 26 Feb 2018 12:17:21 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 91E71267A53; Mon, 26 Feb 2018 12:17:18 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id DEF1C267990 for ; Mon, 26 Feb 2018 12:17:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=8Y+x85IWnfDuYJtMX2qql5Hayk89HlfP97HNMBXV1LY=; b=mICYKY7mWTsp yqvS1WlrWZ1LRfelP2IHO60/rng0XdyZkfitFXYmZ8mVszNxLb5iGmaalqAfeYFnjXfk5IgCFnDih lXU5cpIQm4ECP1zZsz4pTm3p2xPlrM3DrBpsoswL8sDJIsVE/mSSgc5R7QoiEXvExkyM31F2Dk9+q XRATs=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eqGmP-0007v8-QD; Mon, 26 Feb 2018 11:17:13 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1eqGmP-0005Pg-BS; Mon, 26 Feb 2018 11:17:13 +0000 From: Mark Brown To: Fabio Estevam In-Reply-To: <1519326142-26421-2-git-send-email-festevam@gmail.com> Message-Id: Date: Mon, 26 Feb 2018 11:17:13 +0000 Cc: alsa-devel@alsa-project.org, broonie@kernel.org, lars@metafoo.de Subject: [alsa-devel] Applied "ASoC: soc-generic-dmaengine-pcm: Fix sparse warnings" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: soc-generic-dmaengine-pcm: Fix sparse warnings has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 7ed310bd51bec0b440a551fc4da1993c7f6cd231 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Thu, 22 Feb 2018 16:02:22 -0300 Subject: [PATCH] ASoC: soc-generic-dmaengine-pcm: Fix sparse warnings Currently the following sparse warnings are observed: sound/soc/soc-generic-dmaengine-pcm.c:185:34: warning: restricted snd_pcm_format_t degrades to integer sound/soc/soc-generic-dmaengine-pcm.c:186:66: warning: incorrect type in argument 1 (different base types) sound/soc/soc-generic-dmaengine-pcm.c:186:66: expected restricted snd_pcm_format_t [usertype] format sound/soc/soc-generic-dmaengine-pcm.c:186:66: got int [signed] [assigned] i Fix it by changing the loop variable to be of 'snd_pcm_format_t'. Also introduce a SNDRV_PCM_FORMAT_FIRST label, which corresponds to the first member (index 0) of the snd_pcm_format_t formats. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown --- include/uapi/sound/asound.h | 1 + sound/soc/soc-generic-dmaengine-pcm.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.16.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index 07d61583fd02..ed0a120d4f08 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -242,6 +242,7 @@ typedef int __bitwise snd_pcm_format_t; #define SNDRV_PCM_FORMAT_DSD_U16_BE ((__force snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */ #define SNDRV_PCM_FORMAT_DSD_U32_BE ((__force snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */ #define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE +#define SNDRV_PCM_FORMAT_FIRST SNDRV_PCM_FORMAT_S8 #ifdef SNDRV_LITTLE_ENDIAN #define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 32ea16d062b1..785f25ede3e5 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -132,7 +132,8 @@ static int dmaengine_pcm_set_runtime_hwparams(struct snd_pcm_substream *substrea u32 addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); - int i, ret; + snd_pcm_format_t i; + int ret; if (pcm->config && pcm->config->pcm_hardware) return snd_soc_set_runtime_hwparams(substream, @@ -182,7 +183,7 @@ static int dmaengine_pcm_set_runtime_hwparams(struct snd_pcm_substream *substrea * default assumption is that it supports 1, 2 and 4 bytes * widths. */ - for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) { + for (i = SNDRV_PCM_FORMAT_FIRST; i <= SNDRV_PCM_FORMAT_LAST; i++) { int bits = snd_pcm_format_physical_width(i); /*