Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752627AbeACMVn (ORCPT + 1 other); Wed, 3 Jan 2018 07:21:43 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49090 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbeACMVm (ORCPT ); Wed, 3 Jan 2018 07:21:42 -0500 Date: Wed, 3 Jan 2018 12:22:37 +0000 From: Lorenzo Pieralisi To: Julia Lawall Cc: Stanimir Varbanov , kernel-janitors@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/12] PCI: qcom: account for const type of of_device_id.data Message-ID: <20180103122237.GD26554@red-moon> References: <1514899688-27844-1-git-send-email-Julia.Lawall@lip6.fr> <1514899688-27844-5-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1514899688-27844-5-git-send-email-Julia.Lawall@lip6.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 02, 2018 at 02:28:00PM +0100, Julia Lawall wrote: > This driver creates various const structures that it stores in the > data field of an of_device_id array. > > Adding const to the declaration of the location that receives the > const value from the data field ensures that the compiler will > continue to check that the value is not modified. Furthermore, the > const-discarding cast on the extraction from the data field is no > longer needed. > > Done using Coccinelle. > > Signed-off-by: Julia Lawall > > --- > drivers/pci/dwc/pcie-qcom.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Hi Julia, I am happy to take this patch through the PCI tree unless you see a problem with that, please let me know. Thanks, Lorenzo > diff -u -p a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c > --- a/drivers/pci/dwc/pcie-qcom.c > +++ b/drivers/pci/dwc/pcie-qcom.c > @@ -171,7 +171,7 @@ struct qcom_pcie { > union qcom_pcie_resources res; > struct phy *phy; > struct gpio_desc *reset; > - struct qcom_pcie_ops *ops; > + const struct qcom_pcie_ops *ops; > }; > > #define to_qcom_pcie(x) dev_get_drvdata((x)->dev) > @@ -1234,7 +1234,7 @@ static int qcom_pcie_probe(struct platfo > > pcie->pci = pci; > > - pcie->ops = (struct qcom_pcie_ops *)of_device_get_match_data(dev); > + pcie->ops = of_device_get_match_data(dev); > > pcie->reset = devm_gpiod_get_optional(dev, "perst", GPIOD_OUT_LOW); > if (IS_ERR(pcie->reset)) >