Skip to content

Commit fcdaab6

Browse files
Yuval ShaiaSantoshShilimkar
authored andcommitted
{IB/{core,ipoib},net/{mlx4,rds}}: Mark unload_allowed as __initdata variable
Replacing __read_mostly directive with __initdata since this variable is used only during module initialization. Module parameter permissions are changed accordingly. Orabug: 23501273 Signed-off-by: Yuval Shaia <[email protected]> Reviewed-by: Shamir Rabinovitch <[email protected]> Reviewed-By: Wengang Wang <[email protected]> Reviewed-by: Santosh Shilimkar <[email protected]>
1 parent c3659a3 commit fcdaab6

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

drivers/infiniband/core/device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ MODULE_AUTHOR("Roland Dreier");
4646
MODULE_DESCRIPTION("core kernel InfiniBand API");
4747
MODULE_LICENSE("Dual BSD/GPL");
4848

49-
int unload_allowed __read_mostly = 1;
49+
int unload_allowed __initdata = 1;
5050

51-
module_param_named(module_unload_allowed, unload_allowed, int, 0444);
51+
module_param_named(module_unload_allowed, unload_allowed, int, 0);
5252
MODULE_PARM_DESC(module_unload_allowed, "Allow this module to be unloaded or not (default 1 for YES)");
5353

5454
struct ib_client_data {

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ MODULE_VERSION(DRV_VERSION);
6161

6262
int ipoib_sendq_size __read_mostly = IPOIB_TX_RING_SIZE;
6363
int ipoib_recvq_size __read_mostly = IPOIB_RX_RING_SIZE;
64-
int unload_allowed __read_mostly = 1;
6564
/* IPOIB_CM_MAX_BAD_CONNS default value (8) is inline with current
6665
* Exadata-ZFS deployment.
6766
* We usually have 2 ZFS heads in current deployment.
@@ -73,8 +72,9 @@ int unload_allowed __read_mostly = 1;
7372
*/
7473
int ipoib_cm_sendq_size __read_mostly = IPOIB_TX_RING_SIZE / IPOIB_CM_MAX_BAD_CONNS;
7574
int ipoib_cm_max_bad_conns = IPOIB_CM_MAX_BAD_CONNS;
75+
int unload_allowed __initdata = 1;
7676

77-
module_param_named(module_unload_allowed, unload_allowed, int, 0444);
77+
module_param_named(module_unload_allowed, unload_allowed, int, 0);
7878
MODULE_PARM_DESC(module_unload_allowed, "Allow this module to be unloaded or not (default 1 for YES)");
7979

8080
module_param_named(send_queue_size, ipoib_sendq_size, int, 0444);

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0");
6565

6666
#endif /* CONFIG_MLX4_DEBUG */
6767

68-
int unload_allowed __read_mostly;
69-
module_param_named(module_unload_allowed, unload_allowed, int, 0444);
68+
int unload_allowed __initdata;
69+
module_param_named(module_unload_allowed, unload_allowed, int, 0);
7070
MODULE_PARM_DESC(module_unload_allowed, "Allow this module to be unloaded or not (default 0 for NO)");
7171

7272
#ifdef CONFIG_PCI_MSI

net/rds/rdma_transport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343

4444
#define RDS_REJ_CONSUMER_DEFINED 28
4545

46-
int unload_allowed __read_mostly;
46+
int unload_allowed __initdata;
4747

48-
module_param_named(module_unload_allowed, unload_allowed, int, 0444);
48+
module_param_named(module_unload_allowed, unload_allowed, int, 0);
4949
MODULE_PARM_DESC(module_unload_allowed, "Allow this module to be unloaded or not (default 0 for NO)");
5050

5151
int rds_rdma_resolve_to_ms[] = {1000, 1000, 2000, 4000, 5000};

0 commit comments

Comments
 (0)