From: Michael Tokarev <mjt@tls.msk.ru>
To: Wei Yang <richard.weiyang@gmail.com>, alex.williamson@redhat.com
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [PATCH] vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to make code self-explain
Date: Wed, 16 Mar 2016 14:27:56 +0300 [thread overview]
Message-ID: <56E9433C.1040503@msgid.tls.msk.ru> (raw)
In-Reply-To: <1455152067-19900-1-git-send-email-richard.weiyang@gmail.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Wei Yang <richard.weiyang@gmail.com>, alex.williamson@redhat.com
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <56E9433C.1040503@msgid.tls.msk.ru> (raw)
In-Reply-To: <1455152067-19900-1-git-send-email-richard.weiyang@gmail.com>
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
next prev parent reply other threads:[~2016-03-16 11:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 0:54 [Qemu-trivial] [PATCH] vfio/pci: replace 1 with PCI_CAP_LIST_NEXT to make code self-explain Wei Yang
2016-02-11 0:54 ` [Qemu-devel] " Wei Yang
2016-03-16 11:27 ` Michael Tokarev [this message]
2016-03-16 11:27 ` Michael Tokarev
2016-03-16 11:52 ` [Qemu-trivial] " Paolo Bonzini
2016-03-16 11:52 ` [Qemu-devel] " Paolo Bonzini
2016-03-17 15:01 ` [Qemu-trivial] " Wei Yang
2016-03-17 15:01 ` [Qemu-devel] " Wei Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56E9433C.1040503@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=alex.williamson@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=richard.weiyang@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.