diff options
author | Dean Jenkins <Dean_Jenkins@mentor.com> | 2013-02-28 09:21:58 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-03-08 08:40:25 -0500 |
commit | 24fd642ccb24c8b5732d7d7b5e98277507860b2a (patch) | |
tree | 9de4c54ca8f19095e5ce7f654e87bb33c1e4e29f /net/bluetooth | |
parent | 8e888f2783384ec097bc0c88d9949776f3584ed3 (diff) |
Bluetooth: Remove redundant RFCOMM BT_CLOSED settings
rfcomm_session_close() sets the RFCOMM session state to BT_CLOSED.
However, in multiple places immediately before the function is
called, the RFCOMM session is set to BT_CLOSED. Therefore,
remove these unnecessary state settings.
Signed-off-by: Dean Jenkins <Dean_Jenkins@mentor.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index c7e88761d3b7..ba93df2af71f 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -659,10 +659,10 @@ static struct rfcomm_session *rfcomm_session_close(struct rfcomm_session *s, | |||
659 | struct rfcomm_dlc *d; | 659 | struct rfcomm_dlc *d; |
660 | struct list_head *p, *n; | 660 | struct list_head *p, *n; |
661 | 661 | ||
662 | BT_DBG("session %p state %ld err %d", s, s->state, err); | ||
663 | |||
664 | s->state = BT_CLOSED; | 662 | s->state = BT_CLOSED; |
665 | 663 | ||
664 | BT_DBG("session %p state %ld err %d", s, s->state, err); | ||
665 | |||
666 | /* Close all dlcs */ | 666 | /* Close all dlcs */ |
667 | list_for_each_safe(p, n, &s->dlcs) { | 667 | list_for_each_safe(p, n, &s->dlcs) { |
668 | d = list_entry(p, struct rfcomm_dlc, list); | 668 | d = list_entry(p, struct rfcomm_dlc, list); |
@@ -1188,7 +1188,6 @@ static struct rfcomm_session *rfcomm_recv_dm(struct rfcomm_session *s, u8 dlci) | |||
1188 | else | 1188 | else |
1189 | err = ECONNRESET; | 1189 | err = ECONNRESET; |
1190 | 1190 | ||
1191 | s->state = BT_CLOSED; | ||
1192 | s = rfcomm_session_close(s, err); | 1191 | s = rfcomm_session_close(s, err); |
1193 | } | 1192 | } |
1194 | return s; | 1193 | return s; |
@@ -1224,7 +1223,6 @@ static struct rfcomm_session *rfcomm_recv_disc(struct rfcomm_session *s, | |||
1224 | else | 1223 | else |
1225 | err = ECONNRESET; | 1224 | err = ECONNRESET; |
1226 | 1225 | ||
1227 | s->state = BT_CLOSED; | ||
1228 | s = rfcomm_session_close(s, err); | 1226 | s = rfcomm_session_close(s, err); |
1229 | } | 1227 | } |
1230 | return s; | 1228 | return s; |
@@ -1921,7 +1919,6 @@ static struct rfcomm_session *rfcomm_check_connection(struct rfcomm_session *s) | |||
1921 | break; | 1919 | break; |
1922 | 1920 | ||
1923 | case BT_CLOSED: | 1921 | case BT_CLOSED: |
1924 | s->state = BT_CLOSED; | ||
1925 | s = rfcomm_session_close(s, sk->sk_err); | 1922 | s = rfcomm_session_close(s, sk->sk_err); |
1926 | break; | 1923 | break; |
1927 | } | 1924 | } |