linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
@ 2010-09-16  9:21 haijun liu
  2010-09-28 23:48 ` Gustavo F. Padovan
  0 siblings, 1 reply; 8+ messages in thread
From: haijun liu @ 2010-09-16  9:21 UTC (permalink / raw)
  To: linux-bluetooth, Mat Martineau, dantian.ip

Replace hard code of configuration continuation flag with self-comment macro.

Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
---
 include/net/bluetooth/l2cap.h |    2 ++
 net/bluetooth/l2cap.c         |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index e4fe2c7..a37b266 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -199,6 +199,8 @@ struct l2cap_conf_rsp {
 #define L2CAP_CONF_REJECT	0x0002
 #define L2CAP_CONF_UNKNOWN	0x0003

+#define L2CAP_CONF_FLAG_CONT	0x0001
+
 struct l2cap_conf_opt {
 	__u8       type;
 	__u8       len;
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 1797277..725744b 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -3121,7 +3121,7 @@ static inline int l2cap_config_req(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
 	memcpy(l2cap_pi(sk)->conf_req + l2cap_pi(sk)->conf_len, req->data, len);
 	l2cap_pi(sk)->conf_len += len;

-	if (flags & 0x0001) {
+	if (flags & L2CAP_CONF_FLAG_CONT) {
 		/* Incomplete config. Send empty response. */
 		l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
 				l2cap_build_conf_rsp(sk, rsp,
@@ -3228,7 +3228,7 @@ static inline int l2cap_config_rsp(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
 		goto done;
 	}

-	if (flags & 0x01)
+	if (flags & L2CAP_CONF_FLAG_CONT)
 		goto done;

 	l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE;
-- 
1.6.3.3


-- 
Haijun Liu

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
  2010-09-16  9:21 [PATCH] Bluetooth: Replace hard code of configuration continuation flag haijun liu
@ 2010-09-28 23:48 ` Gustavo F. Padovan
  2010-09-29 11:12   ` haijun liu
  0 siblings, 1 reply; 8+ messages in thread
From: Gustavo F. Padovan @ 2010-09-28 23:48 UTC (permalink / raw)
  To: haijun liu; +Cc: linux-bluetooth, Mat Martineau, dantian.ip

Hi Haijun,

* haijun liu <liuhaijun.er@gmail.com> [2010-09-16 17:21:40 +0800]:

> Replace hard code of configuration continuation flag with self-comment macro.
> 
> Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>

Your patch is corrupted, please fix that and rebase it against
http://git.kernel.org/?p=linux/kernel/git/padovan/bluetooth-next-2.6.git
Thanks.

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
  2010-09-28 23:48 ` Gustavo F. Padovan
@ 2010-09-29 11:12   ` haijun liu
  2010-09-29 11:36     ` Ville Tervo
  0 siblings, 1 reply; 8+ messages in thread
From: haijun liu @ 2010-09-29 11:12 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: linux-bluetooth, Mat Martineau, dantian.ip

 Replace hard code of configuration continuation flag with self-comment macro.


Signed-off-by: Haijun.Liu <haijun.liu@atheros.com>
---
 include/net/bluetooth/l2cap.h |    2 ++
 net/bluetooth/l2cap_core.c    |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index df599dc..2b114ca 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -193,6 +193,8 @@ struct l2cap_conf_rsp {
 #define L2CAP_CONF_REJECT	0x0002
 #define L2CAP_CONF_UNKNOWN	0x0003

+#define L2CAP_CONF_FLAG_CONT	0x0001
+
 struct l2cap_conf_opt {
 	__u8       type;
 	__u8       len;
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index efcf510..bef5c9f 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2985,7 +2985,7 @@ static inline int l2cap_config_req(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
 	memcpy(l2cap_pi(sk)->conf_req + l2cap_pi(sk)->conf_len, req->data, len);
 	l2cap_pi(sk)->conf_len += len;

-	if (flags & 0x0001) {
+	if (flags & L2CAP_CONF_FLAG_CONT) {
 		/* Incomplete config. Send empty response. */
 		l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
 				l2cap_build_conf_rsp(sk, rsp,
@@ -3092,7 +3092,7 @@ static inline int l2cap_config_rsp(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
 		goto done;
 	}

-	if (flags & 0x01)
+	if (flags & L2CAP_CONF_FLAG_CONT)
 		goto done;

 	l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE;
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
  2010-09-29 11:12   ` haijun liu
@ 2010-09-29 11:36     ` Ville Tervo
  2010-09-29 12:42       ` haijun liu
  0 siblings, 1 reply; 8+ messages in thread
From: Ville Tervo @ 2010-09-29 11:36 UTC (permalink / raw)
  To: ext haijun liu
  Cc: Gustavo F. Padovan, linux-bluetooth@vger.kernel.org,
	Mat Martineau, dantian.ip

Hi,

Patch is ok but just one comment. See below.

On Wed, Sep 29, 2010 at 01:12:39PM +0200, haijun liu wrote:
> 
>  Replace hard code of configuration continuation flag with self-comment macro.
> 
> -	if (flags & 0x0001) {
> +	if (flags & L2CAP_CONF_FLAG_CONT) {
>  		/* Incomplete config. Send empty response. */
>  		l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
>  				l2cap_build_conf_rsp(sk, rsp,

Maybe you could use L2CAP_CONF_FLAG_CONT also in l2cap_build_conf_rsp()?

-- 
Ville

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
  2010-09-29 11:36     ` Ville Tervo
@ 2010-09-29 12:42       ` haijun liu
  2010-09-29 13:12         ` Ville Tervo
  0 siblings, 1 reply; 8+ messages in thread
From: haijun liu @ 2010-09-29 12:42 UTC (permalink / raw)
  To: Ville Tervo
  Cc: Gustavo F. Padovan, linux-bluetooth@vger.kernel.org,
	Mat Martineau, dantian.ip

Hi Ville,
Do you mean l2cap_config_rsp()?
I made it, but I don't why gmail hide that part.

-- 
Haijun Liu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
  2010-09-29 12:42       ` haijun liu
@ 2010-09-29 13:12         ` Ville Tervo
  2010-09-29 13:33           ` haijun liu
  0 siblings, 1 reply; 8+ messages in thread
From: Ville Tervo @ 2010-09-29 13:12 UTC (permalink / raw)
  To: ext haijun liu
  Cc: Gustavo F. Padovan, linux-bluetooth@vger.kernel.org,
	Mat Martineau, dantian.ip

Hi,

On Wed, Sep 29, 2010 at 02:42:35PM +0200, ext haijun liu wrote:
> Hi Ville,
> Do you mean l2cap_config_rsp()?

No. I meant change like this in addition to your changes.

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index efcf510..7a9c194 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2989,7 +2989,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
                /* Incomplete config. Send empty response. */
                l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
                                l2cap_build_conf_rsp(sk, rsp,
-                                       L2CAP_CONF_SUCCESS, 0x0001), rsp);
+                                       L2CAP_CONF_SUCCESS, L2CAP_CONF_FLAG_CONT), rsp);
                goto unlock;
        }


> I made it, but I don't why gmail hide that part.

I got the whole message.

-- 
Ville

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
  2010-09-29 13:12         ` Ville Tervo
@ 2010-09-29 13:33           ` haijun liu
  2010-09-30  7:24             ` Gustavo F. Padovan
  0 siblings, 1 reply; 8+ messages in thread
From: haijun liu @ 2010-09-29 13:33 UTC (permalink / raw)
  To: Ville Tervo
  Cc: Gustavo F. Padovan, linux-bluetooth@vger.kernel.org,
	Mat Martineau, dantian.ip

Replace hard code of configuration continuation flag with self-comment macro.


Signed-off-by: Haijun.Liu <haijun.liu@atheros.com>
---
 net/bluetooth/l2cap_core.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index efcf510..279f98a 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2985,11 +2985,11 @@ static inline int l2cap_config_req(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
 	memcpy(l2cap_pi(sk)->conf_req + l2cap_pi(sk)->conf_len, req->data, len);
 	l2cap_pi(sk)->conf_len += len;

-	if (flags & 0x0001) {
+	if (flags & L2CAP_CONF_FLAG_CONT) {
 		/* Incomplete config. Send empty response. */
 		l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
 				l2cap_build_conf_rsp(sk, rsp,
-					L2CAP_CONF_SUCCESS, 0x0001), rsp);
+					L2CAP_CONF_SUCCESS, L2CAP_CONF_FLAG_CONT), rsp);
 		goto unlock;
 	}

@@ -3092,7 +3092,7 @@ static inline int l2cap_config_rsp(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
 		goto done;
 	}

-	if (flags & 0x01)
+	if (flags & L2CAP_CONF_FLAG_CONT)
 		goto done;

 	l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE;
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] Bluetooth: Replace hard code of configuration continuation flag.
  2010-09-29 13:33           ` haijun liu
@ 2010-09-30  7:24             ` Gustavo F. Padovan
  0 siblings, 0 replies; 8+ messages in thread
From: Gustavo F. Padovan @ 2010-09-30  7:24 UTC (permalink / raw)
  To: haijun liu
  Cc: Ville Tervo, linux-bluetooth@vger.kernel.org, Mat Martineau,
	dantian.ip

* haijun liu <liuhaijun.er@gmail.com> [2010-09-29 21:33:09 +0800]:

> Replace hard code of configuration continuation flag with self-comment macro.
> 
> 
> Signed-off-by: Haijun.Liu <haijun.liu@atheros.com>
> ---
>  net/bluetooth/l2cap_core.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

This one is also corrupted.

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-09-30  7:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-16  9:21 [PATCH] Bluetooth: Replace hard code of configuration continuation flag haijun liu
2010-09-28 23:48 ` Gustavo F. Padovan
2010-09-29 11:12   ` haijun liu
2010-09-29 11:36     ` Ville Tervo
2010-09-29 12:42       ` haijun liu
2010-09-29 13:12         ` Ville Tervo
2010-09-29 13:33           ` haijun liu
2010-09-30  7:24             ` Gustavo F. Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).