Linux wireless drivers development
 help / color / mirror / Atom feed
From: Samuel Ortiz <sameo@linux.intel.com>
To: Eric Lapuyade <eric.lapuyade@linux.intel.com>,
	"John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org,
	Lauro Ramos Venancio <lauro.venancio@openbossa.org>,
	Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Subject: Re: [PATCH] NFC: Fix next target_idx type and rename for clarity
Date: Fri, 23 Mar 2012 12:07:33 +0100	[thread overview]
Message-ID: <20120323110733.GB7231@sortiz-mobl> (raw)
In-Reply-To: <4F6C547F.50402@linux.intel.com>

Hi Eric,

On Fri, Mar 23, 2012 at 11:46:23AM +0100, Eric Lapuyade wrote:
> 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.

> Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
> ---
>  include/net/nfc/nfc.h |    2 +-
>  net/nfc/core.c        |    2 +-
>  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 45f0563..f4f6950 100644
> --- a/include/net/nfc/nfc.h
> +++ b/include/net/nfc/nfc.h
> @@ -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;
> diff --git a/net/nfc/core.c b/net/nfc/core.c
> index 2818582..d3a2cfb 100644
> --- a/net/nfc/core.c
> +++ b/net/nfc/core.c
> @@ -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);
>  
> 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 @@ 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;
>  	}
> -- 
> 1.7.6.5
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

      reply	other threads:[~2012-03-23 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 10:46 [PATCH] NFC: Fix next target_idx type and rename for clarity Eric Lapuyade
2012-03-23 11:07 ` Samuel Ortiz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120323110733.GB7231@sortiz-mobl \
    --to=sameo@linux.intel.com \
    --cc=aloisio.almeida@openbossa.org \
    --cc=eric.lapuyade@linux.intel.com \
    --cc=lauro.venancio@openbossa.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox