From patchwork Mon Dec 11 12:13:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 121388 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2713035qgn; Mon, 11 Dec 2017 04:14:44 -0800 (PST) X-Google-Smtp-Source: ACJfBouxlDMMcpmYpTWsFY462S9CRNGuaUQXtPAcJiv8zyIW/NI4F7IYJ6zXhETyNOMlVfynIvfo X-Received: by 10.28.138.142 with SMTP id m136mr686213wmd.40.1512994484065; Mon, 11 Dec 2017 04:14:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512994484; cv=none; d=google.com; s=arc-20160816; b=e9cw84m0uilo6J5taux71ptJxXvgHFmkDN7OHyI5cT2OFzOnuVFIc4+9dIIW/4s1ZN GYv2+08cnzOvHr2KtQ7UGNQVqpFWWpe/PEyW9TaZOnlkmNkKKoCuo8RPV+KCZThmoqLY TlJHDIOpWSslwg5hBQ+19f/KFniBY88IQjVXVZUP6B+LUGwOmjyStF1lh6hiORtnjv4S GZIeyubb4BEV/9r55MOdtAesYqWK6nXRXmIFjE8BvJanC6V3zi2Klf543yepJ1qBzSTz z2MgRuot1jqsHA4TWJU+ssHsDimKB7DsSNoXOObfFDmRVFfapYDfqr8JGuLy0ZGHckB6 VQIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=ylPyhRtHwBIG0JkeHodquVF5SY66c57R0nq7g5CKaA0=; b=PGQ8g4yUQ71k4byNECNDO6VZTgLDlrLsCbnSJViIPAoNLxmOjMXo3DbidUONP+ZKjM aUxH4eYU2xP0HPmwYztyrNA/H5bhYUkMP7EwV2IJ9LAj5uYoNAKhTJqDw19X3O4L2iFD 2lmfXs5/P4w3DlzXjQfTqVLIDVLLA2macJS7w01CbG+l5+FG4V/I7aqPzFFzSdOq5hFf m5BXa4sTi9xVpaH+s/bbpuzGwIrljW30FBIuScvbxrITgHpk9YHcfxOJ/NAgPd5GL+xM lVsVFkNPRi9JJLyZqVsPfRdqn+Vi4iGjvU74F3vu3dyetP3ZXIz2haYyhB/G9Ttcz1/o mE5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lE8V+GHv; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id v7si10731735wrf.198.2017.12.11.04.14.42; Mon, 11 Dec 2017 04:14:44 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=lE8V+GHv; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3DC60267591; Mon, 11 Dec 2017 13:14:30 +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 D2B602675E0; Mon, 11 Dec 2017 13:14:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 5136F267591 for ; Mon, 11 Dec 2017 13:14:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=CLlhpH/Wi5BoDSy2BoR5LRF8Z61RQY+oriWBuHfjAy8=; b=lE8V+GHvXNjf fzmB9GEy3kfmYTKWoIduwORvASk6XojJKczCVFNvTRR0EbMGVkliseRry39ZXmqCnOwa7wwv21Vg+ /xeXcJnI0XMQHGn6pQ7BmYx9vSa7GaCrGcKD/K9XAq5SnQ0BUrq3sFaY9rJy6qj2eSx986eC5wED0 na8jo=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eOMxw-0002Jw-8i; Mon, 11 Dec 2017 12:13:48 +0000 Received: from broonie by debutante with local (Exim 4.90_RC3) (envelope-from ) id 1eOMxv-0004cf-Qa; Mon, 11 Dec 2017 12:13:47 +0000 From: Mark Brown To: Dan Carpenter In-Reply-To: <20171208115425.rqclgmhcph5gn47j@mwanda> Message-Id: Date: Mon, 11 Dec 2017 12:13:47 +0000 Cc: alsa-devel@alsa-project.org, Jani Nikula , Sriram Periyasamy , Guneshwor Singh , Liam Girdwood , Takashi Iwai , Vinod Koul , kernel-janitors@vger.kernel.org, Mark Brown , Pankaj Bharadiya , Senthilnathan Veppur , Andy Shevchenko , "Subhransu S. Prusty" Subject: [alsa-devel] Applied "ASoC: Intel: Skylake: Re-order some code to silence a warning" to the asoc tree 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 The patch ASoC: Intel: Skylake: Re-order some code to silence a warning has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 87684d338a22d15e47b16ee68f569d74ad1d076e Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 8 Dec 2017 14:54:25 +0300 Subject: [PATCH] ASoC: Intel: Skylake: Re-order some code to silence a warning I get a Smatch warning here: sound/soc/intel/skylake/skl-nhlt.c:335 skl_get_ssp_clks() error: testing array offset 'j' after use. The code is harmless, but the checker is right that we should swap these two conditions so we verify that the offset is within bounds before we use it. Signed-off-by: Dan Carpenter Reviewed-by: Sriram Periyasamy Acked-By: Vinod Koul Signed-off-by: Mark Brown --- sound/soc/intel/skylake/skl-nhlt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.15.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c index ca5dc2be7b68..bde7f40f29f5 100644 --- a/sound/soc/intel/skylake/skl-nhlt.c +++ b/sound/soc/intel/skylake/skl-nhlt.c @@ -322,8 +322,8 @@ static void skl_get_ssp_clks(struct skl *skl, struct skl_ssp_clk *ssp_clks, rate = channels * bps * fs; /* check if the rate is added already to the given SSP's sclk */ - for (j = 0; (sclk[id].rate_cfg[j].rate != 0) && - (j < SKL_MAX_CLK_RATES); j++) { + for (j = 0; (j < SKL_MAX_CLK_RATES) && + (sclk[id].rate_cfg[j].rate != 0); j++) { if (sclk[id].rate_cfg[j].rate == rate) { present = true; break;