lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200609230029.69802-1-rikard.falkeborn@gmail.com>
Date:   Wed, 10 Jun 2020 01:00:29 +0200
From:   Rikard Falkeborn <rikard.falkeborn@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     agross@...nel.org, bjorn.andersson@...aro.org, vkoul@...nel.org,
        sanyog.r.kale@...el.com, pierre-louis.bossart@...ux.intel.com,
        linux-arm-msm@...r.kernel.org, alsa-devel@...a-project.org,
        linux-kernel@...r.kernel.org,
        Rikard Falkeborn <rikard.falkeborn@...il.com>
Subject: [PATCH] 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 <rikard.falkeborn@...il.com>
---
 drivers/soundwire/qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index a1c2a44a3b4d..915c2cf0c274 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -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,
 };
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ