Browse Source

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 <gaetan.perrot@spacecubics.com>
pull/92716/head
Gaetan Perrot 6 days ago committed by Dan Kalowsky
parent
commit
1610aa0e9f
  1. 3
      subsys/bluetooth/host/classic/a2dp.c

3
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) @@ -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;

Loading…
Cancel
Save