[PATCH 1/8] acpi: method: add DDN, HID, HRV, PLD, SUB, STR checks

IvanHu ivan.hu at canonical.com
Tue Sep 25 03:23:40 UTC 2012


> +
> +static bool method_valid_HID_string(char *str)
> +{
> +	if (strlen(str) == 7) {
> +		/* PNP ID, must be 3 capitals followed by 4 hex */
> +		if (!isupper(str[0]) ||
> +		    !isupper(str[1]) ||
> +		    !isupper(str[2])) return false;
> +		if (!isxdigit(str[3]) ||
> +		    !isxdigit(str[4]) ||
> +		    !isxdigit(str[5]) ||
> +		    !isxdigit(str[6])) return false;
> +		return true;
> +	}
> +
> +	if (strlen(str) == 8) {
> +		/* ACPI ID, must be 4 capitals followed by 4 hex */
> +		if (!isupper(str[0]) ||
> +		    !isupper(str[1]) ||
> +		    !isupper(str[2]) ||
> +		    !isupper(str[3])) return false;
> +		if (!isxdigit(str[4]) ||
> +		    !isxdigit(str[5]) ||
> +		    !isxdigit(str[6]) ||
> +		    !isxdigit(str[7])) return false;
> +		return true;
> +	}
> +
> +	return false;
> +}
> +

Just wondering if the ACPI ID for 8 digit shouldn't be valid?
For example,
Name(_HID, "80860003") // PCI-assigned device identifier





More information about the fwts-devel mailing list