diff options
author | Eric Lapuyade <eric.lapuyade@intel.com> | 2012-04-10 13:43:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-12 15:10:37 -0400 |
commit | 01ae0eea9bed132a9c4a2c207dbf8e05b0051071 (patch) | |
tree | 7de07ede2d172edaa27bfae617b89b2068d36044 | |
parent | c4fbb6515a4dcec83d340247639b5644c4745528 (diff) |
NFC: Fix next target_idx type and rename for clarity
Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/net/nfc/nfc.h | 2 | ||||
-rw-r--r-- | net/nfc/core.c | 2 | ||||
-rw-r--r-- | net/nfc/rawsock.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 45f05634315..f4f6950a8b0 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -89,7 +89,7 @@ struct nfc_genl_data { | |||
89 | 89 | ||
90 | struct nfc_dev { | 90 | struct nfc_dev { |
91 | unsigned idx; | 91 | unsigned idx; |
92 | unsigned target_idx; | 92 | u32 target_next_idx; |
93 | struct nfc_target *targets; | 93 | struct nfc_target *targets; |
94 | int n_targets; | 94 | int n_targets; |
95 | int targets_generation; | 95 | int targets_generation; |
diff --git a/net/nfc/core.c b/net/nfc/core.c index d92400087b6..db88429cfc1 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c | |||
@@ -435,7 +435,7 @@ int nfc_targets_found(struct nfc_dev *dev, | |||
435 | dev->polling = false; | 435 | dev->polling = false; |
436 | 436 | ||
437 | for (i = 0; i < n_targets; i++) | 437 | for (i = 0; i < n_targets; i++) |
438 | targets[i].idx = dev->target_idx++; | 438 | targets[i].idx = dev->target_next_idx++; |
439 | 439 | ||
440 | spin_lock_bh(&dev->targets_lock); | 440 | spin_lock_bh(&dev->targets_lock); |
441 | 441 | ||
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c index b2825aa85f6..ec1134c9e07 100644 --- a/net/nfc/rawsock.c +++ b/net/nfc/rawsock.c | |||
@@ -92,8 +92,8 @@ static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, | |||
92 | goto error; | 92 | goto error; |
93 | } | 93 | } |
94 | 94 | ||
95 | if (addr->target_idx > dev->target_idx - 1 || | 95 | if (addr->target_idx > dev->target_next_idx - 1 || |
96 | addr->target_idx < dev->target_idx - dev->n_targets) { | 96 | addr->target_idx < dev->target_next_idx - dev->n_targets) { |
97 | rc = -EINVAL; | 97 | rc = -EINVAL; |
98 | goto error; | 98 | goto error; |
99 | } | 99 | } |