From patchwork Tue Jan 29 21:48:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10787281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6239314E1 for ; Tue, 29 Jan 2019 21:50:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52BE32DB24 for ; Tue, 29 Jan 2019 21:50:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4768B2DB32; Tue, 29 Jan 2019 21:50:38 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham 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 A2FCC2DB24 for ; Tue, 29 Jan 2019 21:50:37 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4D8162674EF; Tue, 29 Jan 2019 22:50:36 +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 E82C4267595; Tue, 29 Jan 2019 22:50:34 +0100 (CET) Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by alsa0.perex.cz (Postfix) with ESMTP id 2FB3F2674B9 for ; Tue, 29 Jan 2019 22:50:32 +0100 (CET) Received: by mail-ed1-f65.google.com with SMTP id a20so17298796edc.8 for ; Tue, 29 Jan 2019 13:50:32 -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:mime-version :content-transfer-encoding; bh=oTM3oUocaEUpdR4dp3v/pgr3uNhYbKTQi55NFUqe5zU=; b=cE65DjaL6EPvl4DbkvbH5GmRrfD1/QYSG640FFBK0AoFnr9YWcggrHr6tVC/L+SeRk JwbT6JnJQFu1mnoCvLrMVsr1zTQlAgPSZEgEj2CzaClUorqsxL4yvbeSvFk46RB85zO9 qSUYCsoc1S4ea6mRehf3Og0A0b8APAm4CNM+PNrNaPe64PQW/T6AjcpEmijAfaoaLKrg GB64LbwP6Ryi+WJLkTuhuZYBqh0tICN7ewGilfb3h+7VWFeSytB+RyMiwiDreo0y9eaU sdGGjoAmCftTtl538tAyJyNVUDmxewswSi0Gi7l80gD9EXHPQk+/lU55bGU4ou5uYCHy 4gbg== 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:mime-version :content-transfer-encoding; bh=oTM3oUocaEUpdR4dp3v/pgr3uNhYbKTQi55NFUqe5zU=; b=QRqfM/TnMsQWA6HvELkVhBnj//oTAJAtwmUVUQdAAQ5yymhDCg5mwSe9TH5quLSbBm dc59Fix3e8fO74wqtQpx/qXnPsPOw4/5QV3IW64bIeaj+rpfR/yVFU0ZUgpGzIFtAWnh PwvHI8JejUF8kqsp8pLnZA/XgqLJG8fgpKHpMNws+ROpMDcx9LodieLZNpbfsRn8YSId rJ6GsNEJQHq+LgmigFOFgGhIFh9A7ZKRivqBT9CTKylpb/CTt3YALVHbWcf2Lcqw+AAf npKx9bQav8+Yt5ipGWTS4Y1uhEQCqfNUKQi2vFsrawUn2wEql4Zk1WVDfk0FQIXiqbmP Uk8g== X-Gm-Message-State: AJcUukchTKXnXrvCjyfISoNayBa4mFL6tUiwxTyByjqLrnQKpxEdm8ai 0CZX2OFrHI83b/amI6MtiPSxaq5AUNU= X-Google-Smtp-Source: ALg8bN4nSvD3wGtHh2B8Uyzv6VdaECDjw2K6jfOSXmV2+47brbkl4NsfAKOp0r9tX1l3Esq5iqQVvw== X-Received: by 2002:a50:d643:: with SMTP id c3mr26147122edj.178.1548798632272; Tue, 29 Jan 2019 13:50:32 -0800 (PST) Received: from localhost.localdomain ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id p21sm6660edr.67.2019.01.29.13.50.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 13:50:31 -0800 (PST) From: Nathan Chancellor To: Mark Brown , Liam Girdwood , Srinivas Kandagatla Date: Tue, 29 Jan 2019 14:48:47 -0700 Message-Id: <20190129214847.6341-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Patchwork-Bot: notify Cc: Nathan Chancellor , Vinod Koul , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] wcd9335: Remove unnecessary null checks in wcd9335_set_channel_map 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Clang warns: sound/soc/codecs/wcd9335.c:2004:11: warning: address of array 'wcd->rx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion] if (wcd->rx_chs) { ~~ ~~~~~^~~~~~ sound/soc/codecs/wcd9335.c:2012:11: warning: address of array 'wcd->tx_chs' will always evaluate to 'true' [-Wpointer-bool-conversion] if (wcd->tx_chs) { ~~ ~~~~~^~~~~~ 2 warnings generated. Fixes: 20aedafdf492 ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Nathan Chancellor Acked-by: Srinivas Kandagatla --- sound/soc/codecs/wcd9335.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 3878187bb512..981f88a5f615 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -2001,20 +2001,16 @@ static int wcd9335_set_channel_map(struct snd_soc_dai *dai, return -EINVAL; } - if (wcd->rx_chs) { - wcd->num_rx_port = rx_num; - for (i = 0; i < rx_num; i++) { - wcd->rx_chs[i].ch_num = rx_slot[i]; - INIT_LIST_HEAD(&wcd->rx_chs[i].list); - } + wcd->num_rx_port = rx_num; + for (i = 0; i < rx_num; i++) { + wcd->rx_chs[i].ch_num = rx_slot[i]; + INIT_LIST_HEAD(&wcd->rx_chs[i].list); } - if (wcd->tx_chs) { - wcd->num_tx_port = tx_num; - for (i = 0; i < tx_num; i++) { - wcd->tx_chs[i].ch_num = tx_slot[i]; - INIT_LIST_HEAD(&wcd->tx_chs[i].list); - } + wcd->num_tx_port = tx_num; + for (i = 0; i < tx_num; i++) { + wcd->tx_chs[i].ch_num = tx_slot[i]; + INIT_LIST_HEAD(&wcd->tx_chs[i].list); } return 0;