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: <ZZloVhod_hbhDTGP@smile.fi.intel.com>
Date: Sat, 6 Jan 2024 16:48:54 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mark Hasemeyer <markhas@...omium.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
	Sudeep Holla <sudeep.holla@....com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
	Konrad Dybcio <konrad.dybcio@...aro.org>,
	Raul Rangel <rrangel@...omium.org>,
	Tzung-Bi Shih <tzungbi@...nel.org>,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Wolfram Sang <wsa@...nel.org>, linux-acpi@...r.kernel.org,
	linux-i2c@...r.kernel.org
Subject: Re: [PATCH v4 03/24] i2c: acpi: Modify i2c_acpi_get_irq() to use
 resource

On Tue, Jan 02, 2024 at 02:07:27PM -0700, Mark Hasemeyer wrote:
> The i2c_acpi_irq_context structure provides redundant information that
> can be provided with struct resource.
> 
> Refactor i2c_acpi_get_irq() to use struct resource instead of struct
> i2c_acpi_irq_context.

...

>  	ret = acpi_dev_get_resources(adev, &resource_list,
> -				     i2c_acpi_add_irq_resource, &irq_ctx);
> +				     i2c_acpi_add_irq_resource, r);

Up to you, but you can make it a single line.

	ret = acpi_dev_get_resources(adev, &resource_list, i2c_acpi_add_irq_resource, r);

>  	if (ret < 0)
>  		return ret;

...

> +++ b/drivers/i2c/i2c-core-base.c

> +			struct resource r = {};

Needs ioport.h.

...

> +			irq = i2c_acpi_get_irq(client, &r);
> +			if (r.flags & IORESOURCE_IRQ_WAKECAPABLE)

Ditto.

>  				client->flags |= I2C_CLIENT_WAKE;
>  		}

...

> +++ b/drivers/i2c/i2c-core.h

> +int i2c_acpi_get_irq(struct i2c_client *client, struct resource *r);

> +static inline int i2c_acpi_get_irq(struct i2c_client *client, struct resource *r)

Needs a forward declaration (besides the inclusion block is a total mess
in this file).

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ