linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Remove unneeded zero initialization
@ 2012-03-28 11:56 Andrei Emeltchenko
  2012-03-28 12:46 ` Marcel Holtmann
  2012-03-28 13:06 ` Andrei Emeltchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-03-28 11:56 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Remove zero initialization since channel is allocated with kzalloc
in l2cap_chan_create.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 net/bluetooth/l2cap_sock.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 53e563f..4e73b41 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -999,7 +999,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
 		}
 
 		chan->imtu = L2CAP_DEFAULT_MTU;
-		chan->omtu = 0;
+
 		if (!disable_ertm && sk->sk_type == SOCK_STREAM) {
 			chan->mode = L2CAP_MODE_ERTM;
 			set_bit(CONF_STATE2_DEVICE, &chan->conf_state);
@@ -1011,7 +1011,6 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
 		chan->tx_win = L2CAP_DEFAULT_TX_WINDOW;
 		chan->tx_win_max = L2CAP_DEFAULT_TX_WINDOW;
 		chan->sec_level = BT_SECURITY_LOW;
-		chan->flags = 0;
 		set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
 	}
 
-- 
1.7.9.1


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

* Re: [PATCH] Bluetooth: Remove unneeded zero initialization
  2012-03-28 11:56 [PATCH] Bluetooth: Remove unneeded zero initialization Andrei Emeltchenko
@ 2012-03-28 12:46 ` Marcel Holtmann
  2012-03-28 13:06 ` Andrei Emeltchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2012-03-28 12:46 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

> Remove zero initialization since channel is allocated with kzalloc
> in l2cap_chan_create.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_sock.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
> index 53e563f..4e73b41 100644
> --- a/net/bluetooth/l2cap_sock.c
> +++ b/net/bluetooth/l2cap_sock.c
> @@ -999,7 +999,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
>  		}
>  
>  		chan->imtu = L2CAP_DEFAULT_MTU;
> -		chan->omtu = 0;
> +

while technically not needed. This seems like a good idea to keep from a
visual point of view.

>  		if (!disable_ertm && sk->sk_type == SOCK_STREAM) {
>  			chan->mode = L2CAP_MODE_ERTM;
>  			set_bit(CONF_STATE2_DEVICE, &chan->conf_state);
> @@ -1011,7 +1011,6 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
>  		chan->tx_win = L2CAP_DEFAULT_TX_WINDOW;
>  		chan->tx_win_max = L2CAP_DEFAULT_TX_WINDOW;
>  		chan->sec_level = BT_SECURITY_LOW;
> -		chan->flags = 0;

This one can be removed indeed.

>  		set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
>  	}
>  

Regards

Marcel



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

* [PATCH] Bluetooth: Remove unneeded zero initialization
  2012-03-28 11:56 [PATCH] Bluetooth: Remove unneeded zero initialization Andrei Emeltchenko
  2012-03-28 12:46 ` Marcel Holtmann
@ 2012-03-28 13:06 ` Andrei Emeltchenko
  2012-03-28 14:05   ` Marcel Holtmann
  2012-03-28 14:33   ` Gustavo Padovan
  1 sibling, 2 replies; 5+ messages in thread
From: Andrei Emeltchenko @ 2012-03-28 13:06 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Remove zero initialization since channel is allocated with kzalloc
in l2cap_chan_create.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
 net/bluetooth/l2cap_sock.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 53e563f..1d3e9c3 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1011,7 +1011,6 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
 		chan->tx_win = L2CAP_DEFAULT_TX_WINDOW;
 		chan->tx_win_max = L2CAP_DEFAULT_TX_WINDOW;
 		chan->sec_level = BT_SECURITY_LOW;
-		chan->flags = 0;
 		set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
 	}
 
-- 
1.7.9.1


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

* Re: [PATCH] Bluetooth: Remove unneeded zero initialization
  2012-03-28 13:06 ` Andrei Emeltchenko
@ 2012-03-28 14:05   ` Marcel Holtmann
  2012-03-28 14:33   ` Gustavo Padovan
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2012-03-28 14:05 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

> Remove zero initialization since channel is allocated with kzalloc
> in l2cap_chan_create.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_sock.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



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

* Re: [PATCH] Bluetooth: Remove unneeded zero initialization
  2012-03-28 13:06 ` Andrei Emeltchenko
  2012-03-28 14:05   ` Marcel Holtmann
@ 2012-03-28 14:33   ` Gustavo Padovan
  1 sibling, 0 replies; 5+ messages in thread
From: Gustavo Padovan @ 2012-03-28 14:33 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

* Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com> [2012-03-28 16:06:41 +0300]:

> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> Remove zero initialization since channel is allocated with kzalloc
> in l2cap_chan_create.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_sock.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
> index 53e563f..1d3e9c3 100644
> --- a/net/bluetooth/l2cap_sock.c
> +++ b/net/bluetooth/l2cap_sock.c
> @@ -1011,7 +1011,6 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
>  		chan->tx_win = L2CAP_DEFAULT_TX_WINDOW;
>  		chan->tx_win_max = L2CAP_DEFAULT_TX_WINDOW;
>  		chan->sec_level = BT_SECURITY_LOW;
> -		chan->flags = 0;
>  		set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
>  	}

Patch has been applied to bluetooth-next. Thanks.

	Gustavo

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

end of thread, other threads:[~2012-03-28 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-28 11:56 [PATCH] Bluetooth: Remove unneeded zero initialization Andrei Emeltchenko
2012-03-28 12:46 ` Marcel Holtmann
2012-03-28 13:06 ` Andrei Emeltchenko
2012-03-28 14:05   ` Marcel Holtmann
2012-03-28 14:33   ` Gustavo 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).