From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73050C07E96 for ; Thu, 15 Jul 2021 10:32:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55C6760BD3 for ; Thu, 15 Jul 2021 10:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241359AbhGOKfD (ORCPT ); Thu, 15 Jul 2021 06:35:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241350AbhGOKfD (ORCPT ); Thu, 15 Jul 2021 06:35:03 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3684CC061760 for ; Thu, 15 Jul 2021 03:32:09 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id i94so7102430wri.4 for ; Thu, 15 Jul 2021 03:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QQ9uYw60QT52Mb6pwDvwipu2yY8+bwDR1+TUxrl1UKg=; b=wUmdJPHcrUBQXsFk6OQVqkBVLEvFwKaynwMe9+94Zwnofrjs/vvigT28RgKWKS0x1X QqVta5d9JGRFbDeD5vMTECO30aIn30e0g4P+MuWtskgg3+Bd8mJKgpLNDvq9I1XDxfz8 mccDpBwfxXBbl5B70SvH0ZSfYV+/ytfK/ko2040mq6/RgSfRPviHZzcNwgCV7qrUvcE6 q1TkX7/aV2DivCPlcuf6Liu93osMxNISUMzTAEecaiBdF8NiVC6nVVQ//L6Ly4vakmwM UqvEYDmiyOGZtdotfW/Th8oKZBlvjzQWSRjtDxmnC4LeuHpQzWGB5+wzBNBukmeqBzCf yHiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QQ9uYw60QT52Mb6pwDvwipu2yY8+bwDR1+TUxrl1UKg=; b=SExjbQ+p5IxLB1nWDf5BhI7yWnXC83WaWfS0UwEwmp7CfXYE0vWfugdrF6Xc365DEr NvSoURbUK20B0TV0309HFFw3ZOpemN4VTHHaxAbDeLA+oWwU0EumvtX3aT8dcwQfCTJT zIx4R4dvr9KAKVt2ENC+24DWBdFDHtRtBg/yMrVaQ5CKDF7b5sb/6rDruGF+rZ0N7Le6 /ATJ69Y8t66kbwsDWqlRirogHoNg1TMj0vz6RqCRtmAu3m1b0XUt/PoJvWrKZFwfv97d oyG8wrz08+oN6SPvPN9Uxc7PGogx0rLfNOn5H3ddpMeuM34EvktivpVBej1/XScoDzNr sV+g== X-Gm-Message-State: AOAM5320iMh0t//OCBYASCAmiUeSr+cLRqQ2dvrBna/4iNx8QQzYp3gi xDrXaHXTeLbUq/gqHtnwFSy1FxP0y68Ohg== X-Google-Smtp-Source: ABdhPJzbmzr56TMMDysLHgbDl/J9edrHkbunhopnL4Ep1n/ouXkSOU2eeiUZe+h/zHlAE2GwjOyh+Q== X-Received: by 2002:a5d:6992:: with SMTP id g18mr4738344wru.118.1626345127586; Thu, 15 Jul 2021 03:32:07 -0700 (PDT) Received: from [192.168.86.34] (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.googlemail.com with ESMTPSA id o22sm4593073wmc.18.2021.07.15.03.32.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jul 2021 03:32:07 -0700 (PDT) Subject: Re: [PATCH v2 07/16] ASoC: qcom: audioreach: add module configuration command helpers To: Pierre-Louis Bossart , bjorn.andersson@linaro.org, broonie@kernel.org, robh@kernel.org Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, bgoswami@codeaurora.org, lgirdwood@gmail.com, tiwai@suse.de, plai@codeaurora.org, linux-kernel@vger.kernel.org References: <20210714153039.28373-1-srinivas.kandagatla@linaro.org> <20210714153039.28373-8-srinivas.kandagatla@linaro.org> From: Srinivas Kandagatla Message-ID: <5d8eadba-dc58-5f84-93ad-0430de049958@linaro.org> Date: Thu, 15 Jul 2021 11:32:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Pierre, On 14/07/2021 17:48, Pierre-Louis Bossart wrote: > >> +static int audioreach_shmem_set_media_format(struct q6apm_graph *graph, >> + struct audioreach_module *module, >> + int direction, uint32_t rate, >> + uint32_t num_channels, >> + u8 channel_map[PCM_MAX_NUM_CHANNEL], >> + uint16_t bits_per_sample) >> +{ >> + struct apm_module_param_data *param_data; >> + struct payload_media_fmt_pcm *cfg; >> + struct media_format *header; >> + int rc, payload_size; >> + struct gpr_pkt *pkt; >> + void *p; >> + >> + if (num_channels < 0 || num_channels > 2) >> + dev_err(graph->dev, "Error: Invalid channels (%d)!\n", num_channels); > > that doesn't sound good, you flag num_channels as an invalid value but still continue using it. I forgot to run cppcheck after doing make W=1 C=1. It did catch these, will fix all such instances before I send out next version. --srini