Skip to content

Commit

Permalink
Bluetooth: Fix some obvious coding style issues in the SCO module
Browse files Browse the repository at this point in the history
Lets fix this obvious coding style issues in the SCO module and bring it
in line with the rest of the Bluetooth subsystem.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Oct 26, 2015
1 parent 05fcd4c commit c4297e8
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions net/bluetooth/sco.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct sco_pinfo {

static void sco_sock_timeout(unsigned long arg)
{
struct sock *sk = (struct sock *) arg;
struct sock *sk = (struct sock *)arg;

BT_DBG("sock %p state %d", sk, sk->sk_state);

Expand Down Expand Up @@ -183,7 +183,8 @@ static void sco_conn_del(struct hci_conn *hcon, int err)
kfree(conn);
}

static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent)
static void __sco_chan_add(struct sco_conn *conn, struct sock *sk,
struct sock *parent)
{
BT_DBG("conn %p", conn);

Expand Down Expand Up @@ -463,7 +464,8 @@ static struct proto sco_proto = {
.obj_size = sizeof(struct sco_pinfo)
};

static struct sock *sco_sock_alloc(struct net *net, struct socket *sock, int proto, gfp_t prio, int kern)
static struct sock *sco_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio, int kern)
{
struct sock *sk;

Expand Down Expand Up @@ -512,7 +514,8 @@ static int sco_sock_create(struct net *net, struct socket *sock, int protocol,
return 0;
}

static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
static int sco_sock_bind(struct socket *sock, struct sockaddr *addr,
int addr_len)
{
struct sockaddr_sco *sa = (struct sockaddr_sco *) addr;
struct sock *sk = sock->sk;
Expand Down Expand Up @@ -619,7 +622,8 @@ static int sco_sock_listen(struct socket *sock, int backlog)
return err;
}

static int sco_sock_accept(struct socket *sock, struct socket *newsock, int flags)
static int sco_sock_accept(struct socket *sock, struct socket *newsock,
int flags)
{
DEFINE_WAIT_FUNC(wait, woken_wake_function);
struct sock *sk = sock->sk, *ch;
Expand Down Expand Up @@ -673,7 +677,8 @@ static int sco_sock_accept(struct socket *sock, struct socket *newsock, int flag
return err;
}

static int sco_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
static int sco_sock_getname(struct socket *sock, struct sockaddr *addr,
int *len, int peer)
{
struct sockaddr_sco *sa = (struct sockaddr_sco *) addr;
struct sock *sk = sock->sk;
Expand Down Expand Up @@ -783,7 +788,8 @@ static int sco_sock_recvmsg(struct socket *sock, struct msghdr *msg,
return bt_sock_recvmsg(sock, msg, len, flags);
}

static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen)
static int sco_sock_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int len, err = 0;
Expand Down Expand Up @@ -823,7 +829,7 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char
voice.setting = sco_pi(sk)->setting;

len = min_t(unsigned int, sizeof(voice), optlen);
if (copy_from_user((char *) &voice, optval, len)) {
if (copy_from_user((char *)&voice, optval, len)) {
err = -EFAULT;
break;
}
Expand All @@ -847,7 +853,8 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char
return err;
}

static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user *optval, int __user *optlen)
static int sco_sock_getsockopt_old(struct socket *sock, int optname,
char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
struct sco_options opts;
Expand Down Expand Up @@ -907,7 +914,8 @@ static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __user
return err;
}

static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
static int sco_sock_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
int len, err = 0;
Expand All @@ -932,7 +940,7 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char
}

if (put_user(test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags),
(u32 __user *) optval))
(u32 __user *)optval))
err = -EFAULT;

break;
Expand Down

0 comments on commit c4297e8

Please sign in to comment.