ASoC: Kill BUG_ON() usages
Subsystems (4)
cover ASoC: Kill BUG_ON() usages
Hi,
I found a few stupid BUG_ON() usages in the code, let's kill or replace them.
Takashi
===
Takashi Iwai (3):
ASoC: tas571x: Kill BUG_ON() usage
ASoC: davinci: Kill BUG_ON() usage
ASoC: intel: Kill BUG_ON() usage
sound/soc/codecs/tas571x.c | 3 ++- sound/soc/davinci/davinci-mcasp.c | 3 ++- sound/soc/intel/atom/sst/sst_loader.c | 1 - sound/soc/intel/atom/sst/sst_stream.c | 1 - 4 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.14.1
PATCH 1/3 ASoC: tas571x: Kill BUG_ON() usage
Don't use BUG_ON() for a non-critical sanity check on production systems. This patch replaces with a softer WARN_ON() and an error path.
--- sound/soc/codecs/tas571x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/tas571x.c +2 -1
@@ -697,7 +697,8 @@ static int tas571x_i2c_probe(struct i2c_client *client,return PTR_ERR (priv->mclk); } -BUG_ON (priv->chip->num_supply_names >TAS571X_MAX_SUPPLIES ); +if (WARN_ON (priv->chip->num_supply_names >TAS571X_MAX_SUPPLIES )) +return -EINVAL ;for (i =0 ; i < priv->chip->num_supply_names; i++) priv->supplies[i].supply = priv->chip->supply_names[i];
Signature · 1 line
2.14.1
PATCH 2/3 ASoC: davinci: Kill BUG_ON() usage
In reply to Takashi IwaiDon't use BUG_ON() for a non-critical sanity check on production systems. This patch replaces with a softer WARN_ON() and an error path.
--- sound/soc/davinci/davinci-mcasp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/davinci/davinci-mcasp.c +2 -1
@@ -1721,7 +1721,8 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp) PTR_ERR(chan));return PTR_ERR (chan); } -BUG_ON (!chan->device || !chan->device->dev); +if (WARN_ON (!chan->device || !chan->device->dev)) +return -EINVAL ;if (chan->device->dev->of_node) ret = of_property_read_string(chan->device->dev->of_node,
Signature · 1 line
2.14.1
PATCH 3/3 ASoC: intel: Kill BUG_ON() usage
In reply to Takashi IwaiDon't use BUG_ON() for a non-critical sanity check on production systems. This patch either removes useless BUG_ON() calls.
--- sound/soc/intel/atom/sst/sst_loader.c | 1 - sound/soc/intel/atom/sst/sst_stream.c | 1 - 2 files changed, 2 deletions(-)
sound/soc/intel/atom/sst/sst_loader.c +0 -1
@@ -415,7 +415,6 @@ int sst_load_fw(struct intel_sst_drv *sst_drv_ctx)return ret_val; } -BUG_ON (!sst_drv_ctx->fw_in_mem); block =sst_create_block (sst_drv_ctx,0 ,FW_DWNL_ID );if (block ==NULL )return -ENOMEM ;
sound/soc/intel/atom/sst/sst_stream.c +0 -1
@@ -45,7 +45,6 @@ int sst_alloc_stream_mrfld(struct intel_sst_drv *sst_drv_ctx, void *params)void *data =NULL ;dev_dbg (sst_drv_ctx->dev,"Enter\n" ); -BUG_ON (!params); str_params = (struct snd_sst_params *)params;memset (&alloc_param,0 ,sizeof (alloc_param));
Signature · 1 line
2.14.1
Re: [PATCH 3/3] ASoC: intel: Kill BUG_ON() usage
Quoted 2 lines · Takashi Iwai
Don't use
BUG_ON()for a non-critical sanity check on production systems. This patch either removes uselessBUG_ON()calls.
Quoted 38 lines
Signed-off-by Takashi Iwai <[email protected]>--- sound/soc/intel/atom/sst/sst_loader.c | 1 - sound/soc/intel/atom/sst/sst_stream.c | 1 - 2 files changed, 2 deletions(-)sound/soc/intel/atom/sst/sst_loader.c +0
-1@@ -415,7 +415,6 @@ int sst_load_fw(struct intel_sst_drv *sst_drv_ctx)return ret_val; } -BUG_ON (!sst_drv_ctx->fw_in_mem); block =sst_create_block (sst_drv_ctx,0 ,FW_DWNL_ID );if (block ==NULL )return -ENOMEM ;sound/soc/intel/atom/sst/sst_stream.c +0
-1@@ -45,7 +45,6 @@ int sst_alloc_stream_mrfld(struct intel_sst_drv *sst_drv_ctx, void *params)void *data =NULL ;dev_dbg (sst_drv_ctx->dev,"Enter\n" ); -BUG_ON (!params); str_params = (struct snd_sst_params *)params;memset (&alloc_param,0 ,sizeof (alloc_param));Signature · 6 lines
2.14.1 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Signature · 1 line
~Vinod
Mark Brown
maintainerApplied "ASoC: intel: Kill BUG_ON() usage" to the asoc tree
In reply to Takashi IwaiThe patch
ASoC: intel: Kill BUG_ON() usage
has been applied to the asoc tree at
git://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
Quoted 1 line
From
89db6f9632e38b6b5cc7f23f4b67f74470319978Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Thu, 7 Sep 2017 10:59:18 +0200
Subject: [PATCH] ASoC: intel: Kill BUG_ON() usage
Don't use BUG_ON() for a non-critical sanity check on production systems. This patch either removes useless BUG_ON() calls.
--- sound/soc/intel/atom/sst/sst_loader.c | 1 - sound/soc/intel/atom/sst/sst_stream.c | 1 - 2 files changed, 2 deletions(-)
sound/soc/intel/atom/sst/sst_loader.c +0 -1
@@ -415,7 +415,6 @@ int sst_load_fw(struct intel_sst_drv *sst_drv_ctx)return ret_val; } -BUG_ON (!sst_drv_ctx->fw_in_mem); block =sst_create_block (sst_drv_ctx,0 ,FW_DWNL_ID );if (block ==NULL )return -ENOMEM ;
sound/soc/intel/atom/sst/sst_stream.c +0 -1
@@ -45,7 +45,6 @@ int sst_alloc_stream_mrfld(struct intel_sst_drv *sst_drv_ctx, void *params)void *data =NULL ;dev_dbg (sst_drv_ctx->dev,"Enter\n" ); -BUG_ON (!params); str_params = (struct snd_sst_params *)params;memset (&alloc_param,0 ,sizeof (alloc_param));
Signature · 1 line
2.13.2
Mark Brown
maintainerApplied "ASoC: davinci: Kill BUG_ON() usage" to the asoc tree
In reply to Takashi IwaiThe patch
ASoC: davinci: Kill BUG_ON() usage
has been applied to the asoc tree at
git://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
Quoted 1 line
From
befff4fbc27e19b14b343eb4a65d8f75d38b6230Mon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Thu, 7 Sep 2017 10:59:17 +0200
Subject: [PATCH] ASoC: davinci: Kill BUG_ON() usage
Don't use BUG_ON() for a non-critical sanity check on production systems. This patch replaces with a softer WARN_ON() and an error path.
--- sound/soc/davinci/davinci-mcasp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/davinci/davinci-mcasp.c +2 -1
@@ -1721,7 +1721,8 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp) PTR_ERR(chan));return PTR_ERR (chan); } -BUG_ON (!chan->device || !chan->device->dev); +if (WARN_ON (!chan->device || !chan->device->dev)) +return -EINVAL ;if (chan->device->dev->of_node) ret = of_property_read_string(chan->device->dev->of_node,
Signature · 1 line
2.13.2
Mark Brown
maintainerApplied "ASoC: tas571x: Kill BUG_ON() usage" to the asoc tree
In reply to Takashi IwaiThe patch
ASoC: tas571x: Kill BUG_ON() usage
has been applied to the asoc tree at
git://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
Quoted 1 line
From
a029ef45179d72945c7ae0a11f97e8012a5574acMon Sep 17 00:00:00 2001
From: Takashi Iwai <[email protected]>
Date: Thu, 7 Sep 2017 10:59:16 +0200
Subject: [PATCH] ASoC: tas571x: Kill BUG_ON() usage
Don't use BUG_ON() for a non-critical sanity check on production systems. This patch replaces with a softer WARN_ON() and an error path.
--- sound/soc/codecs/tas571x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/tas571x.c +2 -1
@@ -697,7 +697,8 @@ static int tas571x_i2c_probe(struct i2c_client *client,return PTR_ERR (priv->mclk); } -BUG_ON (priv->chip->num_supply_names >TAS571X_MAX_SUPPLIES ); +if (WARN_ON (priv->chip->num_supply_names >TAS571X_MAX_SUPPLIES )) +return -EINVAL ;for (i =0 ; i < priv->chip->num_supply_names; i++) priv->supplies[i].supply = priv->chip->supply_names[i];
Signature · 1 line
2.13.2