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>
diff --git a/net/nfc/core.c b/net/nfc/core.c
index d924000..db88429 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -435,7 +435,7 @@
dev->polling = false;
for (i = 0; i < n_targets; i++)
- targets[i].idx = dev->target_idx++;
+ targets[i].idx = dev->target_next_idx++;
spin_lock_bh(&dev->targets_lock);
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
index b2825aa..ec1134c 100644
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -92,8 +92,8 @@
goto error;
}
- if (addr->target_idx > dev->target_idx - 1 ||
- addr->target_idx < dev->target_idx - dev->n_targets) {
+ if (addr->target_idx > dev->target_next_idx - 1 ||
+ addr->target_idx < dev->target_next_idx - dev->n_targets) {
rc = -EINVAL;
goto error;
}