lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <511974E0.4040703@emulex.com>
Date:	Mon, 11 Feb 2013 17:46:56 -0500
From:	James Smart <James.Smart@...lex.com>
To:	Tejun Heo <tj@...nel.org>
CC:	<akpm@...ux-foundation.org>, <linux-kernel@...r.kernel.org>,
	<rusty@...tcorp.com.au>, <bfields@...ldses.org>,
	<skinsbursky@...allels.com>, <ebiederm@...ssion.com>,
	<jmorris@...ei.org>, <axboe@...nel.dk>,
	<linux-scsi@...r.kernel.org>
Subject: Re: [PATCH 47/62] scsi/lpfc: convert to idr_alloc()

Acked-by: James Smart <james.smart@...lex.com>

-- james s


On 2/2/2013 8:20 PM, Tejun Heo wrote:
> Convert to the much saner new idr interface.
>
> Only compile tested.
>
> Signed-off-by: Tejun Heo <tj@...nel.org>
> Cc: James Smart <james.smart@...lex.com>
> Cc: linux-scsi@...r.kernel.org
> ---
> This patch depends on an earlier idr changes and I think it would be
> best to route these together through -mm.  Please holler if there's
> any objection.  Thanks.
>
>   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 89ad558..7de4ef14 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;
>   }
>   
>   /**

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ