On Sat, Oct 18, 2025 at 12:15:00PM -0700, Alok Tiwari wrote:
> In eni_vdpa_request_irq(), the error message for requesting the config
> vector IRQ prints the loop index i. However, i is only valid inside the
> queue setup loop. At the point of requesting the config IRQ, i has gone
> out of scope and does not correspond to any vector, which makes the log
> misleading.

It's not that it has gone out of scope - it equals queues.
which happens to be the right thing to report:
        irq = pci_irq_vector(pdev, queues);

both the code and the message are confusing though,
I agree.



> Update the error message to print the actual return code ret instead of
> the stale i value.
> 
> Fixes: e85087beedca ("eni_vdpa: add vDPA driver for Alibaba ENI")
> Signed-off-by: Alok Tiwari <[email protected]>
> ---
>  drivers/vdpa/alibaba/eni_vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/alibaba/eni_vdpa.c b/drivers/vdpa/alibaba/eni_vdpa.c
> index e476504db0c8..e3b20ea7c423 100644
> --- a/drivers/vdpa/alibaba/eni_vdpa.c
> +++ b/drivers/vdpa/alibaba/eni_vdpa.c
> @@ -196,7 +196,7 @@ static int eni_vdpa_request_irq(struct eni_vdpa *eni_vdpa)
>       ret = devm_request_irq(&pdev->dev, irq, eni_vdpa_config_handler, 0,
>                              eni_vdpa->msix_name, eni_vdpa);
>       if (ret) {
> -             ENI_ERR(pdev, "failed to request irq for config vq %d\n", i);
> +             ENI_ERR(pdev, "failed to request irq for config vector 
> ret=%d\n", ret);


you do not really need to print err it is reported up the stack.

I would probably go with:

                ENI_ERR(pdev, "failed to request irq %d for config\n", queues);



>               goto err;
>       }
>       vp_legacy_config_vector(ldev, queues);
> -- 
> 2.50.1


Reply via email to