[PATCH BlueZ 03/11] attrib: Use att_put_u16() instead of htobs() + memcpy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 attrib/att.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/attrib/att.c b/attrib/att.c
index 753c753..d9ca709 100644
--- a/attrib/att.c
+++ b/attrib/att.c
@@ -723,15 +723,13 @@ uint16_t enc_error_resp(uint8_t opcode, uint16_t handle, uint8_t status,
 {
 	const uint16_t min_len = sizeof(pdu[0]) + sizeof(opcode) +
 						sizeof(handle) + sizeof(status);
-	uint16_t u16;
 
 	if (len < min_len)
 		return 0;
 
-	u16 = htobs(handle);
 	pdu[0] = ATT_OP_ERROR;
 	pdu[1] = opcode;
-	memcpy(&pdu[2], &u16, sizeof(u16));
+	att_put_u16(handle, &pdu[2]);
 	pdu[4] = status;
 
 	return min_len;
-- 
1.8.3.2

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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux