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>
struct nfc_dev {
unsigned idx;
- unsigned target_idx;
+ u32 target_next_idx;
struct nfc_target *targets;
int n_targets;
int targets_generation;
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);
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;
}