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: Mon, 18 Dec 2023 21:33:43 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Marco Pagani <marpagan@...hat.com>
Cc: Moritz Fischer <mdf@...nel.org>, Wu Hao <hao.wu@...el.com>,
	Xu Yilun <yilun.xu@...el.com>, Tom Rix <trix@...hat.com>,
	linux-kernel@...r.kernel.org, linux-fpga@...r.kernel.org
Subject: Re: [RFC PATCH v3 2/2] fpga: set owner of fpga_manager_ops for
 existing low-level modules

On Mon, Dec 18, 2023 at 09:28:09PM +0100, Marco Pagani wrote:
> This patch tentatively set the owner field of fpga_manager_ops to
> THIS_MODULE for existing fpga manager low-level control modules.
> 
> Signed-off-by: Marco Pagani <marpagan@...hat.com>
> ---
>  drivers/fpga/altera-cvp.c             | 1 +
>  drivers/fpga/altera-pr-ip-core.c      | 1 +
>  drivers/fpga/altera-ps-spi.c          | 1 +
>  drivers/fpga/dfl-fme-mgr.c            | 1 +
>  drivers/fpga/ice40-spi.c              | 1 +
>  drivers/fpga/lattice-sysconfig.c      | 1 +
>  drivers/fpga/machxo2-spi.c            | 1 +
>  drivers/fpga/microchip-spi.c          | 1 +
>  drivers/fpga/socfpga-a10.c            | 1 +
>  drivers/fpga/socfpga.c                | 1 +
>  drivers/fpga/stratix10-soc.c          | 1 +
>  drivers/fpga/tests/fpga-mgr-test.c    | 1 +
>  drivers/fpga/tests/fpga-region-test.c | 1 +
>  drivers/fpga/ts73xx-fpga.c            | 1 +
>  drivers/fpga/versal-fpga.c            | 1 +
>  drivers/fpga/xilinx-spi.c             | 1 +
>  drivers/fpga/zynq-fpga.c              | 1 +
>  drivers/fpga/zynqmp-fpga.c            | 1 +
>  18 files changed, 18 insertions(+)
> 
> diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
> index 4ffb9da537d8..aeb913547dd8 100644
> --- a/drivers/fpga/altera-cvp.c
> +++ b/drivers/fpga/altera-cvp.c
> @@ -520,6 +520,7 @@ static const struct fpga_manager_ops altera_cvp_ops = {
>  	.write_init	= altera_cvp_write_init,
>  	.write		= altera_cvp_write,
>  	.write_complete	= altera_cvp_write_complete,
> +	.owner		= THIS_MODULE,

Note, this is not how to do this, force the compiler to set this for you
automatically, otherwise everyone will always forget to do it.  Look at
how functions like usb_register_driver() works.

Also, are you _sure_ that you need a module owner in this structure?  I
still don't know why...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ