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: <34978551.c1lKBcQLqc@vostro.rjw.lan>
Date:	Mon, 28 Apr 2014 00:01:26 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Zhang Rui <rui.zhang@...el.com>
Cc:	linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
	bhelgaas@...gle.com, matthew.garrett@...ula.com,
	rafael.j.wysocki@...el.com, dmitry.torokhov@...il.com
Subject: Re: [PATCH V5 02/12] PNPACPI: use whilte list for pnpacpi device enumeration

On Tuesday, April 08, 2014 12:06:49 AM Zhang Rui wrote:

[...]

> +
> +static int acpi_pnp_scan_handler_attach(struct acpi_device *adev,
> +					const struct acpi_device_id *id)
> +{
> +	return 1;
> +}
> +
> +static int acpi_pnp_scan_handler_match(char *devid, char *handlerid)
> +{
> +	int i;
> +
> +	if (memcmp(devid, handlerid, 3))
> +		return 0;
> +
> +	for (i = 3; i < 7; i++) {
> +		/* Not a HEX value */
> +		if (!((devid[i] >= '0' && devid[i] <= '9') ||
> +		      (devid[i] > 'A' && devid[i] <= 'F')))
> +			return 0;
> +
> +		if ((handlerid[i] != 'X') &&

Hmm.  What exactly is the above check for?

> +		    toupper(devid[i]) != toupper(handlerid[i]))
> +			return 0;
> +	}
> +	return 1;
> +}
> +
> +static struct acpi_scan_handler acpi_pnp_handler = {
> +	.ids = acpi_pnp_device_ids,
> +	.match = acpi_pnp_scan_handler_match,
> +	.attach = acpi_pnp_scan_handler_attach,
> +};
> +
> +bool acpi_is_pnp_device(struct acpi_device *device)
> +{
> +	return device->handler == &acpi_pnp_handler;
> +}
> +EXPORT_SYMBOL_GPL(acpi_is_pnp_device);
> +
> +void __init acpi_pnp_init(void)
> +{
> +	acpi_scan_add_handler(&acpi_pnp_handler);
> +}
> diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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