Thread (13 messages) 13 messages, 3 authors, 2026-01-19

Re: [PATCH v8 2/5] PCI: endpoint: Add BAR subrange mapping support

From: Frank Li <Frank.li@nxp.com>
Date: 2026-01-15 19:44:19
Also in: imx, linux-arm-msm, linux-omap, linux-pci, linux-renesas-soc, linux-rockchip, linux-tegra, lkml

On Thu, Jan 15, 2026 at 04:21:21PM +0100, Niklas Cassel wrote:
On Thu, Jan 15, 2026 at 09:52:58AM -0500, Frank Li wrote:
quoted
quoted
@@ -127,6 +150,10 @@ struct pci_epf_bar {
 	size_t		mem_size;
 	enum pci_barno	barno;
 	int		flags;
+
+	/* Optional sub-range mapping */
+	unsigned int	num_submap;
+	struct pci_epf_bar_submap	*submap;
struct pci_epf_bar_submap submap[] __counted_by(num_submap);

Not sure if use this simplify alloc/free.
Your suggestion changes the submap from a pointer to a flexible array
member.

A flexible array member must always be last in the struct,
and you can only have one flexible array member per struct.

Additionally, using a flexible array member requires the struct to
always be allocated on the heap. You can't allocate a struct with a
flexible array member on the stack.

So I'm not sure that if your suggestion is something we want.
Yes, forget my comments if not fit.

Frank

Kind regards,
Niklas
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help