From patchwork Sun Feb 11 21:53:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10211613 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 813F360329 for ; Sun, 11 Feb 2018 22:02:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EC8C28A4B for ; Sun, 11 Feb 2018 22:02:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6221228A54; Sun, 11 Feb 2018 22:02:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E97F28714 for ; Sun, 11 Feb 2018 22:02:49 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id ABA98267079; Sun, 11 Feb 2018 22:53:54 +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 13FBF26707A; Sun, 11 Feb 2018 22:53:54 +0100 (CET) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by alsa0.perex.cz (Postfix) with ESMTP id 6341D266C0E for ; Sun, 11 Feb 2018 22:53:51 +0100 (CET) Received: by mail-qk0-f195.google.com with SMTP id s198so239676qke.5 for ; Sun, 11 Feb 2018 13:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=NT6qhckNUn8NuUArE+37foQ6jjDRErxpFsws3ihZvRI=; b=lICVCAOKua5QHaSLdRo9pfbK/4S25X5eKYtOffjvL2J0vm5TC+E40zinjniYbCMsMD ivWt4Fn7pdIfK3kWfrcvmfdJWqiBbHOvG5zgkI42TdNgAAkzow8luUWGyRqCkEdDqRvD Lnbp64ra0L1aYElh4aONn5EgfvnNHTUnK/MapWB4onLOuY5xH1JLMH8GhCIFwe90Aui7 95VHgHJfw/2vuq+9CUL/AalEIrlGA16a4lx0WIIZfFNTwQPuKT2s6XtB1MZRGnaTPVzl RanKHhVtJNDj6TS4jHWBC/6JsvhQponGfb+u+W5vVsw5xePTFBhsXBzm+S4W3LDWGyYk fcPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=NT6qhckNUn8NuUArE+37foQ6jjDRErxpFsws3ihZvRI=; b=b0YLlylcfBNIdbexWhyH8aCJ4fCgdyOZi1/T6ukRUyK8X7sFwRLY9gOYZqh3HYxh2C IfrN5SSfWKHygsdsZDveNmywBj01cDnSJ159E9HMKqjA0MTRVluLsJ0HOulz/ut3OB2d K9n9g+QNJNWaPY0WJ4zJEVNXv/ACArc99/QZLg+UCNklxZI2uHSE0Fivq3iXgnMBXVAE rvScO7W5ZLrg5i8ebGJrbOgzhleLR0SeFiOy8Bd5O21BSWhhytsaFE6Cj/zzzDy8dptB bjD/BoxpiHPfujpiWg0u4gufAXnkv17HQ7h7WlWE16IXXaFzm+5dt/zrG8hLkG2a1uaY iq7g== X-Gm-Message-State: APf1xPAbSduKb/ErmMBWZ3914ZvFt2ruHdV2X4A6v4JY654ch3Eoh7Gc nW/O04V7nHZe1kaLwX86Jf0= X-Google-Smtp-Source: AH8x226T1vyoJmPx06M6gQ9O40JZyLeRab/CPBoytbkrUqds5gkrs2c0X2uBEMHejaNsq+2qH7vDOg== X-Received: by 10.55.139.132 with SMTP id n126mr14631330qkd.299.1518386029823; Sun, 11 Feb 2018 13:53:49 -0800 (PST) Received: from localhost.localdomain ([187.180.181.130]) by smtp.gmail.com with ESMTPSA id g57sm5683214qtk.54.2018.02.11.13.53.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 11 Feb 2018 13:53:49 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Date: Sun, 11 Feb 2018 19:53:18 -0200 Message-Id: <1518386001-4322-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Cc: nicoleotsuka@gmail.com, Fabio Estevam , alsa-devel@alsa-project.org, timur@tabi.org Subject: [alsa-devel] [PATCH 1/4] ASoC: fsl-asoc-card: Use 'snd_pcm_format_t' type when appropriate 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam A better suited type for 'sample_format' and 'asrc_format' is 'snd_pcm_format_t'. Change the type so that the following build warnings with W=1 are gone: sound/soc/fsl/fsl-asoc-card.c:153:29: warning: incorrect type in assignment (different base types) sound/soc/fsl/fsl-asoc-card.c:153:29: expected unsigned int [unsigned] [usertype] sample_format sound/soc/fsl/fsl-asoc-card.c:153:29: got restricted snd_pcm_format_t sound/soc/fsl/fsl-asoc-card.c:258:44: warning: restricted snd_pcm_format_t degrades to integer sound/soc/fsl/fsl-asoc-card.c:525:29: warning: incorrect type in assignment (different base types) sound/soc/fsl/fsl-asoc-card.c:525:29: expected unsigned int [unsigned] [usertype] sample_format sound/soc/fsl/fsl-asoc-card.c:525:29: got restricted snd_pcm_format_t [usertype] sound/soc/fsl/fsl-asoc-card.c:680:43: warning: incorrect type in assignment (different base types) sound/soc/fsl/fsl-asoc-card.c:680:43: expected unsigned int [unsigned] [usertype] asrc_format sound/soc/fsl/fsl-asoc-card.c:680:43: got restricted snd_pcm_format_t [usertype] sound/soc/fsl/fsl-asoc-card.c:682:43: warning: incorrect type in assignment (different base types) sound/soc/fsl/fsl-asoc-card.c:682:43: expected unsigned int [unsigned] [usertype] asrc_format sound/soc/fsl/fsl-asoc-card.c:682:43: got restricted snd_pcm_format_t [usertype] Signed-off-by: Fabio Estevam --- sound/soc/fsl/fsl-asoc-card.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 989be51..4a6750a 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -91,9 +91,9 @@ struct fsl_asoc_card_priv { struct cpu_priv cpu_priv; struct snd_soc_card card; u32 sample_rate; - u32 sample_format; + snd_pcm_format_t sample_format; u32 asrc_rate; - u32 asrc_format; + snd_pcm_format_t asrc_format; u32 dai_fmt; char name[32]; }; @@ -199,7 +199,7 @@ static int be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, mask = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); snd_mask_none(mask); - snd_mask_set(mask, priv->asrc_format); + snd_mask_set(mask, (__force int)priv->asrc_format); return 0; }