From patchwork Sun Jul 26 17:04:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 6866531 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 940C4C05AC for ; Sun, 26 Jul 2015 17:05:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70FBE207C5 for ; Sun, 26 Jul 2015 17:05:25 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 54BB5207A2 for ; Sun, 26 Jul 2015 17:05:24 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D5D19261687; Sun, 26 Jul 2015 19:05:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BA974261501; Sun, 26 Jul 2015 19:05:15 +0200 (CEST) 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 A6360261537; Sun, 26 Jul 2015 19:05:13 +0200 (CEST) Received: from smtp-out-144.synserver.de (smtp-out-144.synserver.de [212.40.185.144]) by alsa0.perex.cz (Postfix) with ESMTP id 7DF8D2606FD for ; Sun, 26 Jul 2015 19:05:06 +0200 (CEST) Received: (qmail 23129 invoked by uid 0); 26 Jul 2015 17:05:05 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 22807 Received: from ppp-188-174-127-204.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [188.174.127.204] by 217.119.54.87 with SMTP; 26 Jul 2015 17:05:05 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Sun, 26 Jul 2015 19:04:58 +0200 Message-Id: <1437930302-2789-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 2.1.4 Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Lars-Peter Clausen Subject: [alsa-devel] [PATCH 1/5] ASoC: dapm: Drop always true checks 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 list_first_entry() always returns non NULL and since the code previously checked that list is not empty it will also be a valid pointer. Furthermore a path has always a sink or a source widget. So both checks are redundant and can be removed. Signed-off-by: Lars-Peter Clausen --- sound/soc/soc-dapm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 7f834a0..10f7c7c 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3485,11 +3485,6 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, sink_p = list_first_entry(&w->sinks, struct snd_soc_dapm_path, list_source); - if (WARN_ON(!source_p || !sink_p) || - WARN_ON(!sink_p->source || !source_p->sink) || - WARN_ON(!source_p->source || !sink_p->sink)) - return -EINVAL; - source = source_p->source->priv; sink = sink_p->sink->priv;