linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Nishka Dasgupta <nishkadg.linux@gmail.com>
Cc: songxiaowei@hisilicon.com, wangbinghui@hisilicon.com,
	bhelgaas@google.com, linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: kirin: Make structure kirin_dw_pcie_ops constant
Date: Wed, 21 Aug 2019 12:12:17 +0100	[thread overview]
Message-ID: <20190821111217.GA30487@e121166-lin.cambridge.arm.com> (raw)
In-Reply-To: <20190819073946.32458-1-nishkadg.linux@gmail.com>

On Mon, Aug 19, 2019 at 01:09:46PM +0530, Nishka Dasgupta wrote:
> Static variable kirin_dw_pcie_ops, of type dw_pcie_ops, is used only
> once, when it is assigned to the constant field ops of variable pci
> (having type dw_pcie). Hence kirin_dw_pcie_ops is never modified.
> Therefore, make it constant to protect it from unintended modification.
> Issue found with Coccinelle.
> 
> Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
> ---
>  drivers/pci/controller/dwc/pcie-kirin.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to pci/dwc for v5.4, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
> index 8df1914226be..c19617a912bd 100644
> --- a/drivers/pci/controller/dwc/pcie-kirin.c
> +++ b/drivers/pci/controller/dwc/pcie-kirin.c
> @@ -436,7 +436,7 @@ static int kirin_pcie_host_init(struct pcie_port *pp)
>  	return 0;
>  }
>  
> -static struct dw_pcie_ops kirin_dw_pcie_ops = {
> +static const struct dw_pcie_ops kirin_dw_pcie_ops = {
>  	.read_dbi = kirin_pcie_read_dbi,
>  	.write_dbi = kirin_pcie_write_dbi,
>  	.link_up = kirin_pcie_link_up,
> -- 
> 2.19.1
> 

      parent reply	other threads:[~2019-08-21 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19  7:39 [PATCH] PCI: kirin: Make structure kirin_dw_pcie_ops constant Nishka Dasgupta
2019-08-19 17:30 ` Andrew Murray
2019-08-21 11:12 ` Lorenzo Pieralisi [this message]

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=20190821111217.GA30487@e121166-lin.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=nishkadg.linux@gmail.com \
    --cc=songxiaowei@hisilicon.com \
    --cc=wangbinghui@hisilicon.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).