vfio/cdx: Remove redundant initialization owner in vfio_cdx_driver
Subsystems (3)
PATCH 1/1 vfio/cdx: Remove redundant initialization owner in vfio_cdx_driver
The cdx_driver_register() will set "THIS_MODULE" to driver.owner when register a cdx_driver driver, so it is redundant initialization to set driver.owner in the statement. Remove it for clean code.
--- drivers/vfio/cdx/main.c | 1 - 1 file changed, 1 deletion(-)
drivers/vfio/cdx/main.c +0 -1
@@ -223,7 +223,6 @@ static struct cdx_driver vfio_cdx_driver = { .match_id_table = vfio_cdx_table, .driver = { .name = "vfio-cdx", - .owner = THIS_MODULE, }, .driver_managed_dma = true, };
Signature · 1 line
2.34.1
Quoted 10 lines
-----Original Message-----
From: Li Zetao <[email protected]>
Sent: Tuesday, August 8, 2023 7:40 AM
To: Gupta, Nipun <[email protected]>; Agarwal, Nikhil <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: [PATCH -next] vfio/cdx: Remove redundant initialization owner invfio_cdx_driver
Quoted 5 lines
The
cdx_driver_register()will set "THIS_MODULE" to driver.owner when register acdx_driverdriver, so it is redundant initialization to set driver.owner in the statement. Remove it for clean code.Signed-off-by Li Zetao <[email protected]>
Quoted 14 lines · On Tue, 8 Aug 2023 10:09:37 +0800 Li Zetao <[email protected]> wrote:
The
cdx_driver_register()will set "THIS_MODULE" to driver.owner when register acdx_driverdriver, so it is redundant initialization to set driver.owner in the statement. Remove it for clean code.Signed-off-by Li Zetao <[email protected]>--- drivers/vfio/cdx/main.c | 1 - 1 file changed, 1 deletion(-)drivers/vfio/cdx/main.c +0
-0
drivers/vfio/cdx/main.c static struct cdx_driver vfio_cdx_driver = { · line 228
Quoted 7 lines
drivers/vfio/cdx/main.c +0
-1@@ -223,7 +223,6 @@ static struct cdx_driver vfio_cdx_driver = { .match_id_table = vfio_cdx_table, .driver = { .name = "vfio-cdx", - .owner = THIS_MODULE, }, .driver_managed_dma = true, };
Doesn't vfio_fsl_mc_driver have the same issue?
#define fsl_mc_driver_register(drv) \
__fsl_mc_driver_register(drv, THIS_MODULE)
static struct fsl_mc_driver vfio_fsl_mc_driver = {
.probe = vfio_fsl_mc_probe,
.remove = vfio_fsl_mc_remove,
.driver = {
.name = "vfio-fsl-mc",
.owner = THIS_MODULE,
},
.driver_managed_dma = true,
};
That driver could also be converted to use module_driver(). Thanks,
Alex
Alex Williamson
AppliedQuoted 8 lines · On Tue, 8 Aug 2023 10:09:37 +0800 Li Zetao <[email protected]> wrote:
The
cdx_driver_register()will set "THIS_MODULE" to driver.owner when register acdx_driverdriver, so it is redundant initialization to set driver.owner in the statement. Remove it for clean code.Signed-off-by Li Zetao <[email protected]>--- drivers/vfio/cdx/main.c | 1 - 1 file changed, 1 deletion(-)
Applied to vfio next branch for v6.6. Thanks!
Alex
Quoted 13 lines
drivers/vfio/cdx/main.c +0
-1@@ -223,7 +223,6 @@ static struct cdx_driver vfio_cdx_driver = { .match_id_table = vfio_cdx_table, .driver = { .name = "vfio-cdx", - .owner = THIS_MODULE, }, .driver_managed_dma = true, };