NFC: NCI code identation fixes

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Samuel Ortiz 2012-03-05 01:03:54 +01:00 committed by John W. Linville
parent 0a40acb246
commit eb9bc6e9a0
5 changed files with 116 additions and 127 deletions

View file

@ -67,8 +67,7 @@ static void nci_req_cancel(struct nci_dev *ndev, int err)
/* Execute request and wait for completion. */ /* Execute request and wait for completion. */
static int __nci_request(struct nci_dev *ndev, static int __nci_request(struct nci_dev *ndev,
void (*req)(struct nci_dev *ndev, unsigned long opt), void (*req)(struct nci_dev *ndev, unsigned long opt),
unsigned long opt, unsigned long opt, __u32 timeout)
__u32 timeout)
{ {
int rc = 0; int rc = 0;
long completion_rc; long completion_rc;
@ -77,8 +76,8 @@ static int __nci_request(struct nci_dev *ndev,
init_completion(&ndev->req_completion); init_completion(&ndev->req_completion);
req(ndev, opt); req(ndev, opt);
completion_rc = wait_for_completion_interruptible_timeout( completion_rc =
&ndev->req_completion, wait_for_completion_interruptible_timeout(&ndev->req_completion,
timeout); timeout);
pr_debug("wait_for_completion return %ld\n", completion_rc); pr_debug("wait_for_completion return %ld\n", completion_rc);
@ -110,7 +109,8 @@ static int __nci_request(struct nci_dev *ndev,
} }
static inline int nci_request(struct nci_dev *ndev, static inline int nci_request(struct nci_dev *ndev,
void (*req)(struct nci_dev *ndev, unsigned long opt), void (*req)(struct nci_dev *ndev,
unsigned long opt),
unsigned long opt, __u32 timeout) unsigned long opt, __u32 timeout)
{ {
int rc; int rc;
@ -172,8 +172,7 @@ static void nci_init_complete_req(struct nci_dev *ndev, unsigned long opt)
} }
nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_MAP_CMD, nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_MAP_CMD,
(1 + ((*num)*sizeof(struct disc_map_config))), (1 + ((*num) * sizeof(struct disc_map_config))), &cmd);
&cmd);
} }
static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt) static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt)
@ -212,7 +211,7 @@ static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt)
} }
nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_CMD, nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_CMD,
(1 + (cmd.num_disc_configs*sizeof(struct disc_config))), (1 + (cmd.num_disc_configs * sizeof(struct disc_config))),
&cmd); &cmd);
} }
@ -245,8 +244,7 @@ static void nci_rf_discover_select_req(struct nci_dev *ndev, unsigned long opt)
} }
nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_SELECT_CMD, nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_SELECT_CMD,
sizeof(struct nci_rf_discover_select_cmd), sizeof(struct nci_rf_discover_select_cmd), &cmd);
&cmd);
} }
static void nci_rf_deactivate_req(struct nci_dev *ndev, unsigned long opt) static void nci_rf_deactivate_req(struct nci_dev *ndev, unsigned long opt)
@ -256,8 +254,7 @@ static void nci_rf_deactivate_req(struct nci_dev *ndev, unsigned long opt)
cmd.type = NCI_DEACTIVATE_TYPE_IDLE_MODE; cmd.type = NCI_DEACTIVATE_TYPE_IDLE_MODE;
nci_send_cmd(ndev, NCI_OP_RF_DEACTIVATE_CMD, nci_send_cmd(ndev, NCI_OP_RF_DEACTIVATE_CMD,
sizeof(struct nci_rf_deactivate_cmd), sizeof(struct nci_rf_deactivate_cmd), &cmd);
&cmd);
} }
static int nci_open_device(struct nci_dev *ndev) static int nci_open_device(struct nci_dev *ndev)
@ -525,8 +522,7 @@ static void nci_deactivate_target(struct nfc_dev *nfc_dev, __u32 target_idx)
static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx, static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx,
struct sk_buff *skb, struct sk_buff *skb,
data_exchange_cb_t cb, data_exchange_cb_t cb, void *cb_context)
void *cb_context)
{ {
struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); struct nci_dev *ndev = nfc_get_drvdata(nfc_dev);
int rc; int rc;
@ -572,8 +568,7 @@ static struct nfc_ops nci_nfc_ops = {
*/ */
struct nci_dev *nci_allocate_device(struct nci_ops *ops, struct nci_dev *nci_allocate_device(struct nci_ops *ops,
__u32 supported_protocols, __u32 supported_protocols,
int tx_headroom, int tx_headroom, int tx_tailroom)
int tx_tailroom)
{ {
struct nci_dev *ndev; struct nci_dev *ndev;

View file

@ -35,8 +35,7 @@
#include <linux/nfc.h> #include <linux/nfc.h>
/* Complete data exchange transaction and forward skb to nfc core */ /* Complete data exchange transaction and forward skb to nfc core */
void nci_data_exchange_complete(struct nci_dev *ndev, void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
struct sk_buff *skb,
int err) int err)
{ {
data_exchange_cb_t cb = ndev->data_exchange_cb; data_exchange_cb_t cb = ndev->data_exchange_cb;
@ -118,7 +117,8 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev,
/* second, set the header */ /* second, set the header */
nci_push_data_hdr(ndev, conn_id, skb_frag, nci_push_data_hdr(ndev, conn_id, skb_frag,
((total_len == frag_len) ? (NCI_PBF_LAST) : (NCI_PBF_CONT))); ((total_len == frag_len) ?
(NCI_PBF_LAST) : (NCI_PBF_CONT)));
__skb_queue_tail(&frags_q, skb_frag); __skb_queue_tail(&frags_q, skb_frag);

View file

@ -335,20 +335,17 @@ static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev,
pr_debug("rats_res_len %d\n", nfca_poll->rats_res_len); pr_debug("rats_res_len %d\n", nfca_poll->rats_res_len);
if (nfca_poll->rats_res_len > 0) { if (nfca_poll->rats_res_len > 0) {
memcpy(nfca_poll->rats_res, memcpy(nfca_poll->rats_res,
data, data, nfca_poll->rats_res_len);
nfca_poll->rats_res_len);
} }
break; break;
case NCI_NFC_B_PASSIVE_POLL_MODE: case NCI_NFC_B_PASSIVE_POLL_MODE:
nfcb_poll = &ntf->activation_params.nfcb_poll_iso_dep; nfcb_poll = &ntf->activation_params.nfcb_poll_iso_dep;
nfcb_poll->attrib_res_len = *data++; nfcb_poll->attrib_res_len = *data++;
pr_debug("attrib_res_len %d\n", pr_debug("attrib_res_len %d\n", nfcb_poll->attrib_res_len);
nfcb_poll->attrib_res_len);
if (nfcb_poll->attrib_res_len > 0) { if (nfcb_poll->attrib_res_len > 0) {
memcpy(nfcb_poll->attrib_res, memcpy(nfcb_poll->attrib_res,
data, data, nfcb_poll->attrib_res_len);
nfcb_poll->attrib_res_len);
} }
break; break;
@ -405,7 +402,8 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
ntf.activation_rf_tech_and_mode); ntf.activation_rf_tech_and_mode);
pr_debug("max_data_pkt_payload_size 0x%x\n", pr_debug("max_data_pkt_payload_size 0x%x\n",
ntf.max_data_pkt_payload_size); ntf.max_data_pkt_payload_size);
pr_debug("initial_num_credits 0x%x\n", ntf.initial_num_credits); pr_debug("initial_num_credits 0x%x\n",
ntf.initial_num_credits);
pr_debug("rf_tech_specific_params_len %d\n", pr_debug("rf_tech_specific_params_len %d\n",
ntf.rf_tech_specific_params_len); ntf.rf_tech_specific_params_len);
@ -441,12 +439,9 @@ static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
pr_debug("data_exch_rf_tech_and_mode 0x%x\n", pr_debug("data_exch_rf_tech_and_mode 0x%x\n",
ntf.data_exch_rf_tech_and_mode); ntf.data_exch_rf_tech_and_mode);
pr_debug("data_exch_tx_bit_rate 0x%x\n", pr_debug("data_exch_tx_bit_rate 0x%x\n", ntf.data_exch_tx_bit_rate);
ntf.data_exch_tx_bit_rate); pr_debug("data_exch_rx_bit_rate 0x%x\n", ntf.data_exch_rx_bit_rate);
pr_debug("data_exch_rx_bit_rate 0x%x\n", pr_debug("activation_params_len %d\n", ntf.activation_params_len);
ntf.data_exch_rx_bit_rate);
pr_debug("activation_params_len %d\n",
ntf.activation_params_len);
if (ntf.activation_params_len > 0) { if (ntf.activation_params_len > 0) {
switch (ntf.rf_interface) { switch (ntf.rf_interface) {

View file

@ -78,8 +78,7 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
rsp_2 = (void *) (skb->data + 6 + rsp_1->num_supported_rf_interfaces); rsp_2 = (void *) (skb->data + 6 + rsp_1->num_supported_rf_interfaces);
ndev->max_logical_connections = ndev->max_logical_connections = rsp_2->max_logical_connections;
rsp_2->max_logical_connections;
ndev->max_routing_table_size = ndev->max_routing_table_size =
__le16_to_cpu(rsp_2->max_routing_table_size); __le16_to_cpu(rsp_2->max_routing_table_size);
ndev->max_ctrl_pkt_payload_len = ndev->max_ctrl_pkt_payload_len =