Thread (6 messages) 6 messages, 2 authors, 2015-06-05

Re: [PATCH] shared/att: Fix boolean check in handle_notify()

From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Date: 2015-05-29 08:39:01

Hi Andrei,

On Fri, May 29, 2015 at 11:09 AM, Andrei Emeltchenko
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Andrei Emeltchenko <redacted>

ext_signed is boolean and shall be checked with logical op.
---
 src/shared/att.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/att.c b/src/shared/att.c
index 053aa47..a3d8f89 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -733,7 +733,7 @@ static void handle_notify(struct bt_att *att, uint8_t opcode, uint8_t *pdu,
        const struct queue_entry *entry;
        bool found;

-       if (opcode & ATT_OP_SIGNED_MASK & !att->ext_signed) {
+       if (opcode & ATT_OP_SIGNED_MASK && !att->ext_signed) {
I guess adding (opcode & ATT_OP_SIGNED_MASK) would make this even more clearer.
                if (!handle_signed(att, opcode, pdu, pdu_len))
                        return;
                pdu_len -= BT_ATT_SIGNATURE_LEN;
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Luiz Augusto von Dentz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help