linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs-qcom: Make structure ufs_hba_qcom_vops constant
@ 2019-08-19  7:55 Nishka Dasgupta
  2019-08-19  8:25 ` Vivek Gautam
  2019-08-20  2:18 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Nishka Dasgupta @ 2019-08-19  7:55 UTC (permalink / raw)
  To: agross, alim.akhtar, avri.altman, pedrom.sousa, jejb,
	martin.peterson, linux-scsi, linux-arm-msm
  Cc: Nishka Dasgupta

Static structure ufs_hba_qcom_vops, of type ufs_hba_variant_ops, is used
only once, when it is passed as the second argument to function
ufshcd_pltfrm_init(). In the definition of ufshcd_pltfrm_init(), its
second parameter (corresponding to ufs_hba_qcom_vops) is declared as
constant. Hence declare ufs_hba_qcom_vops itself constant as well to
protect it from unintended modification.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/scsi/ufs/ufs-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index ee4b1da1e223..4473f339cbc0 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -1551,7 +1551,7 @@ static void ufs_qcom_dump_dbg_regs(struct ufs_hba *hba)
  * The variant operations configure the necessary controller and PHY
  * handshake during initialization.
  */
-static struct ufs_hba_variant_ops ufs_hba_qcom_vops = {
+static const struct ufs_hba_variant_ops ufs_hba_qcom_vops = {
 	.name                   = "qcom",
 	.init                   = ufs_qcom_init,
 	.exit                   = ufs_qcom_exit,
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-20  2:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19  7:55 [PATCH] scsi: ufs-qcom: Make structure ufs_hba_qcom_vops constant Nishka Dasgupta
2019-08-19  8:25 ` Vivek Gautam
2019-08-20  2:18 ` Martin K. Petersen

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).