[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to m
From: |
Michael Tokarev |
Subject: |
Re: [Qemu-devel] [PATCH] vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to make code self-explain |
Date: |
Wed, 16 Mar 2016 14:27:56 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 |
11.02.2016 03:54, Wei Yang wrote:
> Use the macro PCI_CAP_LIST_NEXT instead of 1, so that the code would be
> more self-explain.
>
> This patch makes this change and also fixs one typo in comment.
>
> for (tmp = pdev->config[PCI_CAPABILITY_LIST]; tmp;
> - tmp = pdev->config[tmp + 1]) {
> + tmp = pdev->config[tmp + PCI_CAP_LIST_NEXT]) {
> - next = pdev->config[pos + 1];
> + next = pdev->config[pos + PCI_CAP_LIST_NEXT];
Hmm. I'm not sure the new version is better, to me "+1" reads
easier than the new symbolic constant variant.
If it were something like pdev->config[PCI_CAP_LIST_NEXT], that'd be
nice, but not "pos + PCI_CAP_LIST_NEXT".
But again, I'm not pci config space expert and don't understand
the basics :)
Thanks,
/mjt
- Re: [Qemu-devel] [PATCH] vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to make code self-explain,
Michael Tokarev <=