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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51233235.5040002@jp.fujitsu.com>
Date:	Tue, 19 Feb 2013 17:05:09 +0900
From:	Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
CC:	ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Yinghai Lu <yinghai@...nel.org>,
	Toshi Kani <toshi.kani@...com>, Jiang Liu <liuj97@...il.com>
Subject: Re: [PATCH 4/7] ACPI / scan: Introduce acpi_scan_handler_matching()

2013/02/18 0:23, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
>
> Introduce new helper routine acpi_scan_handler_matching() for
> checking if the given ACPI scan handler matches a given device ID
> and rework acpi_scan_match_handler() to use the new routine (that
> routine will also be useful for other purposes in the future).
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---

Acked-by: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>

Thanks,
Yasuaki Ishimatsu

>   drivers/acpi/scan.c |   30 ++++++++++++++++++++----------
>   1 file changed, 20 insertions(+), 10 deletions(-)
>
> Index: test/drivers/acpi/scan.c
> ===================================================================
> --- test.orig/drivers/acpi/scan.c
> +++ test/drivers/acpi/scan.c
> @@ -1658,22 +1658,32 @@ static int acpi_bus_type_and_status(acpi
>   	return 0;
>   }
>
> +static bool acpi_scan_handler_matching(struct acpi_scan_handler *handler,
> +				       char *idstr,
> +				       const struct acpi_device_id **matchid)
> +{
> +	const struct acpi_device_id *devid;
> +
> +	for (devid = handler->ids; devid->id[0]; devid++)
> +		if (!strcmp((char *)devid->id, idstr)) {
> +			if (matchid)
> +				*matchid = devid;
> +
> +			return true;
> +		}
> +
> +	return false;
> +}
> +
>   static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr,
>   					const struct acpi_device_id **matchid)
>   {
>   	struct acpi_scan_handler *handler;
>
> -	list_for_each_entry(handler, &acpi_scan_handlers_list, list_node) {
> -		const struct acpi_device_id *devid;
> +	list_for_each_entry(handler, &acpi_scan_handlers_list, list_node)
> +		if (acpi_scan_handler_matching(handler, idstr, matchid))
> +			return handler;
>
> -		for (devid = handler->ids; devid->id[0]; devid++)
> -			if (!strcmp((char *)devid->id, idstr)) {
> -				if (matchid)
> -					*matchid = devid;
> -
> -				return handler;
> -			}
> -	}
>   	return NULL;
>   }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


--
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