NFC: Fix next target_idx type and rename for clarity
Subsystems (2)
PATCH 1/1 NFC: Fix next target_idx type and rename for clarity
There are many idx in this code, so make it clearer that this one is the base for the next target that will be discoved.
Signed-off-by Eric Lapuyade <[email protected]>
Signed-off-by Samuel Ortiz <[email protected]>
--- include/net/nfc/nfc.h | 2 +- net/nfc/core.c | 2 +- net/nfc/rawsock.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
include/net/nfc/nfc.h +1 -1
@@ -89,7 +89,7 @@ struct nfc_genl_data {struct nfc_dev {unsigned idx; -unsigned target_idx; +u32 target_next_idx;struct nfc_target *targets;int n_targets;int targets_generation;
net/nfc/core.c +1 -1
@@ -435,7 +435,7 @@ int nfc_targets_found(struct nfc_dev *dev, 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);
net/nfc/rawsock.c +2 -2
@@ -92,8 +92,8 @@ static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, 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; }
Signature · 1 line
1.7.6.5
Hi Eric,
Quoted 2 lines · Eric Lapuyade
There are many idx in this code, so make it clearer that this one is the base for the next target that will be discoved.
John, I'm queuing this one to my nfc-next branch. It will be part of my next pull request (After wireless-next is open for business again), unless someone has some comments about it.
Cheers,
Samuel.
Quoted 52 lines
Signed-off-by Eric Lapuyade <[email protected]>Signed-off-by Samuel Ortiz <[email protected]>--- include/net/nfc/nfc.h | 2 +- net/nfc/core.c | 2 +- net/nfc/rawsock.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)include/net/nfc/nfc.h +1
-1@@ -89,7 +89,7 @@ struct nfc_genl_data {struct nfc_dev {unsigned idx; -unsigned target_idx; +u32 target_next_idx;struct nfc_target *targets;int n_targets;int targets_generation;net/nfc/core.c +1
-1@@ -435,7 +435,7 @@ int nfc_targets_found(struct nfc_dev *dev, 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);net/nfc/rawsock.c +2
-2@@ -92,8 +92,8 @@ static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, 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; }Signature · 1 line
1.7.6.5
Signature · 2 lines
Intel Open Source Technology Centre http://oss.intel.com/