Skip to contentSkip to conversation

net/bluetooth: remove __get_channel/dir

PATCH Superseded Alex Shi 2 participants 6 messages Jan 21, 2020 – Feb 5, 2020

Subsystems (4)
lore
Share & tools
lore

Alex Shi

author
#0 lore raw

PATCH 1/1 net/bluetooth: remove __get_channel/dir

These 2 macros are never used from first git commit Linux-2.6.12-rc2. So better to remove them.

Cc Marcel Holtmann <[email protected]>
Cc Johan Hedberg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
---
 net/bluetooth/rfcomm/core.c | 2 --
 1 file changed, 2 deletions(-)
net/bluetooth/rfcomm/core.c +0 -2
index 3a9e9d9670be..825adff79f13 100644
@@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 
 /* ---- RFCOMM frame parsing macros ---- */
 #define __get_dlci(b)     ((b & 0xfc) >> 2)
-#define __get_channel(b)  ((b & 0xf8) >> 3)
-#define __get_dir(b)      ((b & 0x04) >> 2)
 #define __get_type(b)     ((b & 0xef))
 
 #define __test_ea(b)      ((b & 0x01))
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

Hi Alex,

Quoted 20 lines

These 2 macros are never used from first git commit Linux-2.6.12-rc2. So better to remove them.

Cc Marcel Holtmann <[email protected]>
Cc Johan Hedberg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>

---
net/bluetooth/rfcomm/core.c | 2 --

1 file changed, 2 deletions(-)
net/bluetooth/rfcomm/core.c +0 -0
index 3a9e9d9670be..825adff79f13 100644

net/bluetooth/rfcomm/core.c static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, · line 78

Quoted 8 lines
net/bluetooth/rfcomm/core.c +0 -2
@@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 
 /* ---- RFCOMM frame parsing macros ---- */
 #define __get_dlci(b)     ((b & 0xfc) >> 2)
-#define __get_channel(b)  ((b & 0xf8) >> 3)
-#define __get_dir(b)      ((b & 0x04) >> 2)
 #define __get_type(b)     ((b & 0xef))
 
 #define __test_ea(b)      ((b & 0x01))

it seems we are also not using __dir macro either.

Regards

Marcel

author
#2 lore raw
Quoted 29 lines · Marcel Holtmann

Hi Alex,

Quoted 27 lines

These 2 macros are never used from first git commit Linux-2.6.12-rc2. So better to remove them.

Cc Marcel Holtmann <[email protected]>
Cc Johan Hedberg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>

---
net/bluetooth/rfcomm/core.c | 2 --

1 file changed, 2 deletions(-)
net/bluetooth/rfcomm/core.c +0 -2
index 3a9e9d9670be..825adff79f13 100644
@@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 
 /* ---- RFCOMM frame parsing macros ---- */
 #define __get_dlci(b)     ((b & 0xfc) >> 2)
-#define __get_channel(b)  ((b & 0xf8) >> 3)
-#define __get_dir(b)      ((b & 0x04) >> 2)
 #define __get_type(b)     ((b & 0xef))
 
Quoted 4 lines

net/bluetooth/rfcomm/core.c static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, · line 78

Quoted 1 line
net/bluetooth/rfcomm/core.c +0 -0
 #define __test_ea(b)      ((b & 0x01))

it seems we are also not using __dir macro either.

Hi Marcel,

Thanks a lot for reminder. How about the following patch?

Thanks
Alex

From 41ef02c2f52cee1d69bb0ba0fbd90247d61dc155 Mon Sep 17 00:00:00 2001
From: Alex Shi <[email protected]>
Date: Wed, 15 Jan 2020 17:11:01 +0800
Subject: [PATCH v2] net/bluetooth: remove __get_channel/dir and __dir

These 3 macros are never used from first git commit Linux-2.6.12-rc2. let's remove them.

---
 net/bluetooth/rfcomm/core.c | 3 ---
 1 file changed, 3 deletions(-)
net/bluetooth/rfcomm/core.c +0 -3
index 3a9e9d9670be..dcecce087b24 100644
@@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 
 /* ---- RFCOMM frame parsing macros ---- */
 #define __get_dlci(b)     ((b & 0xfc) >> 2)
-#define __get_channel(b)  ((b & 0xf8) >> 3)
-#define __get_dir(b)      ((b & 0x04) >> 2)
 #define __get_type(b)     ((b & 0xef))
 
 #define __test_ea(b)      ((b & 0x01))
@@ -87,7 +85,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 #define __ctrl(type, pf)       (((type & 0xef) | (pf << 4)))
 #define __dlci(dir, chn)       (((chn & 0x1f) << 1) | dir)
 #define __srv_channel(dlci)    (dlci >> 1)
-#define __dir(dlci)            (dlci & 0x01)
 
 #define __len8(len)       (((len) << 1) | 1)
 #define __len16(len)      ((len) << 1)
Signature · 1 line
1.8.3.1
maintainer
#3 lore raw

Hi Alex,

Quoted 74 lines
Quoted 27 lines
Quoted 27 lines

These 2 macros are never used from first git commit Linux-2.6.12-rc2. So better to remove them.

Cc Marcel Holtmann <[email protected]>
Cc Johan Hedberg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>

---
net/bluetooth/rfcomm/core.c | 2 --

1 file changed, 2 deletions(-)
net/bluetooth/rfcomm/core.c +0 -2
index 3a9e9d9670be..825adff79f13 100644
@@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 
 /* ---- RFCOMM frame parsing macros ---- */
 #define __get_dlci(b)     ((b & 0xfc) >> 2)
-#define __get_channel(b)  ((b & 0xf8) >> 3)
-#define __get_dir(b)      ((b & 0x04) >> 2)
 #define __get_type(b)     ((b & 0xef))
 
Quoted 4 lines

net/bluetooth/rfcomm/core.c static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, · line 78

Quoted 1 line
net/bluetooth/rfcomm/core.c +0 -0
 #define __test_ea(b)      ((b & 0x01))

it seems we are also not using __dir macro either.

Hi Marcel,

Thanks a lot for reminder. How about the following patch?

Thanks
Alex

From 41ef02c2f52cee1d69bb0ba0fbd90247d61dc155 Mon Sep 17 00:00:00 2001
From: Alex Shi <[email protected]>
Date: Wed, 15 Jan 2020 17:11:01 +0800
Subject: [PATCH v2] net/bluetooth: remove __get_channel/dir and __dir

These 3 macros are never used from first git commit Linux-2.6.12-rc2. let's remove them.

---
net/bluetooth/rfcomm/core.c | 3 ---

1 file changed, 3 deletions(-)
net/bluetooth/rfcomm/core.c +0 -2
index 3a9e9d9670be..dcecce087b24 100644
@@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 
 /* ---- RFCOMM frame parsing macros ---- */
 #define __get_dlci(b)     ((b & 0xfc) >> 2)
-#define __get_channel(b)  ((b & 0xf8) >> 3)
-#define __get_dir(b)      ((b & 0x04) >> 2)
 #define __get_type(b)     ((b & 0xef))
 
 #define __test_ea(b)      ((b & 0x01))

net/bluetooth/rfcomm/core.c static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, · line 90

Quoted 7 lines
net/bluetooth/rfcomm/core.c +0 -1
@@ -87,7 +85,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 #define __ctrl(type, pf)       (((type & 0xef) | (pf << 4)))
 #define __dlci(dir, chn)       (((chn & 0x1f) << 1) | dir)
 #define __srv_channel(dlci)    (dlci >> 1)
-#define __dir(dlci)            (dlci & 0x01)
 
 #define __len8(len)       (((len) << 1) | 1)
 #define __len16(len)      ((len) << 1)

just send a proper patch to the mailing list so that I can apply it.

Regards

Marcel

author
#4 lore raw

PATCH v2 1/1 net/bluetooth: remove __get_channel/dir and __dir

These 3 macros are never used from first git commit Linux-2.6.12-rc2. let's remove them.

Cc Marcel Holtmann <[email protected]>
Cc Johan Hedberg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
---
 net/bluetooth/rfcomm/core.c | 3 ---
 1 file changed, 3 deletions(-)
net/bluetooth/rfcomm/core.c +0 -3
index 3a9e9d9670be..dcecce087b24 100644
@@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 
 /* ---- RFCOMM frame parsing macros ---- */
 #define __get_dlci(b)     ((b & 0xfc) >> 2)
-#define __get_channel(b)  ((b & 0xf8) >> 3)
-#define __get_dir(b)      ((b & 0x04) >> 2)
 #define __get_type(b)     ((b & 0xef))
 
 #define __test_ea(b)      ((b & 0x01))
@@ -87,7 +85,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
 #define __ctrl(type, pf)       (((type & 0xef) | (pf << 4)))
 #define __dlci(dir, chn)       (((chn & 0x1f) << 1) | dir)
 #define __srv_channel(dlci)    (dlci >> 1)
-#define __dir(dlci)            (dlci & 0x01)
 
 #define __len8(len)       (((len) << 1) | 1)
 #define __len16(len)      ((len) << 1)
Signature · 1 line
1.8.3.1
maintainer
#5 lore raw

Re: [PATCH v2] net/bluetooth: remove __get_channel/dir and __dir

Hi Alex,

Quoted 11 lines

These 3 macros are never used from first git commit Linux-2.6.12-rc2. let's remove them.

Cc Marcel Holtmann <[email protected]>
Cc Johan Hedberg <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc "Gustavo A. R. Silva" <[email protected]>
Quoted 3 lines

---
net/bluetooth/rfcomm/core.c | 3 ---

1 file changed, 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel