bluetooth: host: att: Remove meaningless check
`>= 0` was used when EATT support was implemented (#23199) because
`bt_l2cap_chan_send` could return number of bytes sent. After PR #67528,
`bt_l2cap_chan_send` doesn't return amount of bytes sent or any positive
value, but either 0 or negative value. Thus `>= 0` is not needed. It
also confusing when reading code, especially when the same check is not
implemented in other cases where underlying function `chan_send` is
used.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
diff --git a/subsys/bluetooth/host/att.c b/subsys/bluetooth/host/att.c
index a2174d2..641327d 100644
--- a/subsys/bluetooth/host/att.c
+++ b/subsys/bluetooth/host/att.c
@@ -584,7 +584,8 @@
if (!chan->req && !sys_slist_is_empty(&att->reqs)) {
sys_snode_t *node = sys_slist_get(&att->reqs);
- if (bt_att_chan_req_send(chan, ATT_REQ(node)) >= 0) {
+ err = bt_att_chan_req_send(chan, ATT_REQ(node));
+ if (err == 0) {
return;
}
@@ -664,7 +665,7 @@
}
if (!bt_att_is_enhanced(meta->att_chan)) {
- struct bt_att_chan *att_chan = meta->att_chan->att->conn;
+ struct bt_att_chan *att_chan = meta->att_chan;
struct bt_conn *conn = att_chan->att->conn;
struct bt_l2cap_chan *l2cap_chan = &att_chan->chan.chan;
@@ -919,7 +920,7 @@
continue;
}
- if (bt_att_chan_req_send(chan, req) >= 0) {
+ if (bt_att_chan_req_send(chan, req) == 0) {
return;
}
@@ -3346,7 +3347,7 @@
return;
}
- if (bt_att_chan_req_send(chan, ATT_REQ(node)) >= 0) {
+ if (bt_att_chan_req_send(chan, ATT_REQ(node)) == 0) {
return;
}