Re: [PATCH v7 7/9] PCI/IDE: Add IDE establishment helpers

Jonathan Cameron
2025-10-29T16:25:59Z

On Thu, 23 Oct 2025 19:04:16 -0700
Dan Williams <dan.j.williams@intel.com> wrote:

> There are two components to establishing an encrypted link, provisioning
...

Just one trivial comment. I'll assume you'll resolve what Aneesh raised.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

> diff --git a/include/linux/pci-ide.h b/include/linux/pci-ide.h
> new file mode 100644
> index 000000000000..e638f9429bf9
> --- /dev/null
> +++ b/include/linux/pci-ide.h
> @@ -0,0 +1,78 @@

> diff --git a/drivers/pci/ide.c b/drivers/pci/ide.c
> index aa54d088129d..302f7bae6c96 100644
> --- a/drivers/pci/ide.c
> +++ b/drivers/pci/ide.c

>

> +static struct stream_index *alloc_stream_index(struct ida *ida, u8 max,
> + struct stream_index *stream)
> +{
> + int id;
> +
> + if (!max)
> + return NULL;
> +
> + id = ida_alloc_range(ida, 0, max - 1, GFP_KERNEL);

ida_alloc_max() is perhaps a small readability improvement.

> + if (id < 0)
> + return NULL;
> +
> + *stream = (struct stream_index) {
> + .ida = ida,
> + .stream_index = id,
> + };
> + return stream;
> +}