* [PATCH net-next 0/6] drivers/net: constify static ops-variables
@ 2020-08-26 22:56 Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 1/6] net: ethernet: qualcomm: constify qca_serdev_ops Rikard Falkeborn
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-08-26 22:56 UTC (permalink / raw)
To: David S . Miller
Cc: Jakub Kicinski, netdev, linux-kernel, Rikard Falkeborn,
Sergei Shtylyov, Andrew Lunn, Heiner Kallweit, Russell King,
Antoine Tenart, Kalle Valo, ath11k, linux-wireless,
linux-renesas-soc
This series constifies a number of static ops variables, to allow the
compiler to put them in read-only memory. Compile-tested only.
Rikard Falkeborn (6):
net: ethernet: qualcomm: constify qca_serdev_ops
net: ethernet: ravb: constify bb_ops
net: renesas: sh_eth: constify bb_ops
net: phy: at803x: constify static regulator_ops
net: phy: mscc: macsec: constify vsc8584_macsec_ops
net: ath11k: constify ath11k_thermal_ops
drivers/net/ethernet/qualcomm/qca_uart.c | 2 +-
drivers/net/ethernet/renesas/ravb_main.c | 2 +-
drivers/net/ethernet/renesas/sh_eth.c | 2 +-
drivers/net/phy/at803x.c | 4 ++--
drivers/net/phy/mscc/mscc_macsec.c | 2 +-
drivers/net/wireless/ath/ath11k/thermal.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
--
2.28.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 1/6] net: ethernet: qualcomm: constify qca_serdev_ops
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
@ 2020-08-26 22:56 ` Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 2/6] net: ethernet: ravb: constify bb_ops Rikard Falkeborn
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-08-26 22:56 UTC (permalink / raw)
To: David S . Miller; +Cc: Jakub Kicinski, netdev, linux-kernel, Rikard Falkeborn
The only usage of qca_serdev_ops is to pass its address to
serdev_device_set_client_ops() which takes a const pointer. Make it
const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/net/ethernet/qualcomm/qca_uart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qualcomm/qca_uart.c b/drivers/net/ethernet/qualcomm/qca_uart.c
index 375a844cd27c..362b4f5c162c 100644
--- a/drivers/net/ethernet/qualcomm/qca_uart.c
+++ b/drivers/net/ethernet/qualcomm/qca_uart.c
@@ -167,7 +167,7 @@ static void qca_tty_wakeup(struct serdev_device *serdev)
schedule_work(&qca->tx_work);
}
-static struct serdev_device_ops qca_serdev_ops = {
+static const struct serdev_device_ops qca_serdev_ops = {
.receive_buf = qca_tty_receive,
.write_wakeup = qca_tty_wakeup,
};
--
2.28.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 2/6] net: ethernet: ravb: constify bb_ops
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 1/6] net: ethernet: qualcomm: constify qca_serdev_ops Rikard Falkeborn
@ 2020-08-26 22:56 ` Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 3/6] net: renesas: sh_eth: " Rikard Falkeborn
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-08-26 22:56 UTC (permalink / raw)
To: David S . Miller
Cc: Jakub Kicinski, netdev, linux-kernel, Rikard Falkeborn,
Sergei Shtylyov, linux-renesas-soc
The only usage of bb_ops is to assign its address to the ops field in
the mdiobb_ctrl struct, which is a const pointer. Make it const to allow
the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/net/ethernet/renesas/ravb_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index df89d09b253e..f684296df871 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -162,7 +162,7 @@ static int ravb_get_mdio_data(struct mdiobb_ctrl *ctrl)
}
/* MDIO bus control struct */
-static struct mdiobb_ops bb_ops = {
+static const struct mdiobb_ops bb_ops = {
.owner = THIS_MODULE,
.set_mdc = ravb_set_mdc,
.set_mdio_dir = ravb_set_mdio_dir,
--
2.28.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 3/6] net: renesas: sh_eth: constify bb_ops
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 1/6] net: ethernet: qualcomm: constify qca_serdev_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 2/6] net: ethernet: ravb: constify bb_ops Rikard Falkeborn
@ 2020-08-26 22:56 ` Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 4/6] net: phy: at803x: constify static regulator_ops Rikard Falkeborn
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-08-26 22:56 UTC (permalink / raw)
To: David S . Miller
Cc: Jakub Kicinski, netdev, linux-kernel, Rikard Falkeborn,
Sergei Shtylyov, linux-renesas-soc
The only usage of bb_ops is to assign its address to the ops field in
the mdiobb_ctrl struct, which is a const pointer. Make it const to allow
the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/net/ethernet/renesas/sh_eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index f45331ed90b0..586642c33d2b 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1202,7 +1202,7 @@ static void sh_mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit)
}
/* mdio bus control struct */
-static struct mdiobb_ops bb_ops = {
+static const struct mdiobb_ops bb_ops = {
.owner = THIS_MODULE,
.set_mdc = sh_mdc_ctrl,
.set_mdio_dir = sh_mmd_ctrl,
--
2.28.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 4/6] net: phy: at803x: constify static regulator_ops
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
` (2 preceding siblings ...)
2020-08-26 22:56 ` [PATCH net-next 3/6] net: renesas: sh_eth: " Rikard Falkeborn
@ 2020-08-26 22:56 ` Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 5/6] net: phy: mscc: macsec: constify vsc8584_macsec_ops Rikard Falkeborn
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-08-26 22:56 UTC (permalink / raw)
To: David S . Miller
Cc: Jakub Kicinski, netdev, linux-kernel, Rikard Falkeborn,
Andrew Lunn, Heiner Kallweit, Russell King
The only usage of vddio_regulator_ops and vddh_regulator_ops is to
assign their address to the ops field in the regulator_desc struct,
which is a const pointer. Make them const to allow the compiler to
put them in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/net/phy/at803x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 101651b2de54..ed601a7e46a0 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -343,7 +343,7 @@ static int at803x_rgmii_reg_get_voltage_sel(struct regulator_dev *rdev)
return (val & AT803X_DEBUG_RGMII_1V8) ? 1 : 0;
}
-static struct regulator_ops vddio_regulator_ops = {
+static const struct regulator_ops vddio_regulator_ops = {
.list_voltage = regulator_list_voltage_table,
.set_voltage_sel = at803x_rgmii_reg_set_voltage_sel,
.get_voltage_sel = at803x_rgmii_reg_get_voltage_sel,
@@ -364,7 +364,7 @@ static const struct regulator_desc vddio_desc = {
.owner = THIS_MODULE,
};
-static struct regulator_ops vddh_regulator_ops = {
+static const struct regulator_ops vddh_regulator_ops = {
};
static const struct regulator_desc vddh_desc = {
--
2.28.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 5/6] net: phy: mscc: macsec: constify vsc8584_macsec_ops
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
` (3 preceding siblings ...)
2020-08-26 22:56 ` [PATCH net-next 4/6] net: phy: at803x: constify static regulator_ops Rikard Falkeborn
@ 2020-08-26 22:56 ` Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 6/6] net: ath11k: constify ath11k_thermal_ops Rikard Falkeborn
2020-08-26 23:21 ` [PATCH net-next 0/6] drivers/net: constify static ops-variables David Miller
6 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-08-26 22:56 UTC (permalink / raw)
To: David S . Miller
Cc: Jakub Kicinski, netdev, linux-kernel, Rikard Falkeborn,
Andrew Lunn, Heiner Kallweit, Russell King, Antoine Tenart
The only usage of vsc8584_macsec_ops is to assign its address to the
macsec_ops field in the phydev struct, which is a const pointer. Make it
const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/net/phy/mscc/mscc_macsec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/mscc/mscc_macsec.c b/drivers/net/phy/mscc/mscc_macsec.c
index 1d4c012194e9..6cf9b798b710 100644
--- a/drivers/net/phy/mscc/mscc_macsec.c
+++ b/drivers/net/phy/mscc/mscc_macsec.c
@@ -958,7 +958,7 @@ static int vsc8584_macsec_del_txsa(struct macsec_context *ctx)
return 0;
}
-static struct macsec_ops vsc8584_macsec_ops = {
+static const struct macsec_ops vsc8584_macsec_ops = {
.mdo_dev_open = vsc8584_macsec_dev_open,
.mdo_dev_stop = vsc8584_macsec_dev_stop,
.mdo_add_secy = vsc8584_macsec_add_secy,
--
2.28.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 6/6] net: ath11k: constify ath11k_thermal_ops
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
` (4 preceding siblings ...)
2020-08-26 22:56 ` [PATCH net-next 5/6] net: phy: mscc: macsec: constify vsc8584_macsec_ops Rikard Falkeborn
@ 2020-08-26 22:56 ` Rikard Falkeborn
2020-08-26 23:21 ` [PATCH net-next 0/6] drivers/net: constify static ops-variables David Miller
6 siblings, 0 replies; 8+ messages in thread
From: Rikard Falkeborn @ 2020-08-26 22:56 UTC (permalink / raw)
To: David S . Miller
Cc: Jakub Kicinski, netdev, linux-kernel, Rikard Falkeborn,
Kalle Valo, ath11k, linux-wireless
The only usage of ath11k_thermal_ops is to pass its address to
thermal_cooling_device_register() which takes a const pointer. Make it
const to allow the compiler to put it in read-only memory.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
drivers/net/wireless/ath/ath11k/thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath11k/thermal.c b/drivers/net/wireless/ath/ath11k/thermal.c
index 5a7e150c621b..c96b26f39a25 100644
--- a/drivers/net/wireless/ath/ath11k/thermal.c
+++ b/drivers/net/wireless/ath/ath11k/thermal.c
@@ -53,7 +53,7 @@ ath11k_thermal_set_cur_throttle_state(struct thermal_cooling_device *cdev,
return ret;
}
-static struct thermal_cooling_device_ops ath11k_thermal_ops = {
+static const struct thermal_cooling_device_ops ath11k_thermal_ops = {
.get_max_state = ath11k_thermal_get_max_throttle_state,
.get_cur_state = ath11k_thermal_get_cur_throttle_state,
.set_cur_state = ath11k_thermal_set_cur_throttle_state,
--
2.28.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 0/6] drivers/net: constify static ops-variables
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
` (5 preceding siblings ...)
2020-08-26 22:56 ` [PATCH net-next 6/6] net: ath11k: constify ath11k_thermal_ops Rikard Falkeborn
@ 2020-08-26 23:21 ` David Miller
6 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2020-08-26 23:21 UTC (permalink / raw)
To: rikard.falkeborn
Cc: kuba, netdev, linux-kernel, sergei.shtylyov, andrew, hkallweit1,
linux, antoine.tenart, kvalo, ath11k, linux-wireless,
linux-renesas-soc
From: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Date: Thu, 27 Aug 2020 00:56:02 +0200
> This series constifies a number of static ops variables, to allow the
> compiler to put them in read-only memory. Compile-tested only.
Series applied, thank you.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-08-26 23:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 22:56 [PATCH net-next 0/6] drivers/net: constify static ops-variables Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 1/6] net: ethernet: qualcomm: constify qca_serdev_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 2/6] net: ethernet: ravb: constify bb_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 3/6] net: renesas: sh_eth: " Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 4/6] net: phy: at803x: constify static regulator_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 5/6] net: phy: mscc: macsec: constify vsc8584_macsec_ops Rikard Falkeborn
2020-08-26 22:56 ` [PATCH net-next 6/6] net: ath11k: constify ath11k_thermal_ops Rikard Falkeborn
2020-08-26 23:21 ` [PATCH net-next 0/6] drivers/net: constify static ops-variables David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).