Bluetooth: trivial: Shorten variable scope
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Tue, 7 Aug 2012 15:05:04 +0000 (18:05 +0300)
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>
Wed, 15 Aug 2012 04:14:53 +0000 (01:14 -0300)
Make code more clear by moving sk and bt vars to the place where
they are actually used.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
net/bluetooth/af_bluetooth.c

index 58f9762b339aa7809554e9a7990970fff9a22231..1b88fe41f4b1de26f00ed1751500fca93c6f8e47 100644 (file)
@@ -567,8 +567,6 @@ static void bt_seq_stop(struct seq_file *seq, void *v)
 
 static int bt_seq_show(struct seq_file *seq, void *v)
 {
-       struct sock *sk;
-       struct bt_sock *bt;
        struct bt_seq_state *s = seq->private;
        struct bt_sock_list *l = s->l;
        bdaddr_t src_baswapped, dst_baswapped;
@@ -583,8 +581,8 @@ static int bt_seq_show(struct seq_file *seq, void *v)
 
                seq_putc(seq, '\n');
        } else {
-               sk = sk_entry(v);
-               bt = bt_sk(sk);
+               struct sock *sk = sk_entry(v);
+               struct bt_sock *bt = bt_sk(sk);
                baswap(&src_baswapped, &bt->src);
                baswap(&dst_baswapped, &bt->dst);