[PATCH 1/4] char: use named initializers for acpi_device_id

Pawel Zalewski via B4 Relay <[email protected]>
Newsgroups org.kernel.vger.linux-integrity,org.kernel.feeds.b4-sent,org.kernel.vger.linux-crypto,org.kernel.vger.linux-kernel,org.kernel.vger.platform-driver-x86
Message-ID <[email protected]>
From: "Pawel Zalewski (The Capable Hub)" <[email protected]>

Use a named initializer for the acpi_device_id fields which
makes the code more readable and consistent with how lists
are initialized in the rest of the kernel code base. Also
drop explicitly setting fields to 0 where it is redundant.

While we are at it - unify the list terminator to have
a single space between the brackets and no trailing
comma.

Signed-off-by: Pawel Zalewski (The Capable Hub) <[email protected]>
---
 drivers/char/hpet.c   | 4 ++--
 drivers/char/sonypi.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 285c6037417a..88d0d4750a6b 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -1004,8 +1004,8 @@ static int hpet_acpi_probe(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id hpet_device_ids[] = {
-	{"PNP0103", 0},
-	{"", 0},
+	{ .id = "PNP0103" },
+	{ }
 };
 
 static struct platform_driver hpet_acpi_driver = {
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 9309cfb935be..fb6357ba69dc 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1136,8 +1136,8 @@ static void sonypi_acpi_remove(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id sonypi_device_ids[] = {
-	{"SNY6001", 0},
-	{"", 0},
+	{ .id = "SNY6001" },
+	{ }
 };
 
 static struct platform_driver sonypi_acpi_driver = {

-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.