public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo F. Padovan" <gustavo@las.ic.unicamp.br>
To: linux-bluetooth@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] Bluetooth: remove unnecessary atribution to err var
Date: Mon, 20 Apr 2009 01:31:06 -0300	[thread overview]
Message-ID: <1240201868-1396-3-git-send-email-gustavo@las.ic.unicamp.br> (raw)
In-Reply-To: <1240201868-1396-2-git-send-email-gustavo@las.ic.unicamp.br>

The init value of err is not used until it is set to -ENOMEM. So we
initialize it directly to -ENOMEM

Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
---
 net/bluetooth/l2cap.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index ff1744e..85926f5 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -844,7 +844,7 @@ static int l2cap_do_connect(struct sock *sk)
 	struct hci_conn *hcon;
 	struct hci_dev *hdev;
 	__u8 auth_type;
-	int err = 0;
+	int err = -ENOMEM;
 
 	BT_DBG("%s -> %s psm 0x%2.2x", batostr(src), batostr(dst),
 							l2cap_pi(sk)->psm);
@@ -854,8 +854,6 @@ static int l2cap_do_connect(struct sock *sk)
 
 	hci_dev_lock_bh(hdev);
 
-	err = -ENOMEM;
-
 	if (sk->sk_type == SOCK_RAW) {
 		switch (l2cap_pi(sk)->sec_level) {
 		case BT_SECURITY_HIGH:
-- 
1.6.0.6


  reply	other threads:[~2009-04-20  4:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20  4:31 [PATCH 0/4] Bluetooth: l2cap clean ups Gustavo F. Padovan
2009-04-20  4:31 ` [PATCH 1/4] Bluetooth: create macros for channels identifiers Gustavo F. Padovan
2009-04-20  4:31   ` Gustavo F. Padovan [this message]
2009-04-20  4:31     ` [PATCH 3/4] Bluetooth: create macro to hint mask on receiving config request Gustavo F. Padovan
2009-04-20  4:31       ` [PATCH 4/4] Bluetooth: fix many errors and warnings reported by checkpatch.pl Gustavo F. Padovan
2009-04-20  5:20 ` [PATCH 0/4] Bluetooth: l2cap clean ups Marcel Holtmann
  -- strict thread matches above, loose matches on Subject: below --
2009-03-28 17:47 [PATCH 0/4] Bluetooth: clean ups to l2cap Gustavo F. Padovan
2009-03-28 17:47 ` [PATCH 1/4] Bluetooth: create macros for channels identifiers Gustavo F. Padovan
2009-03-28 17:47   ` [PATCH 2/4] Bluetooth: remove unnecessary atribution to err var Gustavo F. Padovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1240201868-1396-3-git-send-email-gustavo@las.ic.unicamp.br \
    --to=gustavo@las.ic.unicamp.br \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox