linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivek Gautam <vivek.gautam@codeaurora.org>
To: Nishka Dasgupta <nishkadg.linux@gmail.com>
Cc: Andy Gross <agross@kernel.org>,
	ALIM AKHTAR <alim.akhtar@samsung.com>,
	avri.altman@wdc.com, pedrom.sousa@synopsys.com,
	jejb@linux.ibm.com, martin.peterson@oracle.com,
	linux-scsi@vger.kernel.org,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH] scsi: ufs-qcom: Make structure ufs_hba_qcom_vops constant
Date: Mon, 19 Aug 2019 13:55:29 +0530	[thread overview]
Message-ID: <CAFp+6iHJQJiNw2JKFJi7=9-Ac8nZbTPv5XGARqr9iHzcJb0yOA@mail.gmail.com> (raw)
In-Reply-To: <20190819075557.1547-1-nishkadg.linux@gmail.com>

On Mon, Aug 19, 2019 at 1:26 PM Nishka Dasgupta
<nishkadg.linux@gmail.com> wrote:
>
> 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
>
Reviewed-by: Vivek Gautam <vivek.gautam@codeaurora.org>

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

  reply	other threads:[~2019-08-19  8:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-08-20  2:18 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFp+6iHJQJiNw2JKFJi7=9-Ac8nZbTPv5XGARqr9iHzcJb0yOA@mail.gmail.com' \
    --to=vivek.gautam@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.peterson@oracle.com \
    --cc=nishkadg.linux@gmail.com \
    --cc=pedrom.sousa@synopsys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).