[PATCH v7 1/6] PCI: spacemit-k1: Add device data support

Andy Shevchenko andriy.shevchenko at linux.intel.com
Wed Oct 21 02:12:15 PDT 2026


On Wed, Oct 21, 2026 at 03:51:20PM +0800, Inochi Amaoto wrote:
> On Mon, Oct 19, 2026 at 11:41:08AM -0500, Bjorn Helgaas wrote:
> > On Tue, Sep 29, 2026 at 04:37:47PM +0800, Inochi Amaoto wrote:

...

> > > +struct k1_pcie_device_data {
> > > +	const struct dw_pcie_host_ops *host_ops;
> > > +	const struct dw_pcie_ops *ops;
> > > +	int (*parse_port)(struct k1_pcie *k1);
> > > +};
> > 
> > Does the "const" here add anything useful?  This patch suggests maybe
> > not:
> > 
> >   https://lore.kernel.org/all/20260911233541.1650895-2-james.quinlan@broadcom.com/
> 
> I am not sure whether the compiler can make use it.
> And I have not seen any explaination for why no reason
> for that. It is good to have a clarification.

These const make no sense. First of all, the third one is missing it.
And I have no idea what would be the proper syntax to add a such. But
adding a such make it clear that there no sense to have them. Either
you make the const the whole data type instance on the user level or
don't do it at all.

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-riscv mailing list