Skip to content

Commit

Permalink
Bluetooth: Fix coding style in the subsystem
Browse files Browse the repository at this point in the history
This is some leftover from the last patches that fixed style. It is mostly
line over 80 characters fixes reported by checkpatch.pl.
checkpatch.pl is clean for these files now.

Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
Gustavo Padovan authored and Johan Hedberg committed Jun 5, 2012
1 parent c3c7ea6 commit 8fc9ced
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 27 deletions.
3 changes: 2 additions & 1 deletion net/bluetooth/af_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ static inline unsigned int bt_accept_poll(struct sock *parent)
return 0;
}

unsigned int bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait)
unsigned int bt_sock_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk;
unsigned int mask = 0;
Expand Down
3 changes: 2 additions & 1 deletion net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src)
read_lock(&hci_dev_list_lock);

list_for_each_entry(d, &hci_dev_list, list) {
if (!test_bit(HCI_UP, &d->flags) || test_bit(HCI_RAW, &d->flags))
if (!test_bit(HCI_UP, &d->flags) ||
test_bit(HCI_RAW, &d->flags))
continue;

/* Simple routing:
Expand Down
7 changes: 5 additions & 2 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ int hci_inquiry(void __user *arg)
goto done;
}

/* for unlimited number of responses we will use buffer with 255 entries */
/* for unlimited number of responses we will use buffer with
* 255 entries
*/
max_rsp = (ir.num_rsp == 0) ? 255 : ir.num_rsp;

/* cache_dump can't sleep. Therefore we allocate temp buffer and then
Expand Down Expand Up @@ -2610,7 +2612,8 @@ static void hci_sched_esco(struct hci_dev *hdev)
if (!hci_conn_num(hdev, ESCO_LINK))
return;

while (hdev->sco_cnt && (conn = hci_low_sent(hdev, ESCO_LINK, &quote))) {
while (hdev->sco_cnt && (conn = hci_low_sent(hdev, ESCO_LINK,
&quote))) {
while (quote-- && (skb = skb_dequeue(&conn->data_q))) {
BT_DBG("skb %p len %d", skb, skb->len);
hci_send_frame(skb);
Expand Down
23 changes: 14 additions & 9 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ static void hci_cc_read_voice_setting(struct hci_dev *hdev, struct sk_buff *skb)
hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING);
}

static void hci_cc_write_voice_setting(struct hci_dev *hdev, struct sk_buff *skb)
static void hci_cc_write_voice_setting(struct hci_dev *hdev,
struct sk_buff *skb)
{
__u8 status = *((__u8 *) skb->data);
__u16 setting;
Expand Down Expand Up @@ -648,7 +649,8 @@ static void hci_setup_link_policy(struct hci_dev *hdev)
hci_send_cmd(hdev, HCI_OP_WRITE_DEF_LINK_POLICY, sizeof(cp), &cp);
}

static void hci_cc_read_local_commands(struct hci_dev *hdev, struct sk_buff *skb)
static void hci_cc_read_local_commands(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_rp_read_local_commands *rp = (void *) skb->data;

Expand All @@ -666,7 +668,8 @@ static void hci_cc_read_local_commands(struct hci_dev *hdev, struct sk_buff *skb
hci_req_complete(hdev, HCI_OP_READ_LOCAL_COMMANDS, rp->status);
}

static void hci_cc_read_local_features(struct hci_dev *hdev, struct sk_buff *skb)
static void hci_cc_read_local_features(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_rp_read_local_features *rp = (void *) skb->data;

Expand Down Expand Up @@ -1845,7 +1848,8 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
if (ie)
memcpy(ie->data.dev_class, ev->dev_class, 3);

conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
conn = hci_conn_hash_lookup_ba(hdev, ev->link_type,
&ev->bdaddr);
if (!conn) {
conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr);
if (!conn) {
Expand Down Expand Up @@ -2623,7 +2627,8 @@ static void hci_mode_change_evt(struct hci_dev *hdev, struct sk_buff *skb)
conn->mode = ev->mode;
conn->interval = __le16_to_cpu(ev->interval);

if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->flags)) {
if (!test_and_clear_bit(HCI_CONN_MODE_CHANGE_PEND,
&conn->flags)) {
if (conn->mode == HCI_CM_ACTIVE)
set_bit(HCI_CONN_POWER_SAVE, &conn->flags);
else
Expand Down Expand Up @@ -2714,8 +2719,8 @@ static void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff *skb)

if (key->type == HCI_LK_COMBINATION && key->pin_len < 16 &&
conn->pending_sec_level == BT_SECURITY_HIGH) {
BT_DBG("%s ignoring key unauthenticated for high \
security", hdev->name);
BT_DBG("%s ignoring key unauthenticated for high security",
hdev->name);
goto not_found;
}

Expand Down Expand Up @@ -3097,8 +3102,8 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
conn->auth_type = hci_get_auth_req(conn);
cp.authentication = conn->auth_type;

if ((conn->out || test_bit(HCI_CONN_REMOTE_OOB, &conn->flags)) &&
hci_find_remote_oob_data(hdev, &conn->dst))
if (hci_find_remote_oob_data(hdev, &conn->dst) &&
(conn->out || test_bit(HCI_CONN_REMOTE_OOB, &conn->flags)))
cp.oob_data = 0x01;
else
cp.oob_data = 0x00;
Expand Down
21 changes: 14 additions & 7 deletions net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb)
struct hci_mon_hdr *hdr;

/* Create a private copy with headroom */
skb_copy = __pskb_copy(skb, HCI_MON_HDR_SIZE, GFP_ATOMIC);
skb_copy = __pskb_copy(skb, HCI_MON_HDR_SIZE,
GFP_ATOMIC);
if (!skb_copy)
continue;

Expand Down Expand Up @@ -542,7 +543,8 @@ static int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd,
}
}

static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
static int hci_sock_ioctl(struct socket *sock, unsigned int cmd,
unsigned long arg)
{
struct sock *sk = sock->sk;
void __user *argp = (void __user *) arg;
Expand Down Expand Up @@ -603,7 +605,8 @@ static int hci_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long a
}
}

static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
static int hci_sock_bind(struct socket *sock, struct sockaddr *addr,
int addr_len)
{
struct sockaddr_hci haddr;
struct sock *sk = sock->sk;
Expand Down Expand Up @@ -692,7 +695,8 @@ static int hci_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
return err;
}

static int hci_sock_getname(struct socket *sock, struct sockaddr *addr, int *addr_len, int peer)
static int hci_sock_getname(struct socket *sock, struct sockaddr *addr,
int *addr_len, int peer)
{
struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr;
struct sock *sk = sock->sk;
Expand Down Expand Up @@ -720,7 +724,8 @@ static void hci_sock_cmsg(struct sock *sk, struct msghdr *msg,

if (mask & HCI_CMSG_DIR) {
int incoming = bt_cb(skb)->incoming;
put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(incoming), &incoming);
put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(incoming),
&incoming);
}

if (mask & HCI_CMSG_TSTAMP) {
Expand Down Expand Up @@ -895,7 +900,8 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
goto done;
}

static int hci_sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int len)
static int hci_sock_setsockopt(struct socket *sock, int level, int optname,
char __user *optval, unsigned int len)
{
struct hci_ufilter uf = { .opcode = 0 };
struct sock *sk = sock->sk;
Expand Down Expand Up @@ -977,7 +983,8 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname, char
return err;
}

static int hci_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
static int hci_sock_getsockopt(struct socket *sock, int level, int optname,
char __user *optval, int __user *optlen)
{
struct hci_ufilter uf;
struct sock *sk = sock->sk;
Expand Down
4 changes: 2 additions & 2 deletions net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ static ssize_t show_class(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hci_dev *hdev = to_hci_dev(dev);
return sprintf(buf, "0x%.2x%.2x%.2x\n",
hdev->dev_class[2], hdev->dev_class[1], hdev->dev_class[0]);
return sprintf(buf, "0x%.2x%.2x%.2x\n", hdev->dev_class[2],
hdev->dev_class[1], hdev->dev_class[0]);
}

static ssize_t show_address(struct device *dev,
Expand Down
2 changes: 1 addition & 1 deletion net/bluetooth/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/string.h>
#include <asm/errno.h>
#include <linux/errno.h>

#include <net/bluetooth/bluetooth.h>

Expand Down
12 changes: 8 additions & 4 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode,
}

static void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev,
void (*cb)(struct pending_cmd *cmd, void *data),
void (*cb)(struct pending_cmd *cmd,
void *data),
void *data)
{
struct list_head *p, *n;
Expand Down Expand Up @@ -1594,7 +1595,8 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data,
}

if (cp->addr.type == BDADDR_BREDR)
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->addr.bdaddr);
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK,
&cp->addr.bdaddr);
else
conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->addr.bdaddr);

Expand Down Expand Up @@ -3226,7 +3228,8 @@ int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
u8 link_type, u8 addr_type, u8 status)
{
return user_pairing_resp_complete(hdev, bdaddr, link_type, addr_type,
status, MGMT_OP_USER_CONFIRM_NEG_REPLY);
status,
MGMT_OP_USER_CONFIRM_NEG_REPLY);
}

int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
Expand All @@ -3240,7 +3243,8 @@ int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
u8 link_type, u8 addr_type, u8 status)
{
return user_pairing_resp_complete(hdev, bdaddr, link_type, addr_type,
status, MGMT_OP_USER_PASSKEY_NEG_REPLY);
status,
MGMT_OP_USER_PASSKEY_NEG_REPLY);
}

int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
Expand Down

0 comments on commit 8fc9ced

Please sign in to comment.