Skip to contentSkip to conversation

Bluetooth: Shrink size of struct l2cap_ctrl fields

PATCH Applied Marcel Holtmann 2 participants 2 messages Jun 8, 2014

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Shrink size of struct l2cap_ctrl fields

The struct l2cap_ctrl fields are wasting an unsigned int when all the bits can fit into an __u8 field.

---
 include/net/bluetooth/bluetooth.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
include/net/bluetooth/bluetooth.h +9 -9
index 904777c1cd24..373000de610d 100644
@@ -260,15 +260,15 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock);
 
 /* Skb helpers */
 struct l2cap_ctrl {
-	unsigned int	sframe:1,
-			poll:1,
-			final:1,
-			fcs:1,
-			sar:2,
-			super:2;
-	__u16		reqseq;
-	__u16		txseq;
-	__u8		retries;
+	__u8	sframe:1,
+		poll:1,
+		final:1,
+		fcs:1,
+		sar:2,
+		super:2;
+	__u16	reqseq;
+	__u16	txseq;
+	__u8	retries;
 };
 
 struct hci_dev;
Signature · 1 line
1.9.3
#1 lore raw

Hi Marcel,

Quoted 7 lines · Marcel Holtmann

The struct l2cap_ctrl fields are wasting an unsigned int when all the bits can fit into an __u8 field.

---
 include/net/bluetooth/bluetooth.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Applied to bluetooth-next. Thanks.

Johan