Message ID | CAOPLpQdLSfHn4=zHVYpZMcw1cHPwtV3He-Sxng_yjGKwdpBK8A@mail.gmail.com |
---|---|
State | Superseded |
Headers | show |
On Thu, Jun 21, 2012 at 9:22 AM, Ulrich Drepper <drepper@gmail.com> wrote: > On Thu, Jun 21, 2012 at 8:17 AM, Ulrich Drepper <drepper@gmail.com> wrote: >> On Wed, Jun 20, 2012 at 11:50 PM, Yinghai Lu <yinghai@kernel.org> wrote: >>> please check -v3, and it will add 40 lines. >> >> Won't this version print out something like >> >> PCI: unknown option `busnum_node=xx:yy' > > It does. yes, but only when you have pci=busnum_node... i changed grammar to only "busnum_node=..." > > If you apply the following patch on top of your version 3 patch it > seems to work and is slightly more efficient. > > > Signed-off-by: Ulrich Drepper <drepper@gmail.com> > > diff -u b/arch/x86/pci/common.c b/arch/x86/pci/common.c > --- b/arch/x86/pci/common.c > +++ b/arch/x86/pci/common.c > @@ -494,16 +494,22 @@ > return 0; > } > > +static const char *busnum_node_param; > + > +static void remember_busnum_node(const char *str) > +{ > + busnum_node_param = str; > +} > + > int get_user_busnum_node(int busnum) > { > int bus, node, count; > - char *p; > + const char *p; > > - p = strstr(boot_command_line, "busnum_node="); > + p = busnum_node_param; > if (!p) > return -1; > > - p += 12; /* strlen("busnum_node=") */ > while (*p) { > count = 0; > if (sscanf(p, "%x:%x%n", &bus, &node, &count) != 2) { > @@ -607,6 +613,9 @@ > } else if (!strcmp(str, "nocrs")) { > pci_probe |= PCI_ROOT_NO_CRS; > return NULL; > + } else if (!strncmp(str, "busnum_node=", 12)) { > + remember_busnum_node(str + 12); > + return NULL; > } else if (!strcmp(str, "earlydump")) { > pci_early_dump_regs = 1; > return NULL; Yes, that would be better. Thanks Yinghai -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, Jun 21, 2012 at 2:11 PM, Yinghai Lu <yinghai@kernel.org> wrote: > Yes, that would be better. > [...] Can you post a complete patch so that it can be queued up for inclusion? -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff -u b/arch/x86/pci/common.c b/arch/x86/pci/common.c --- b/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -494,16 +494,22 @@ return 0; } +static const char *busnum_node_param; + +static void remember_busnum_node(const char *str) +{ + busnum_node_param = str; +} + int get_user_busnum_node(int busnum) { int bus, node, count; - char *p; + const char *p; - p = strstr(boot_command_line, "busnum_node="); + p = busnum_node_param; if (!p) return -1; - p += 12; /* strlen("busnum_node=") */ while (*p) { count = 0; if (sscanf(p, "%x:%x%n", &bus, &node, &count) != 2) { @@ -607,6 +613,9 @@ } else if (!strcmp(str, "nocrs")) { pci_probe |= PCI_ROOT_NO_CRS; return NULL; + } else if (!strncmp(str, "busnum_node=", 12)) { + remember_busnum_node(str + 12); + return NULL; } else if (!strcmp(str, "earlydump")) { pci_early_dump_regs = 1; return NULL;