Skip to contentSkip to conversation

ahci: Changing two module params with static and __read_mostly

PATCH Superseded Chuansheng Liu 3 participants 5 messages Sep 17, 2013 – Sep 22, 2013 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ahci: Changing two module params with static and __read_mostly

Here module parameters ahci_em_messages and devslp_idle_timeout can be set as static and __read_mostly.

---
 drivers/ata/libahci.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/ata/libahci.c +3 -2
index acfd0f7..1757631 100644
@@ -189,14 +189,15 @@ struct ata_port_operations ahci_pmp_retry_srst_ops = {
 };
 EXPORT_SYMBOL_GPL(ahci_pmp_retry_srst_ops);
 
-int ahci_em_messages = 1;
+static int ahci_em_messages __read_mostly = 1;
 EXPORT_SYMBOL_GPL(ahci_em_messages);
 module_param(ahci_em_messages, int, 0444);
 /* add other LED protocol types when they become supported */
 MODULE_PARM_DESC(ahci_em_messages,
 	"AHCI Enclosure Management Message control (0 = off, 1 = on)");
 
-int devslp_idle_timeout = 1000;	/* device sleep idle timeout in ms */
+/* device sleep idle timeout in ms */
+static int devslp_idle_timeout __read_mostly = 1000;
 module_param(devslp_idle_timeout, int, 0644);
 MODULE_PARM_DESC(devslp_idle_timeout, "device sleep idle timeout");
 
Signature · 1 line
1.7.9.5
#1 lore raw

drivers/ata/libahci.c

Quoted 9 lines · Chuansheng Liu

Here module parameters ahci_em_messages and devslp_idle_timeout can be set as static and __read_mostly.

---
 drivers/ata/libahci.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/ata/libahci.c +0 -0

[]

drivers/ata/libahci.c struct ata_port_operations ahci_pmp_retry_srst_ops = { · line 192

Quoted 6 lines
drivers/ata/libahci.c +1 -1
@@ -189,14 +189,15 @@ struct ata_port_operations ahci_pmp_retry_srst_ops = {
 };
 EXPORT_SYMBOL_GPL(ahci_pmp_retry_srst_ops);
 
-int ahci_em_messages = 1;
+static int ahci_em_messages __read_mostly = 1;

This one could also be converted to
static bool ahci_em_messages __read_mostly = true;

#2 lore raw
Quoted 23 lines

-----Original Message-----
From: Joe Perches [mailto:[email protected]]
Sent: Wednesday, September 18, 2013 12:24 AM
To: Liu, Chuansheng
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] ahci: Changing two module params with static and __read_mostly

drivers/ata/libahci.c

Quoted 9 lines · Chuansheng Liu

Here module parameters ahci_em_messages and devslp_idle_timeout can be set as static and __read_mostly.

---
 drivers/ata/libahci.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/ata/libahci.c +0 -0

[]

drivers/ata/libahci.c struct ata_port_operations

Quoted 1 line
drivers/ata/libahci.c +0 -0
@@ -189,14 +189,15 @@ struct ata_port_operations

ahci_pmp_retry_srst_ops = {

Quoted 9 lines

drivers/ata/libahci.c struct ata_port_operations ahci_pmp_retry_srst_ops = { · line 192

Quoted 5 lines
drivers/ata/libahci.c +1 -1
 };
 EXPORT_SYMBOL_GPL(ahci_pmp_retry_srst_ops);
 
-int ahci_em_messages = 1;
+static int ahci_em_messages __read_mostly = 1;

This one could also be converted to
static bool ahci_em_messages __read_mostly = true;

Thanks, will update one new patch.

#3 lore raw

PATCH v2 1/1 ahci: Changing two module params with static and __read_mostly

In reply to Chuansheng Liu

Here module parameters ahci_em_messages and devslp_idle_timeout can be set as static and __read_mostly.

---
 drivers/ata/libahci.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/ata/libahci.c +4 -3
index acfd0f7..b67086f 100644
@@ -189,14 +189,15 @@ struct ata_port_operations ahci_pmp_retry_srst_ops = {
 };
 EXPORT_SYMBOL_GPL(ahci_pmp_retry_srst_ops);
 
-int ahci_em_messages = 1;
+static bool ahci_em_messages __read_mostly = true;
 EXPORT_SYMBOL_GPL(ahci_em_messages);
-module_param(ahci_em_messages, int, 0444);
+module_param(ahci_em_messages, bool, 0444);
 /* add other LED protocol types when they become supported */
 MODULE_PARM_DESC(ahci_em_messages,
 	"AHCI Enclosure Management Message control (0 = off, 1 = on)");
 
-int devslp_idle_timeout = 1000;	/* device sleep idle timeout in ms */
+/* device sleep idle timeout in ms */
+static int devslp_idle_timeout __read_mostly = 1000;
 module_param(devslp_idle_timeout, int, 0644);
 MODULE_PARM_DESC(devslp_idle_timeout, "device sleep idle timeout");
 
Signature · 1 line
1.7.9.5
Applied
#4 lore raw
Quoted 5 lines · Chuansheng Liu

Here module parameters ahci_em_messages and devslp_idle_timeout can be set as static and __read_mostly.

Applied to libata/for-3.13. Thanks.

Signature · 1 line
tejun