From 1610aa0e9f4f2b5bef767107f1c6436d20cc9f1d Mon Sep 17 00:00:00 2001 From: Gaetan Perrot Date: Wed, 2 Jul 2025 21:14:47 +0900 Subject: [PATCH] bluetooth: host: a2dp: remove redundant null check Remove duplicated check for 'ep->stream == NULL' to clean up conditionals and avoid unnecessary repeated evaluations. This cleans up the code and avoids unnecessary repeated condition evaluation. Signed-off-by: Gaetan Perrot --- subsys/bluetooth/host/classic/a2dp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/subsys/bluetooth/host/classic/a2dp.c b/subsys/bluetooth/host/classic/a2dp.c index bf1acd3dc62..d3312398316 100644 --- a/subsys/bluetooth/host/classic/a2dp.c +++ b/subsys/bluetooth/host/classic/a2dp.c @@ -401,9 +401,6 @@ static int bt_a2dp_set_config_cb(struct bt_avdtp_req *req, struct net_buf *buf) struct bt_a2dp_stream_ops *ops; ep = CONTAINER_OF(a2dp->set_config_param.sep, struct bt_a2dp_ep, sep); - if (ep->stream == NULL) { - return -EINVAL; - } if ((ep->stream == NULL) || (SET_CONF_REQ(req) != &a2dp->set_config_param)) { return -EINVAL;