From: James Smart <James.Smart@emulex.com>
To: Tejun Heo <tj@kernel.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH 63/77] scsi/lpfc: convert to idr_alloc()
Date: Mon, 11 Feb 2013 17:47:09 -0500 [thread overview]
Message-ID: <511974ED.2020305@emulex.com> (raw)
In-Reply-To: <1360179649-22465-64-git-send-email-tj@kernel.org>
Acked-by: James Smart <james.smart@emulex.com>
-- james s
On 2/6/2013 2:40 PM, Tejun Heo wrote:
> Convert to the much saner new idr interface.
>
> Only compile tested.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: James Smart <james.smart@emulex.com>
> Cc: linux-scsi@vger.kernel.org
> ---
> drivers/scsi/lpfc/lpfc_init.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index 26ca2ef..314b4f6 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -3165,14 +3165,10 @@ destroy_port(struct lpfc_vport *vport)
> int
> lpfc_get_instance(void)
> {
> - int instance = 0;
> -
> - /* Assign an unused number */
> - if (!idr_pre_get(&lpfc_hba_index, GFP_KERNEL))
> - return -1;
> - if (idr_get_new(&lpfc_hba_index, NULL, &instance))
> - return -1;
> - return instance;
> + int ret;
> +
> + ret = idr_alloc(&lpfc_hba_index, NULL, 0, 0, GFP_KERNEL);
> + return ret < 0 ? -1 : ret;
> }
>
> /**
prev parent reply other threads:[~2013-02-11 22:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1360179649-22465-1-git-send-email-tj@kernel.org>
2013-02-06 19:40 ` [PATCH 60/77] scsi/bfa: convert to idr_alloc() Tejun Heo
2013-02-06 19:40 ` [PATCH 61/77] scsi: " Tejun Heo
2013-02-06 19:40 ` [PATCH 62/77] target/iscsi: " Tejun Heo
2013-02-06 19:40 ` [PATCH 63/77] scsi/lpfc: " Tejun Heo
2013-02-11 22:47 ` James Smart [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=511974ED.2020305@emulex.com \
--to=james.smart@emulex.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=tj@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).