public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: tegra: Fix MBDRC bypass mode check
@ 2022-06-15  4:38 Sameer Pujar
  2022-06-15 13:54 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Sameer Pujar @ 2022-06-15  4:38 UTC (permalink / raw)
  To: broonie, perex, tiwai, dan.carpenter
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar

MBDRC supports different modes of operation. There is no configuration
required for bypass mode. The hw_params() call does not filter bypass
mode correctly and it leads to following Smatch static checker warning:

  sound/soc/tegra/tegra210_mbdrc.c:778 tegra210_mbdrc_hw_params()
  warn: bitwise AND condition is false here

Fix this condition by using proper mode mask and just return for bypass
mode.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 7358a803c778 ("ASoC: tegra: Add Tegra210 based OPE driver")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra210_mbdrc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/tegra/tegra210_mbdrc.c b/sound/soc/tegra/tegra210_mbdrc.c
index 7d9da33..d786daa 100644
--- a/sound/soc/tegra/tegra210_mbdrc.c
+++ b/sound/soc/tegra/tegra210_mbdrc.c
@@ -775,7 +775,9 @@ int tegra210_mbdrc_hw_params(struct snd_soc_component *cmpnt)
 
 	regmap_read(ope->mbdrc_regmap, TEGRA210_MBDRC_CFG, &val);
 
-	if (val & TEGRA210_MBDRC_CFG_MBDRC_MODE_BYPASS)
+	val &= TEGRA210_MBDRC_CFG_MBDRC_MODE_MASK;
+
+	if (val == TEGRA210_MBDRC_CFG_MBDRC_MODE_BYPASS)
 		return 0;
 
 	for (i = 0; i < MBDRC_NUM_BAND; i++) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: tegra: Fix MBDRC bypass mode check
  2022-06-15  4:38 [PATCH] ASoC: tegra: Fix MBDRC bypass mode check Sameer Pujar
@ 2022-06-15 13:54 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-06-15 13:54 UTC (permalink / raw)
  To: spujar, dan.carpenter, perex, tiwai
  Cc: linux-kernel, jonathanh, linux-tegra, alsa-devel, thierry.reding

On Wed, 15 Jun 2022 10:08:34 +0530, Sameer Pujar wrote:
> MBDRC supports different modes of operation. There is no configuration
> required for bypass mode. The hw_params() call does not filter bypass
> mode correctly and it leads to following Smatch static checker warning:
> 
>   sound/soc/tegra/tegra210_mbdrc.c:778 tegra210_mbdrc_hw_params()
>   warn: bitwise AND condition is false here
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tegra: Fix MBDRC bypass mode check
      commit: 4edf738d4c7989c315e37d4d61e34c94557b6ed2

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-15 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-15  4:38 [PATCH] ASoC: tegra: Fix MBDRC bypass mode check Sameer Pujar
2022-06-15 13:54 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox