From patchwork Mon Jul 31 21:37:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 13335502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5E0F2C04A94 for ; Mon, 31 Jul 2023 21:40:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8AF70846; Mon, 31 Jul 2023 23:40:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8AF70846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690839650; bh=bx1kbEvqfdBzjp5ne8h2vYYEwMySusNwUEtHoqCIXbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=bb/g5C6vDm+9E69S+30jvrx4mIIMj/E3/g2H774ctE+WxFZ6ALuJuHGIFuSBLlZHV QrXcXkhF2wbtHFyXAuXz7CC1n+c2Q1VLpo26cmsMzUN6cuTqpLEvBAcvNlwCg7sUMs eEYyvHpva8l0IwfqfjKtgkzHQB6AAE6WKcyjLziw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id F35BFF805C4; Mon, 31 Jul 2023 23:38:35 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 0B54BF805BD; Mon, 31 Jul 2023 23:38:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CDFF9F8057B; Mon, 31 Jul 2023 23:38:21 +0200 (CEST) Received: from mgamail.intel.com (unknown [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B5908F80544 for ; Mon, 31 Jul 2023 23:38:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B5908F80544 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Bw1qGuCn DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690839492; x=1722375492; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bx1kbEvqfdBzjp5ne8h2vYYEwMySusNwUEtHoqCIXbg=; b=Bw1qGuCnJVZO9oYYwziOOiejrI4HaNtoJmAWIzJq57eirS+s/Yy1PToi /xPzM6tEok+e4Tnu3YBzj6ot2bUYy/OZH5qiqEOQfQw2pc0mu2XV9ziAm KGyT3Tiet1jGqtsik7xWGi8vzLHMvYfX6s/586wbUfwcDc1etUZRI5nz+ hK/Ci/xBeToLfORIOVhnsEnILarUqa/0LbXZ6jCUvdCMUbhiDJHUUR+Y9 Khy3syUAOCIygqS+mSHWuzinXA+d2S5s2TTR3LoFm/P06lmkckRE4Wjv6 c7IIKJ3OetaSDmWEr6e8B+swcMCorTa2ybFjEBzRdBKD8go+bbDS6JOrf Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="366604112" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="366604112" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:38:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="793880050" X-IronPort-AV: E=Sophos;i="6.01,245,1684825200"; d="scan'208";a="793880050" Received: from youngnic-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.209.180.66]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 14:38:07 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, Pierre-Louis Bossart , Rander Wang , Daniel Baluta , Yaochun Hung Subject: [PATCH 4/8] ASoC: SOF: imx: remove error checks on NULL ipc Date: Mon, 31 Jul 2023 16:37:44 -0500 Message-Id: <20230731213748.440285-5-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731213748.440285-1-pierre-louis.bossart@linux.intel.com> References: <20230731213748.440285-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Message-ID-Hash: AL4KUUL5YRQOAV5YUZISYY57W5GX2V6D X-Message-ID-Hash: AL4KUUL5YRQOAV5YUZISYY57W5GX2V6D X-MailFrom: pierre-louis.bossart@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: <> List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: imx_dsp_get_data() can return NULL, but the value is not checked before being usd, leading to static analysis warnings. sound/soc/sof/imx/imx8.c:85:32: error: dereference of NULL ‘0’ [CWE-476] [-Werror=analyzer-null-dereference] 85 | spin_lock_irqsave(&priv->sdev->ipc_lock, flags); | ~~~~^~~~~~ It appears this is not really a possible problem, so remove those checks. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Reviewed-by: Yaochun Hung --- include/linux/firmware/imx/dsp.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/linux/firmware/imx/dsp.h b/include/linux/firmware/imx/dsp.h index 4f7895a3b73c..1f176a2683fe 100644 --- a/include/linux/firmware/imx/dsp.h +++ b/include/linux/firmware/imx/dsp.h @@ -37,17 +37,11 @@ struct imx_dsp_ipc { static inline void imx_dsp_set_data(struct imx_dsp_ipc *ipc, void *data) { - if (!ipc) - return; - ipc->private_data = data; } static inline void *imx_dsp_get_data(struct imx_dsp_ipc *ipc) { - if (!ipc) - return NULL; - return ipc->private_data; }