From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: mario.limonciello@amd.com
Cc: perry.yuan@amd.com, hansg@kernel.org,
ilpo.jarvinen@linux.intel.com, jserv@ccns.ncku.edu.tw,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org,
Kuan-Wei Chiu <visitorckw@gmail.com>
Subject: [PATCH 2/2] platform/x86/amd: hfi: Remove redundant assignment to .owner
Date: Sat, 11 Oct 2025 14:38:37 +0800 [thread overview]
Message-ID: <20251011063837.2318535-3-visitorckw@gmail.com> (raw)
In-Reply-To: <20251011063837.2318535-1-visitorckw@gmail.com>
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: Kuan-Wei Chiu <visitorckw@gmail.com>
---
Build test only.
drivers/platform/x86/amd/hfi/hfi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/platform/x86/amd/hfi/hfi.c b/drivers/platform/x86/amd/hfi/hfi.c
index 5d5d2cf23a75..83863a5e0fbc 100644
--- a/drivers/platform/x86/amd/hfi/hfi.c
+++ b/drivers/platform/x86/amd/hfi/hfi.c
@@ -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),
},
--
2.34.1
next prev parent reply other threads:[~2025-10-11 6:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-11 6:38 [PATCH 0/2] platform/x86/amd: hfi: A couple of cleanups Kuan-Wei Chiu
2025-10-11 6:38 ` [PATCH 1/2] platform/x86/amd: hfi: Remove unused cpumask from cpuinfo struct Kuan-Wei Chiu
2025-10-13 18:52 ` Mario Limonciello
2025-10-11 6:38 ` Kuan-Wei Chiu [this message]
2025-10-13 18:53 ` [PATCH 2/2] platform/x86/amd: hfi: Remove redundant assignment to .owner Mario Limonciello
2025-10-15 10:19 ` [PATCH 0/2] platform/x86/amd: hfi: A couple of cleanups Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251011063837.2318535-3-visitorckw@gmail.com \
--to=visitorckw@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jserv@ccns.ncku.edu.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perry.yuan@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox