From: "Naresh Kumar Inna" <knaresh@india.hp.com>
To: <linux-kernel@vger.kernel.org>
Subject: Question on __pci_bus_find_cap().
Date: Fri, 7 May 2004 15:29:04 +0530 [thread overview]
Message-ID: <00fe01c43419$eeb4ce70$38624c0f@eb9856> (raw)
Hi,
The PCI spec 3.0 says that the Capabilities List is terminated with 00H
which indicates the last capability in the linked list. But in the code of
'__pci_bus_find_cap()', the while loop ( see below) terminates when the
value of the position is < 0x40 or a ttl value becomes zero. Shouldnt it
simply check for the value 0x0 and terminate? Please let me know if I am
missing something. Here is the diff:
--- pci.c.orig 2004-04-04 09:06:54.000000000 +0530
+++ pci.c.mod 2004-05-07 15:06:50.000000000 +0530
@@ -71,7 +71,6 @@
{
u16 status;
u8 pos, id;
- int ttl = 48;
pci_bus_read_config_word(bus, devfn, PCI_STATUS, &status);
if (!(status & PCI_STATUS_CAP_LIST))
@@ -88,7 +87,7 @@
default:
return 0;
}
- while (ttl-- && pos >= 0x40) {
+ while (pos != 0x0) {
pos &= ~3;
pci_bus_read_config_byte(bus, devfn, pos + PCI_CAP_LIST_ID,
&id);
if (id == 0xff)
Regards,
Naresh Kumar,
HP-ISO,
Bangalore.
reply other threads:[~2004-05-07 9:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='00fe01c43419$eeb4ce70$38624c0f@eb9856' \
--to=knaresh@india.hp.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®