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]
Date: Mon, 25 Mar 2024 22:54:00 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Sudan Landge <sudanl@...zon.com>, tytso@....edu, Jason@...c4.com,
 robh+dt@...nel.org, krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
 sathyanarayanan.kuppuswamy@...ux.intel.com, thomas.lendacky@....com,
 dan.j.williams@...el.com, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org
Cc: graf@...zon.de, dwmw@...zon.co.uk, bchalios@...zon.es,
 xmarcalx@...zon.co.uk
Subject: Re: [PATCH v3 2/4] virt: vmgenid: change implementation to use a
 platform driver

On 25/03/2024 20:53, Sudan Landge wrote:
> Re-implement vmgenid as a platform driver in preparation
> for adding devicetree bindings support in next commits.
> 
> Signed-off-by: Sudan Landge <sudanl@...zon.com>
> ---
>  drivers/virt/vmgenid.c | 101 ++++++++++++++++++++++++++++++-----------
>  1 file changed, 74 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/virt/vmgenid.c b/drivers/virt/vmgenid.c
> index ea956df02874..d5394c706bd9 100644
> --- a/drivers/virt/vmgenid.c
> +++ b/drivers/virt/vmgenid.c
> @@ -11,6 +11,8 @@
>  #include <linux/module.h>
>  #include <linux/acpi.h>
>  #include <linux/random.h>
> +#include <acpi/actypes.h>
> +#include <linux/platform_device.h>

Do not add headers to the end of lists.

>  
>  ACPI_MODULE_NAME("vmgenid");
>  

..

>  
> -static struct acpi_driver vmgenid_driver = {
> -	.name = "vmgenid",
> -	.ids = vmgenid_ids,
> -	.owner = THIS_MODULE,
> -	.ops = {
> -		.add = vmgenid_add,
> -		.notify = vmgenid_notify
> -	}
> +static struct platform_driver vmgenid_plaform_driver = {
> +	.probe      = vmgenid_add,
> +	.driver     = {
> +		.name   = "vmgenid",
> +		.acpi_match_table = ACPI_PTR(vmgenid_ids),

ACPI_PTR does not make sense. If this can be compile tested !ACPI, then
this is wrong. If this cannot be compile tested, then this is redundant
and confusing so... also wrong.

> +		.owner = THIS_MODULE,
> +	},
>  };
>  
> -module_acpi_driver(vmgenid_driver);
> +static int vmgenid_platform_device_init(void)
> +{
> +	return platform_driver_register(&vmgenid_plaform_driver);
> +}
> +
> +static void vmgenid_platform_device_exit(void)
> +{
> +	platform_driver_unregister(&vmgenid_plaform_driver);
> +}
> +
> +module_init(vmgenid_platform_device_init)
> +module_exit(vmgenid_platform_device_exit)

Why this cannot be module_platform_driver?



Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ