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]
Date:   Tue, 8 Aug 2017 09:51:20 +0200
From:   Lukas Wunner <lukas@...ner.de>
To:     Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc:     rjw@...ysocki.net, lenb@...nel.org, linux-pm@...r.kernel.org,
        mario.limonciello@...l.com, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org
Subject: Re: [PATCH] ACPI / Sleep: Check low power idle constraints for debug
 only

On Mon, Aug 07, 2017 at 04:53:57PM -0700, Srinivas Pandruvada wrote:
> +	out_obj = acpi_evaluate_dsm(lps0_device_handle, &lps0_dsm_guid,
> +				    1, ACPI_LPS0_GET_DEVICE_CONSTRAINTS,
> +				    NULL);
> +
> +	acpi_handle_debug(lps0_device_handle, "_DSM function 1 eval %s\n",
> +			  out_obj ? "successful" : "failed");
> +
> +	if (!out_obj)
> +		return;
> +
> +	if (out_obj->type != ACPI_TYPE_PACKAGE)
> +		goto free_acpi_buffer;

Using acpi_evaluate_dsm_typed() would avoid having to check the type here.


> +	for (i = 0; i < out_obj->package.count; i++) {
> +		union acpi_object *package = &out_obj->package.elements[i];
> +		struct lpi_device_info info;
> +		int package_count = 0, j;
> +
> +		if (!package)
> +			continue;
> +
> +		info.enabled = 0;
> +		info.package = NULL;
> +		info.name = NULL;

Using a declaration such as

		struct lpi_device_info info = { };

would avoid having to zero the struct elements here.


Thanks,

Lukas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ