Unverified Commit 02543298 authored by Kuan-Wei Chiu's avatar Kuan-Wei Chiu Committed by Ilpo Järvinen
Browse files

platform/x86/amd: hfi: Remove redundant assignment to .owner



The coccicheck tool reports the following warning for this driver:

./hfi.c:509:3-8: No need to set .owner here. The core will do it.

The manual assignment of .owner = THIS_MODULE; in the platform_driver
struct is redundant. The platform_driver_register() function, which is
called to register the driver, is a macro that automatically sets the
driver's owner to THIS_MODULE.

The driver core handles this assignment internally, making the explicit
initialization in the struct definition unnecessary. Remove the
unnecessary line.

Signed-off-by: default avatarKuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20251011063837.2318535-3-visitorckw@gmail.com


Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 32647324
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -505,7 +505,6 @@ static int amd_hfi_probe(struct platform_device *pdev)
static struct platform_driver amd_hfi_driver = {
	.driver = {
		.name = AMD_HFI_DRIVER,
		.owner = THIS_MODULE,
		.pm = &amd_hfi_pm_ops,
		.acpi_match_table = ACPI_PTR(amd_hfi_platform_match),
	},