未验证 提交 a140785b 编写于 作者: P Pierre-Louis Bossart 提交者: Mark Brown

ASoC: Intel: atom: sst_ipc: remove useless initializations

cppcheck throws invalid NULL dereference warnings but there's indeed
no need to initialize a loop variable or initialize to NULL before
allocating memory.
Signed-off-by: NPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: NBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: NPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220520211719.607543-8-pierre-louis.bossart@linux.intel.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 d8af5411
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
struct sst_block *sst_create_block(struct intel_sst_drv *ctx, struct sst_block *sst_create_block(struct intel_sst_drv *ctx,
u32 msg_id, u32 drv_id) u32 msg_id, u32 drv_id)
{ {
struct sst_block *msg = NULL; struct sst_block *msg;
dev_dbg(ctx->dev, "Enter\n"); dev_dbg(ctx->dev, "Enter\n");
msg = kzalloc(sizeof(*msg), GFP_KERNEL); msg = kzalloc(sizeof(*msg), GFP_KERNEL);
...@@ -63,7 +63,7 @@ struct sst_block *sst_create_block(struct intel_sst_drv *ctx, ...@@ -63,7 +63,7 @@ struct sst_block *sst_create_block(struct intel_sst_drv *ctx,
int sst_wake_up_block(struct intel_sst_drv *ctx, int result, int sst_wake_up_block(struct intel_sst_drv *ctx, int result,
u32 drv_id, u32 ipc, void *data, u32 size) u32 drv_id, u32 ipc, void *data, u32 size)
{ {
struct sst_block *block = NULL; struct sst_block *block;
dev_dbg(ctx->dev, "Enter\n"); dev_dbg(ctx->dev, "Enter\n");
...@@ -91,7 +91,7 @@ int sst_wake_up_block(struct intel_sst_drv *ctx, int result, ...@@ -91,7 +91,7 @@ int sst_wake_up_block(struct intel_sst_drv *ctx, int result,
int sst_free_block(struct intel_sst_drv *ctx, struct sst_block *freed) int sst_free_block(struct intel_sst_drv *ctx, struct sst_block *freed)
{ {
struct sst_block *block = NULL, *__block; struct sst_block *block, *__block;
dev_dbg(ctx->dev, "Enter\n"); dev_dbg(ctx->dev, "Enter\n");
spin_lock_bh(&ctx->block_lock); spin_lock_bh(&ctx->block_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册