Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: NCI code identation fixes

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Samuel Ortiz and committed by
John W. Linville
eb9bc6e9 0a40acb2

+116 -127
+5 -5
include/net/nfc/nci_core.h
··· 141 141 142 142 /* ----- NCI Devices ----- */ 143 143 struct nci_dev *nci_allocate_device(struct nci_ops *ops, 144 - __u32 supported_protocols, 145 - int tx_headroom, 146 - int tx_tailroom); 144 + __u32 supported_protocols, 145 + int tx_headroom, 146 + int tx_tailroom); 147 147 void nci_free_device(struct nci_dev *ndev); 148 148 int nci_register_device(struct nci_dev *ndev); 149 149 void nci_unregister_device(struct nci_dev *ndev); 150 150 int nci_recv_frame(struct sk_buff *skb); 151 151 152 152 static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 153 - unsigned int len, 154 - gfp_t how) 153 + unsigned int len, 154 + gfp_t how) 155 155 { 156 156 struct sk_buff *skb; 157 157
+54 -59
net/nfc/nci/core.c
··· 66 66 67 67 /* Execute request and wait for completion. */ 68 68 static int __nci_request(struct nci_dev *ndev, 69 - void (*req)(struct nci_dev *ndev, unsigned long opt), 70 - unsigned long opt, 71 - __u32 timeout) 69 + void (*req)(struct nci_dev *ndev, unsigned long opt), 70 + unsigned long opt, __u32 timeout) 72 71 { 73 72 int rc = 0; 74 73 long completion_rc; ··· 76 77 77 78 init_completion(&ndev->req_completion); 78 79 req(ndev, opt); 79 - completion_rc = wait_for_completion_interruptible_timeout( 80 - &ndev->req_completion, 81 - timeout); 80 + completion_rc = 81 + wait_for_completion_interruptible_timeout(&ndev->req_completion, 82 + timeout); 82 83 83 84 pr_debug("wait_for_completion return %ld\n", completion_rc); 84 85 ··· 109 110 } 110 111 111 112 static inline int nci_request(struct nci_dev *ndev, 112 - void (*req)(struct nci_dev *ndev, unsigned long opt), 113 - unsigned long opt, __u32 timeout) 113 + void (*req)(struct nci_dev *ndev, 114 + unsigned long opt), 115 + unsigned long opt, __u32 timeout) 114 116 { 115 117 int rc; 116 118 ··· 152 152 /* by default mapping is set to NCI_RF_INTERFACE_FRAME */ 153 153 for (i = 0; i < ndev->num_supported_rf_interfaces; i++) { 154 154 if (ndev->supported_rf_interfaces[i] == 155 - NCI_RF_INTERFACE_ISO_DEP) { 155 + NCI_RF_INTERFACE_ISO_DEP) { 156 156 cfg[*num].rf_protocol = NCI_RF_PROTOCOL_ISO_DEP; 157 157 cfg[*num].mode = NCI_DISC_MAP_MODE_POLL | 158 158 NCI_DISC_MAP_MODE_LISTEN; 159 159 cfg[*num].rf_interface = NCI_RF_INTERFACE_ISO_DEP; 160 160 (*num)++; 161 161 } else if (ndev->supported_rf_interfaces[i] == 162 - NCI_RF_INTERFACE_NFC_DEP) { 162 + NCI_RF_INTERFACE_NFC_DEP) { 163 163 cfg[*num].rf_protocol = NCI_RF_PROTOCOL_NFC_DEP; 164 164 cfg[*num].mode = NCI_DISC_MAP_MODE_POLL | 165 165 NCI_DISC_MAP_MODE_LISTEN; ··· 172 172 } 173 173 174 174 nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_MAP_CMD, 175 - (1 + ((*num)*sizeof(struct disc_map_config))), 176 - &cmd); 175 + (1 + ((*num) * sizeof(struct disc_map_config))), &cmd); 177 176 } 178 177 179 178 static void nci_rf_discover_req(struct nci_dev *ndev, unsigned long opt) ··· 183 184 cmd.num_disc_configs = 0; 184 185 185 186 if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && 186 - (protocols & NFC_PROTO_JEWEL_MASK 187 - || protocols & NFC_PROTO_MIFARE_MASK 188 - || protocols & NFC_PROTO_ISO14443_MASK 189 - || protocols & NFC_PROTO_NFC_DEP_MASK)) { 187 + (protocols & NFC_PROTO_JEWEL_MASK 188 + || protocols & NFC_PROTO_MIFARE_MASK 189 + || protocols & NFC_PROTO_ISO14443_MASK 190 + || protocols & NFC_PROTO_NFC_DEP_MASK)) { 190 191 cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = 191 - NCI_NFC_A_PASSIVE_POLL_MODE; 192 + NCI_NFC_A_PASSIVE_POLL_MODE; 192 193 cmd.disc_configs[cmd.num_disc_configs].frequency = 1; 193 194 cmd.num_disc_configs++; 194 195 } 195 196 196 197 if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && 197 - (protocols & NFC_PROTO_ISO14443_MASK)) { 198 + (protocols & NFC_PROTO_ISO14443_MASK)) { 198 199 cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = 199 - NCI_NFC_B_PASSIVE_POLL_MODE; 200 + NCI_NFC_B_PASSIVE_POLL_MODE; 200 201 cmd.disc_configs[cmd.num_disc_configs].frequency = 1; 201 202 cmd.num_disc_configs++; 202 203 } 203 204 204 205 if ((cmd.num_disc_configs < NCI_MAX_NUM_RF_CONFIGS) && 205 - (protocols & NFC_PROTO_FELICA_MASK 206 - || protocols & NFC_PROTO_NFC_DEP_MASK)) { 206 + (protocols & NFC_PROTO_FELICA_MASK 207 + || protocols & NFC_PROTO_NFC_DEP_MASK)) { 207 208 cmd.disc_configs[cmd.num_disc_configs].rf_tech_and_mode = 208 - NCI_NFC_F_PASSIVE_POLL_MODE; 209 + NCI_NFC_F_PASSIVE_POLL_MODE; 209 210 cmd.disc_configs[cmd.num_disc_configs].frequency = 1; 210 211 cmd.num_disc_configs++; 211 212 } 212 213 213 214 nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_CMD, 214 - (1 + (cmd.num_disc_configs*sizeof(struct disc_config))), 215 - &cmd); 215 + (1 + (cmd.num_disc_configs * sizeof(struct disc_config))), 216 + &cmd); 216 217 } 217 218 218 219 struct nci_rf_discover_select_param { ··· 223 224 static void nci_rf_discover_select_req(struct nci_dev *ndev, unsigned long opt) 224 225 { 225 226 struct nci_rf_discover_select_param *param = 226 - (struct nci_rf_discover_select_param *)opt; 227 + (struct nci_rf_discover_select_param *)opt; 227 228 struct nci_rf_discover_select_cmd cmd; 228 229 229 230 cmd.rf_discovery_id = param->rf_discovery_id; ··· 244 245 } 245 246 246 247 nci_send_cmd(ndev, NCI_OP_RF_DISCOVER_SELECT_CMD, 247 - sizeof(struct nci_rf_discover_select_cmd), 248 - &cmd); 248 + sizeof(struct nci_rf_discover_select_cmd), &cmd); 249 249 } 250 250 251 251 static void nci_rf_deactivate_req(struct nci_dev *ndev, unsigned long opt) ··· 254 256 cmd.type = NCI_DEACTIVATE_TYPE_IDLE_MODE; 255 257 256 258 nci_send_cmd(ndev, NCI_OP_RF_DEACTIVATE_CMD, 257 - sizeof(struct nci_rf_deactivate_cmd), 258 - &cmd); 259 + sizeof(struct nci_rf_deactivate_cmd), &cmd); 259 260 } 260 261 261 262 static int nci_open_device(struct nci_dev *ndev) ··· 278 281 set_bit(NCI_INIT, &ndev->flags); 279 282 280 283 rc = __nci_request(ndev, nci_reset_req, 0, 281 - msecs_to_jiffies(NCI_RESET_TIMEOUT)); 284 + msecs_to_jiffies(NCI_RESET_TIMEOUT)); 282 285 283 286 if (!rc) { 284 287 rc = __nci_request(ndev, nci_init_req, 0, 285 - msecs_to_jiffies(NCI_INIT_TIMEOUT)); 288 + msecs_to_jiffies(NCI_INIT_TIMEOUT)); 286 289 } 287 290 288 291 if (!rc) { 289 292 rc = __nci_request(ndev, nci_init_complete_req, 0, 290 - msecs_to_jiffies(NCI_INIT_TIMEOUT)); 293 + msecs_to_jiffies(NCI_INIT_TIMEOUT)); 291 294 } 292 295 293 296 clear_bit(NCI_INIT, &ndev->flags); ··· 337 340 338 341 set_bit(NCI_INIT, &ndev->flags); 339 342 __nci_request(ndev, nci_reset_req, 0, 340 - msecs_to_jiffies(NCI_RESET_TIMEOUT)); 343 + msecs_to_jiffies(NCI_RESET_TIMEOUT)); 341 344 clear_bit(NCI_INIT, &ndev->flags); 342 345 343 346 /* Flush cmd wq */ ··· 393 396 int rc; 394 397 395 398 if ((atomic_read(&ndev->state) == NCI_DISCOVERY) || 396 - (atomic_read(&ndev->state) == NCI_W4_ALL_DISCOVERIES)) { 399 + (atomic_read(&ndev->state) == NCI_W4_ALL_DISCOVERIES)) { 397 400 pr_err("unable to start poll, since poll is already active\n"); 398 401 return -EBUSY; 399 402 } ··· 404 407 } 405 408 406 409 if ((atomic_read(&ndev->state) == NCI_W4_HOST_SELECT) || 407 - (atomic_read(&ndev->state) == NCI_POLL_ACTIVE)) { 410 + (atomic_read(&ndev->state) == NCI_POLL_ACTIVE)) { 408 411 pr_debug("target active or w4 select, implicitly deactivate\n"); 409 412 410 413 rc = nci_request(ndev, nci_rf_deactivate_req, 0, 411 - msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 414 + msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 412 415 if (rc) 413 416 return -EBUSY; 414 417 } 415 418 416 419 rc = nci_request(ndev, nci_rf_discover_req, protocols, 417 - msecs_to_jiffies(NCI_RF_DISC_TIMEOUT)); 420 + msecs_to_jiffies(NCI_RF_DISC_TIMEOUT)); 418 421 419 422 if (!rc) 420 423 ndev->poll_prots = protocols; ··· 427 430 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); 428 431 429 432 if ((atomic_read(&ndev->state) != NCI_DISCOVERY) && 430 - (atomic_read(&ndev->state) != NCI_W4_ALL_DISCOVERIES)) { 433 + (atomic_read(&ndev->state) != NCI_W4_ALL_DISCOVERIES)) { 431 434 pr_err("unable to stop poll, since poll is not active\n"); 432 435 return; 433 436 } 434 437 435 438 nci_request(ndev, nci_rf_deactivate_req, 0, 436 - msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 439 + msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 437 440 } 438 441 439 442 static int nci_activate_target(struct nfc_dev *nfc_dev, __u32 target_idx, 440 - __u32 protocol) 443 + __u32 protocol) 441 444 { 442 445 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); 443 446 struct nci_rf_discover_select_param param; ··· 448 451 pr_debug("target_idx %d, protocol 0x%x\n", target_idx, protocol); 449 452 450 453 if ((atomic_read(&ndev->state) != NCI_W4_HOST_SELECT) && 451 - (atomic_read(&ndev->state) != NCI_POLL_ACTIVE)) { 454 + (atomic_read(&ndev->state) != NCI_POLL_ACTIVE)) { 452 455 pr_err("there is no available target to activate\n"); 453 456 return -EINVAL; 454 457 } ··· 491 494 param.rf_protocol = NCI_RF_PROTOCOL_NFC_DEP; 492 495 493 496 rc = nci_request(ndev, nci_rf_discover_select_req, 494 - (unsigned long)&param, 495 - msecs_to_jiffies(NCI_RF_DISC_SELECT_TIMEOUT)); 497 + (unsigned long)&param, 498 + msecs_to_jiffies(NCI_RF_DISC_SELECT_TIMEOUT)); 496 499 } 497 500 498 501 if (!rc) ··· 516 519 517 520 if (atomic_read(&ndev->state) == NCI_POLL_ACTIVE) { 518 521 nci_request(ndev, nci_rf_deactivate_req, 0, 519 - msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 522 + msecs_to_jiffies(NCI_RF_DEACTIVATE_TIMEOUT)); 520 523 } 521 524 } 522 525 523 526 static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx, 524 - struct sk_buff *skb, 525 - data_exchange_cb_t cb, 526 - void *cb_context) 527 + struct sk_buff *skb, 528 + data_exchange_cb_t cb, void *cb_context) 527 529 { 528 530 struct nci_dev *ndev = nfc_get_drvdata(nfc_dev); 529 531 int rc; ··· 567 571 * @supported_protocols: NFC protocols supported by the device 568 572 */ 569 573 struct nci_dev *nci_allocate_device(struct nci_ops *ops, 570 - __u32 supported_protocols, 571 - int tx_headroom, 572 - int tx_tailroom) 574 + __u32 supported_protocols, 575 + int tx_headroom, int tx_tailroom) 573 576 { 574 577 struct nci_dev *ndev; 575 578 ··· 589 594 ndev->tx_tailroom = tx_tailroom; 590 595 591 596 ndev->nfc_dev = nfc_allocate_device(&nci_nfc_ops, 592 - supported_protocols, 593 - tx_headroom + NCI_DATA_HDR_SIZE, 594 - tx_tailroom); 597 + supported_protocols, 598 + tx_headroom + NCI_DATA_HDR_SIZE, 599 + tx_tailroom); 595 600 if (!ndev->nfc_dev) 596 601 goto free_exit; 597 602 ··· 663 668 skb_queue_head_init(&ndev->tx_q); 664 669 665 670 setup_timer(&ndev->cmd_timer, nci_cmd_timer, 666 - (unsigned long) ndev); 671 + (unsigned long) ndev); 667 672 setup_timer(&ndev->data_timer, nci_data_timer, 668 - (unsigned long) ndev); 673 + (unsigned long) ndev); 669 674 670 675 mutex_init(&ndev->req_lock); 671 676 ··· 714 719 pr_debug("len %d\n", skb->len); 715 720 716 721 if (!ndev || (!test_bit(NCI_UP, &ndev->flags) 717 - && !test_bit(NCI_INIT, &ndev->flags))) { 722 + && !test_bit(NCI_INIT, &ndev->flags))) { 718 723 kfree_skb(skb); 719 724 return -ENXIO; 720 725 } ··· 794 799 795 800 /* Check if data flow control is used */ 796 801 if (atomic_read(&ndev->credits_cnt) != 797 - NCI_DATA_FLOW_CONTROL_NOT_USED) 802 + NCI_DATA_FLOW_CONTROL_NOT_USED) 798 803 atomic_dec(&ndev->credits_cnt); 799 804 800 805 pr_debug("NCI TX: MT=data, PBF=%d, conn_id=%d, plen=%d\n", ··· 805 810 nci_send_frame(skb); 806 811 807 812 mod_timer(&ndev->data_timer, 808 - jiffies + msecs_to_jiffies(NCI_DATA_TIMEOUT)); 813 + jiffies + msecs_to_jiffies(NCI_DATA_TIMEOUT)); 809 814 } 810 815 } 811 816 ··· 874 879 nci_send_frame(skb); 875 880 876 881 mod_timer(&ndev->cmd_timer, 877 - jiffies + msecs_to_jiffies(NCI_CMD_TIMEOUT)); 882 + jiffies + msecs_to_jiffies(NCI_CMD_TIMEOUT)); 878 883 } 879 884 }
+14 -14
net/nfc/nci/data.c
··· 35 35 #include <linux/nfc.h> 36 36 37 37 /* Complete data exchange transaction and forward skb to nfc core */ 38 - void nci_data_exchange_complete(struct nci_dev *ndev, 39 - struct sk_buff *skb, 38 + void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb, 40 39 int err) 41 40 { 42 41 data_exchange_cb_t cb = ndev->data_exchange_cb; ··· 66 67 /* ----------------- NCI TX Data ----------------- */ 67 68 68 69 static inline void nci_push_data_hdr(struct nci_dev *ndev, 69 - __u8 conn_id, 70 - struct sk_buff *skb, 71 - __u8 pbf) 70 + __u8 conn_id, 71 + struct sk_buff *skb, 72 + __u8 pbf) 72 73 { 73 74 struct nci_data_hdr *hdr; 74 75 int plen = skb->len; ··· 85 86 } 86 87 87 88 static int nci_queue_tx_data_frags(struct nci_dev *ndev, 88 - __u8 conn_id, 89 - struct sk_buff *skb) { 89 + __u8 conn_id, 90 + struct sk_buff *skb) { 90 91 int total_len = skb->len; 91 92 unsigned char *data = skb->data; 92 93 unsigned long flags; ··· 104 105 min_t(int, total_len, ndev->max_data_pkt_payload_size); 105 106 106 107 skb_frag = nci_skb_alloc(ndev, 107 - (NCI_DATA_HDR_SIZE + frag_len), 108 - GFP_KERNEL); 108 + (NCI_DATA_HDR_SIZE + frag_len), 109 + GFP_KERNEL); 109 110 if (skb_frag == NULL) { 110 111 rc = -ENOMEM; 111 112 goto free_exit; ··· 117 118 118 119 /* second, set the header */ 119 120 nci_push_data_hdr(ndev, conn_id, skb_frag, 120 - ((total_len == frag_len) ? (NCI_PBF_LAST) : (NCI_PBF_CONT))); 121 + ((total_len == frag_len) ? 122 + (NCI_PBF_LAST) : (NCI_PBF_CONT))); 121 123 122 124 __skb_queue_tail(&frags_q, skb_frag); 123 125 ··· 186 186 /* ----------------- NCI RX Data ----------------- */ 187 187 188 188 static void nci_add_rx_data_frag(struct nci_dev *ndev, 189 - struct sk_buff *skb, 190 - __u8 pbf) 189 + struct sk_buff *skb, 190 + __u8 pbf) 191 191 { 192 192 int reassembly_len; 193 193 int err = 0; ··· 211 211 212 212 /* second, combine the two fragments */ 213 213 memcpy(skb_push(skb, reassembly_len), 214 - ndev->rx_data_reassembly->data, 215 - reassembly_len); 214 + ndev->rx_data_reassembly->data, 215 + reassembly_len); 216 216 217 217 /* third, free old reassembly */ 218 218 kfree_skb(ndev->rx_data_reassembly);
+35 -40
net/nfc/nci/ntf.c
··· 40 40 /* Handle NCI Notification packets */ 41 41 42 42 static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev, 43 - struct sk_buff *skb) 43 + struct sk_buff *skb) 44 44 { 45 45 struct nci_core_conn_credit_ntf *ntf = (void *) skb->data; 46 46 int i; ··· 62 62 if (ntf->conn_entries[i].conn_id == NCI_STATIC_RF_CONN_ID) { 63 63 /* found static rf connection */ 64 64 atomic_add(ntf->conn_entries[i].credits, 65 - &ndev->credits_cnt); 65 + &ndev->credits_cnt); 66 66 } 67 67 } 68 68 ··· 72 72 } 73 73 74 74 static void nci_core_generic_error_ntf_packet(struct nci_dev *ndev, 75 - struct sk_buff *skb) 75 + struct sk_buff *skb) 76 76 { 77 77 __u8 status = skb->data[0]; 78 78 ··· 80 80 81 81 if (atomic_read(&ndev->state) == NCI_W4_HOST_SELECT) { 82 82 /* Activation failed, so complete the request 83 - (the state remains the same) */ 83 + (the state remains the same) */ 84 84 nci_req_complete(ndev, status); 85 85 } 86 86 } ··· 101 101 102 102 static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev, 103 103 struct rf_tech_specific_params_nfca_poll *nfca_poll, 104 - __u8 *data) 104 + __u8 *data) 105 105 { 106 106 nfca_poll->sens_res = __le16_to_cpu(*((__u16 *)data)); 107 107 data += 2; ··· 128 128 129 129 static __u8 *nci_extract_rf_params_nfcb_passive_poll(struct nci_dev *ndev, 130 130 struct rf_tech_specific_params_nfcb_poll *nfcb_poll, 131 - __u8 *data) 131 + __u8 *data) 132 132 { 133 133 nfcb_poll->sensb_res_len = *data++; 134 134 ··· 142 142 143 143 static __u8 *nci_extract_rf_params_nfcf_passive_poll(struct nci_dev *ndev, 144 144 struct rf_tech_specific_params_nfcf_poll *nfcf_poll, 145 - __u8 *data) 145 + __u8 *data) 146 146 { 147 147 nfcf_poll->bit_rate = *data++; 148 148 nfcf_poll->sensf_res_len = *data++; 149 149 150 150 pr_debug("bit_rate %d, sensf_res_len %d\n", 151 - nfcf_poll->bit_rate, nfcf_poll->sensf_res_len); 151 + nfcf_poll->bit_rate, nfcf_poll->sensf_res_len); 152 152 153 153 memcpy(nfcf_poll->sensf_res, data, nfcf_poll->sensf_res_len); 154 154 data += nfcf_poll->sensf_res_len; ··· 189 189 target->nfcid1_len = nfca_poll->nfcid1_len; 190 190 if (target->nfcid1_len > 0) { 191 191 memcpy(target->nfcid1, nfca_poll->nfcid1, 192 - target->nfcid1_len); 192 + target->nfcid1_len); 193 193 } 194 194 } else if (rf_tech_and_mode == NCI_NFC_B_PASSIVE_POLL_MODE) { 195 195 nfcb_poll = (struct rf_tech_specific_params_nfcb_poll *)params; ··· 197 197 target->sensb_res_len = nfcb_poll->sensb_res_len; 198 198 if (target->sensb_res_len > 0) { 199 199 memcpy(target->sensb_res, nfcb_poll->sensb_res, 200 - target->sensb_res_len); 200 + target->sensb_res_len); 201 201 } 202 202 } else if (rf_tech_and_mode == NCI_NFC_F_PASSIVE_POLL_MODE) { 203 203 nfcf_poll = (struct rf_tech_specific_params_nfcf_poll *)params; ··· 205 205 target->sensf_res_len = nfcf_poll->sensf_res_len; 206 206 if (target->sensf_res_len > 0) { 207 207 memcpy(target->sensf_res, nfcf_poll->sensf_res, 208 - target->sensf_res_len); 208 + target->sensf_res_len); 209 209 } 210 210 } else { 211 211 pr_err("unsupported rf_tech_and_mode 0x%x\n", rf_tech_and_mode); ··· 220 220 } 221 221 222 222 static void nci_add_new_target(struct nci_dev *ndev, 223 - struct nci_rf_discover_ntf *ntf) 223 + struct nci_rf_discover_ntf *ntf) 224 224 { 225 225 struct nfc_target *target; 226 226 int i, rc; ··· 230 230 if (target->idx == ntf->rf_discovery_id) { 231 231 /* This target already exists, add the new protocol */ 232 232 nci_add_new_protocol(ndev, target, ntf->rf_protocol, 233 - ntf->rf_tech_and_mode, 234 - &ntf->rf_tech_specific_params); 233 + ntf->rf_tech_and_mode, 234 + &ntf->rf_tech_specific_params); 235 235 return; 236 236 } 237 237 } ··· 245 245 target = &ndev->targets[ndev->n_targets]; 246 246 247 247 rc = nci_add_new_protocol(ndev, target, ntf->rf_protocol, 248 - ntf->rf_tech_and_mode, 249 - &ntf->rf_tech_specific_params); 248 + ntf->rf_tech_and_mode, 249 + &ntf->rf_tech_specific_params); 250 250 if (!rc) { 251 251 target->idx = ntf->rf_discovery_id; 252 252 ndev->n_targets++; 253 253 254 254 pr_debug("target_idx %d, n_targets %d\n", target->idx, 255 - ndev->n_targets); 255 + ndev->n_targets); 256 256 } 257 257 } 258 258 259 259 void nci_clear_target_list(struct nci_dev *ndev) 260 260 { 261 261 memset(ndev->targets, 0, 262 - (sizeof(struct nfc_target)*NCI_MAX_DISCOVERED_TARGETS)); 262 + (sizeof(struct nfc_target)*NCI_MAX_DISCOVERED_TARGETS)); 263 263 264 264 ndev->n_targets = 0; 265 265 } 266 266 267 267 static void nci_rf_discover_ntf_packet(struct nci_dev *ndev, 268 - struct sk_buff *skb) 268 + struct sk_buff *skb) 269 269 { 270 270 struct nci_rf_discover_ntf ntf; 271 271 __u8 *data = skb->data; ··· 280 280 pr_debug("rf_protocol 0x%x\n", ntf.rf_protocol); 281 281 pr_debug("rf_tech_and_mode 0x%x\n", ntf.rf_tech_and_mode); 282 282 pr_debug("rf_tech_specific_params_len %d\n", 283 - ntf.rf_tech_specific_params_len); 283 + ntf.rf_tech_specific_params_len); 284 284 285 285 if (ntf.rf_tech_specific_params_len > 0) { 286 286 switch (ntf.rf_tech_and_mode) { ··· 318 318 } else { 319 319 atomic_set(&ndev->state, NCI_W4_HOST_SELECT); 320 320 nfc_targets_found(ndev->nfc_dev, ndev->targets, 321 - ndev->n_targets); 321 + ndev->n_targets); 322 322 } 323 323 } 324 324 ··· 335 335 pr_debug("rats_res_len %d\n", nfca_poll->rats_res_len); 336 336 if (nfca_poll->rats_res_len > 0) { 337 337 memcpy(nfca_poll->rats_res, 338 - data, 339 - nfca_poll->rats_res_len); 338 + data, nfca_poll->rats_res_len); 340 339 } 341 340 break; 342 341 343 342 case NCI_NFC_B_PASSIVE_POLL_MODE: 344 343 nfcb_poll = &ntf->activation_params.nfcb_poll_iso_dep; 345 344 nfcb_poll->attrib_res_len = *data++; 346 - pr_debug("attrib_res_len %d\n", 347 - nfcb_poll->attrib_res_len); 345 + pr_debug("attrib_res_len %d\n", nfcb_poll->attrib_res_len); 348 346 if (nfcb_poll->attrib_res_len > 0) { 349 347 memcpy(nfcb_poll->attrib_res, 350 - data, 351 - nfcb_poll->attrib_res_len); 348 + data, nfcb_poll->attrib_res_len); 352 349 } 353 350 break; 354 351 ··· 359 362 } 360 363 361 364 static void nci_target_auto_activated(struct nci_dev *ndev, 362 - struct nci_rf_intf_activated_ntf *ntf) 365 + struct nci_rf_intf_activated_ntf *ntf) 363 366 { 364 367 struct nfc_target *target; 365 368 int rc; ··· 367 370 target = &ndev->targets[ndev->n_targets]; 368 371 369 372 rc = nci_add_new_protocol(ndev, target, ntf->rf_protocol, 370 - ntf->activation_rf_tech_and_mode, 371 - &ntf->rf_tech_specific_params); 373 + ntf->activation_rf_tech_and_mode, 374 + &ntf->rf_tech_specific_params); 372 375 if (rc) 373 376 return; 374 377 ··· 381 384 } 382 385 383 386 static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev, 384 - struct sk_buff *skb) 387 + struct sk_buff *skb) 385 388 { 386 389 struct nci_rf_intf_activated_ntf ntf; 387 390 __u8 *data = skb->data; ··· 402 405 ntf.activation_rf_tech_and_mode); 403 406 pr_debug("max_data_pkt_payload_size 0x%x\n", 404 407 ntf.max_data_pkt_payload_size); 405 - pr_debug("initial_num_credits 0x%x\n", ntf.initial_num_credits); 408 + pr_debug("initial_num_credits 0x%x\n", 409 + ntf.initial_num_credits); 406 410 pr_debug("rf_tech_specific_params_len %d\n", 407 411 ntf.rf_tech_specific_params_len); 408 412 ··· 439 441 440 442 pr_debug("data_exch_rf_tech_and_mode 0x%x\n", 441 443 ntf.data_exch_rf_tech_and_mode); 442 - pr_debug("data_exch_tx_bit_rate 0x%x\n", 443 - ntf.data_exch_tx_bit_rate); 444 - pr_debug("data_exch_rx_bit_rate 0x%x\n", 445 - ntf.data_exch_rx_bit_rate); 446 - pr_debug("activation_params_len %d\n", 447 - ntf.activation_params_len); 444 + pr_debug("data_exch_tx_bit_rate 0x%x\n", ntf.data_exch_tx_bit_rate); 445 + pr_debug("data_exch_rx_bit_rate 0x%x\n", ntf.data_exch_rx_bit_rate); 446 + pr_debug("activation_params_len %d\n", ntf.activation_params_len); 448 447 449 448 if (ntf.activation_params_len > 0) { 450 449 switch (ntf.rf_interface) { 451 450 case NCI_RF_INTERFACE_ISO_DEP: 452 451 err = nci_extract_activation_params_iso_dep(ndev, 453 - &ntf, data); 452 + &ntf, data); 454 453 break; 455 454 456 455 case NCI_RF_INTERFACE_FRAME: ··· 484 489 } 485 490 486 491 static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, 487 - struct sk_buff *skb) 492 + struct sk_buff *skb) 488 493 { 489 494 struct nci_rf_deactivate_ntf *ntf = (void *) skb->data; 490 495
+8 -9
net/nfc/nci/rsp.c
··· 67 67 ndev->num_supported_rf_interfaces = rsp_1->num_supported_rf_interfaces; 68 68 69 69 if (ndev->num_supported_rf_interfaces > 70 - NCI_MAX_SUPPORTED_RF_INTERFACES) { 70 + NCI_MAX_SUPPORTED_RF_INTERFACES) { 71 71 ndev->num_supported_rf_interfaces = 72 72 NCI_MAX_SUPPORTED_RF_INTERFACES; 73 73 } 74 74 75 75 memcpy(ndev->supported_rf_interfaces, 76 - rsp_1->supported_rf_interfaces, 77 - ndev->num_supported_rf_interfaces); 76 + rsp_1->supported_rf_interfaces, 77 + ndev->num_supported_rf_interfaces); 78 78 79 79 rsp_2 = (void *) (skb->data + 6 + rsp_1->num_supported_rf_interfaces); 80 80 81 - ndev->max_logical_connections = 82 - rsp_2->max_logical_connections; 81 + ndev->max_logical_connections = rsp_2->max_logical_connections; 83 82 ndev->max_routing_table_size = 84 83 __le16_to_cpu(rsp_2->max_routing_table_size); 85 84 ndev->max_ctrl_pkt_payload_len = ··· 120 121 } 121 122 122 123 static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev, 123 - struct sk_buff *skb) 124 + struct sk_buff *skb) 124 125 { 125 126 __u8 status = skb->data[0]; 126 127 ··· 142 143 } 143 144 144 145 static void nci_rf_disc_select_rsp_packet(struct nci_dev *ndev, 145 - struct sk_buff *skb) 146 + struct sk_buff *skb) 146 147 { 147 148 __u8 status = skb->data[0]; 148 149 ··· 154 155 } 155 156 156 157 static void nci_rf_deactivate_rsp_packet(struct nci_dev *ndev, 157 - struct sk_buff *skb) 158 + struct sk_buff *skb) 158 159 { 159 160 __u8 status = skb->data[0]; 160 161 ··· 162 163 163 164 /* If target was active, complete the request only in deactivate_ntf */ 164 165 if ((status != NCI_STATUS_OK) || 165 - (atomic_read(&ndev->state) != NCI_POLL_ACTIVE)) { 166 + (atomic_read(&ndev->state) != NCI_POLL_ACTIVE)) { 166 167 nci_clear_target_list(ndev); 167 168 atomic_set(&ndev->state, NCI_IDLE); 168 169 nci_req_complete(ndev, status);