Skip to contentSkip to conversation

Bluetooth: Use __packed annotation

PATCH In review Gustavo F. Padovan 3 participants 5 messages Jul 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Use __packed annotation

From: Gustavo F. Padovan <[email protected]>

To make net/ and include/net/ code consistent use __packed instead of __attribute__ ((packed)). Bluetooth subsystem was one of the last net subsys still using __attribute__ ((packed)).

---
 include/net/bluetooth/bluetooth.h |    2 +-
 include/net/bluetooth/hci.h       |  184 ++++++++++++++++++------------------
 include/net/bluetooth/l2cap.h     |   26 +++---
 include/net/bluetooth/rfcomm.h    |   14 ++--
 4 files changed, 113 insertions(+), 113 deletions(-)
include/net/bluetooth/bluetooth.h +1 -1
index d6b150c..27a902d 100644
@@ -84,7 +84,7 @@ enum {
 /* BD Address */
 typedef struct {
 	__u8 b[6];
-} __attribute__((packed)) bdaddr_t;
+} __packed bdaddr_t;
 
 #define BDADDR_ANY   (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
 #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}})
include/net/bluetooth/hci.h +92 -92

657 lines not on this page · raw message

include/net/bluetooth/l2cap.h +13 -13
index 4b86c78..636724b 100644
@@ -131,31 +131,31 @@ struct l2cap_conninfo {
 struct l2cap_hdr {
 	__le16     len;
 	__le16     cid;
-} __attribute__ ((packed));
+} __packed;
 #define L2CAP_HDR_SIZE		4
 
 struct l2cap_cmd_hdr {
 	__u8       code;
 	__u8       ident;
 	__le16     len;
-} __attribute__ ((packed));
+} __packed;
 #define L2CAP_CMD_HDR_SIZE	4
 
 struct l2cap_cmd_rej {
 	__le16     reason;
-} __attribute__ ((packed));
+} __packed;
 
 struct l2cap_conn_req {
 	__le16     psm;
 	__le16     scid;
-} __attribute__ ((packed));
+} __packed;
 
 struct l2cap_conn_rsp {
 	__le16     dcid;
 	__le16     scid;
 	__le16     result;
 	__le16     status;
-} __attribute__ ((packed));
+} __packed;
 
 /* channel indentifier */
 #define L2CAP_CID_SIGNALING	0x0001
@@ -179,14 +179,14 @@ struct l2cap_conf_req {
 	__le16     dcid;
 	__le16     flags;
 	__u8       data[0];
-} __attribute__ ((packed));
+} __packed;
 
 struct l2cap_conf_rsp {
 	__le16     scid;
 	__le16     flags;
 	__le16     result;
 	__u8       data[0];
-} __attribute__ ((packed));
+} __packed;
 
 #define L2CAP_CONF_SUCCESS	0x0000
 #define L2CAP_CONF_UNACCEPT	0x0001
@@ -197,7 +197,7 @@ struct l2cap_conf_opt {
 	__u8       type;
 	__u8       len;
 	__u8       val[0];
-} __attribute__ ((packed));
+} __packed;
 #define L2CAP_CONF_OPT_SIZE	2
 
 #define L2CAP_CONF_HINT		0x80
@@ -218,7 +218,7 @@ struct l2cap_conf_rfc {
 	__le16     retrans_timeout;
 	__le16     monitor_timeout;
 	__le16     max_pdu_size;
-} __attribute__ ((packed));
+} __packed;
 
 #define L2CAP_MODE_BASIC	0x00
 #define L2CAP_MODE_RETRANS	0x01
@@ -229,22 +229,22 @@ struct l2cap_conf_rfc {
 struct l2cap_disconn_req {
 	__le16     dcid;
 	__le16     scid;
-} __attribute__ ((packed));
+} __packed;
 
 struct l2cap_disconn_rsp {
 	__le16     dcid;
 	__le16     scid;
-} __attribute__ ((packed));
+} __packed;
 
 struct l2cap_info_req {
 	__le16      type;
-} __attribute__ ((packed));
+} __packed;
 
 struct l2cap_info_rsp {
 	__le16      type;
 	__le16      result;
 	__u8        data[0];
-} __attribute__ ((packed));
+} __packed;
 
 /* info type */
 #define L2CAP_IT_CL_MTU     0x0001
include/net/bluetooth/rfcomm.h +7 -7
index 921d7b3..a140847 100644
@@ -106,19 +106,19 @@ struct rfcomm_hdr {
 	u8 addr;
 	u8 ctrl;
 	u8 len;    // Actual size can be 2 bytes
-} __attribute__ ((packed));
+} __packed;
 
 struct rfcomm_cmd {
 	u8 addr;
 	u8 ctrl;
 	u8 len;
 	u8 fcs;
-} __attribute__ ((packed));
+} __packed;
 
 struct rfcomm_mcc {
 	u8 type;
 	u8 len;
-} __attribute__ ((packed));
+} __packed;
 
 struct rfcomm_pn {
 	u8  dlci;
@@ -128,7 +128,7 @@ struct rfcomm_pn {
 	__le16 mtu;
 	u8  max_retrans;
 	u8  credits;
-} __attribute__ ((packed));
+} __packed;
 
 struct rfcomm_rpn {
 	u8  dlci;
@@ -138,17 +138,17 @@ struct rfcomm_rpn {
 	u8  xon_char;
 	u8  xoff_char;
 	__le16 param_mask;
-} __attribute__ ((packed));
+} __packed;
 
 struct rfcomm_rls {
 	u8  dlci;
 	u8  status;
-} __attribute__ ((packed));
+} __packed;
 
 struct rfcomm_msc {
 	u8  dlci;
 	u8  v24_sig;
-} __attribute__ ((packed));
+} __packed;
 
 /* ---- Core structures, flags etc ---- */
 
Signature · 1 line
1.7.1.1
maintainer
#1 lore raw

Hi Gustavo,

Quoted 11 lines

To make net/ and include/net/ code consistent use __packed instead of __attribute__ ((packed)). Bluetooth subsystem was one of the last net subsys still using __attribute__ ((packed)).

---
 include/net/bluetooth/bluetooth.h |    2 +-
 include/net/bluetooth/hci.h       |  184 ++++++++++++++++++------------------
 include/net/bluetooth/l2cap.h     |   26 +++---
 include/net/bluetooth/rfcomm.h    |   14 ++--
 4 files changed, 113 insertions(+), 113 deletions(-)

patch has been applied. Thanks.

Regards

Marcel

#2 lore raw

Patches for kernel bluetooth

Hi,

Wondering if preparing patches for kernel bt (net/bluetooth and include/net= /bluetooth) I should base on linux-next git or git://git.kernel.org/pub/=
scm/linux/kernel/git/holtmann/bluetooth-2.6.git?=20

Thanks,
/Waldek

#3 lore raw

Re: Patches for kernel bluetooth

Hi Waldek,

Quoted 3 lines · * [email protected] <[email protected]>…

Hi,

Wondering if preparing patches for kernel bt (net/bluetooth and include/net/bluetooth) I should base on linux-next git or git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git?

Base it on bluetooth-next. Actually you have to base it on bluetooth-testing but it is not up-to-date, so use bluetooth-next for now.

Signature · 2 lines
Gustavo F. Padovan
http://padovan.org
#4 lore raw

RE: Patches for kernel bluetooth

Ok, I see.=20

Thanks,
/Waldek

Quoted 29 lines

-----Original Message-----
From: Gustavo F. Padovan [mailto:[email protected]] On=20 Behalf Of Gustavo F. Padovan
Sent: Monday, July 19, 2010 5:58 PM
To: Rymarkiewicz Waldemar
Cc: [email protected]; [email protected]
Subject: Re: Patches for kernel bluetooth

Hi Waldek,

* [email protected]=20 <[email protected]> [2010-07-19 14:33:37 +0300]:

Quoted 3 lines

Hi,
=20
Wondering if preparing patches for kernel bt (net/bluetooth=20

and include/net/bluetooth) I should base on linux-next git =20 or =20
git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetoot
h-2.6.git?=20

Base it on bluetooth-next. Actually you have to base it on=20 bluetooth-testing but it is not up-to-date, so use=20 bluetooth-next for now.=20

--
Gustavo F. Padovan
http://padovan.org
=