Skip to contentSkip to conversation

PCI: Remove unnecessary static initialization to false

PATCH In review Jiwon Kang 3 participants 3 messages Jul 30 – Sep 10 PCI

lore
Share & tools
lore

Jiwon Kang

author
#0 lore raw

PATCH 1/1 PCI: Remove unnecessary static initialization to false

Static variables are zero-initialized by default, so explicitly initializing to false is redundant. Remove the initializer to follow kernel coding style.

---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.c +1 -1
index 77b17b13ee615..ee2beaacbc73f 100644
@@ -6671,7 +6671,7 @@ static void of_pci_reserve_static_domain_nr(void)
 
 static int of_pci_bus_find_domain_nr(struct device *parent)
 {
-	static bool static_domains_reserved = false;
+	static bool static_domains_reserved;
 	int domain_nr;
 
 	/* On the first call scan device tree for static allocations. */
Signature · 1 line
2.34.1
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 3 lines

Static variables are zero-initialized by default, so explicitly initializing to false is redundant. Remove the initializer to follow kernel coding style.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to Jiwon Kang
Quoted 3 lines · Jiwon Kang

Static variables are zero-initialized by default, so explicitly initializing to false is redundant. Remove the initializer to follow kernel coding style.

Thanks; can you repost this with a Signed-off-by?

Quoted 20 lines
---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.c +1 -1
index 77b17b13ee615..ee2beaacbc73f 100644
@@ -6671,7 +6671,7 @@ static void of_pci_reserve_static_domain_nr(void)
 
 static int of_pci_bus_find_domain_nr(struct device *parent)
 {
-	static bool static_domains_reserved = false;
+	static bool static_domains_reserved;
 	int domain_nr;
 
 	/* On the first call scan device tree for static allocations. */
Signature · 1 line
2.34.1