soundwire: qcom: Constify static structs
Subsystems (3)
PATCH 1/1 soundwire: qcom: Constify static structs
qcom_swrm_port_ops and qcom_swrm_ops are not modified and can be made const to allow the compiler to put them in read-only memory.
Before:
text data bss dec hex filename 18266 3056 256 21578 544a drivers/soundwire/qcom.o
After:
text data bss dec hex filename 18426 2896 256 21578 544a drivers/soundwire/qcom.o
Signed-off-by Rikard Falkeborn <[email protected]>
--- drivers/soundwire/qcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soundwire/qcom.c +2 -2
@@ -406,13 +406,13 @@ static int qcom_swrm_port_enable(struct sdw_bus *bus,return ctrl->reg_write (ctrl, reg, val); } -static struct sdw_master_port_ops qcom_swrm_port_ops = { +static const struct sdw_master_port_ops qcom_swrm_port_ops = { .dpn_set_port_params = qcom_swrm_port_params, .dpn_set_port_transport_params = qcom_swrm_transport_params, .dpn_port_enable_ch = qcom_swrm_port_enable, }; -static struct sdw_master_ops qcom_swrm_ops = { +static const struct sdw_master_ops qcom_swrm_ops = { .xfer_msg = qcom_swrm_xfer_msg, .pre_bank_switch = qcom_swrm_pre_bank_switch, };
Signature · 1 line
2.27.0
Quoted 10 lines · Rikard Falkeborn
qcom_swrm_port_opsandqcom_swrm_opsare not modified and can be made const to allow the compiler to put them in read-only memory.Before:
text data bss dec hex filename 18266 3056 256 21578 544a drivers/soundwire/qcom.oAfter:
text data bss dec hex filename 18426 2896 256 21578 544a drivers/soundwire/qcom.o
Applied, thanks
Quoted 28 lines
Signed-off-by Rikard Falkeborn <[email protected]>--- drivers/soundwire/qcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/soundwire/qcom.c +2
-2@@ -406,13 +406,13 @@ static int qcom_swrm_port_enable(struct sdw_bus *bus,return ctrl->reg_write (ctrl, reg, val); } -static struct sdw_master_port_ops qcom_swrm_port_ops = { +static const struct sdw_master_port_ops qcom_swrm_port_ops = { .dpn_set_port_params = qcom_swrm_port_params, .dpn_set_port_transport_params = qcom_swrm_transport_params, .dpn_port_enable_ch = qcom_swrm_port_enable, }; -static struct sdw_master_ops qcom_swrm_ops = { +static const struct sdw_master_ops qcom_swrm_ops = { .xfer_msg = qcom_swrm_xfer_msg, .pre_bank_switch = qcom_swrm_pre_bank_switch, };Signature · 1 line
2.27.0
Signature · 1 line
~Vinod