On Wed, Jul 14, 2021 at 08:57:06AM +0200, Jiri Slaby wrote: > On 13. 07. 21, 12:40, Andy Shevchenko wrote: > > The loop can be refactored by using ARRAY_SIZE() instead of NULL terminator. > > This reduces code base and makes it easier to read and understand. > > + iobase = request_region(inta_addr[i], ITE_887x_IOSIZE, "ite887x"); > > Irrelevant whitespace change. > > > if (iobase != NULL) { > > /* write POSIO0R - speed | size | ioport */ > > pci_write_config_dword(dev, ITE_887x_POSIO0, > > ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED | > > ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]); > > /* write INTCBAR - ioport */ > > - pci_write_config_dword(dev, ITE_887x_INTCBAR, > > - inta_addr[i]); > > + pci_write_config_dword(dev, ITE_887x_INTCBAR, inta_addr[i]); > > detto > > > ret = inb(inta_addr[i]); > > if (ret != 0xff) { > > /* ioport connected */ > > break; > > } > > release_region(iobase->start, ITE_887x_IOSIZE); > > - iobase = NULL; > > } > > - i++; I believe with Joe's suggestion I can improve entire body of this branch perhaps in a separate patch. Do you prefer one or two patches? > > if (!inta_addr[i]) { > > OOB access? Yep, Dan reported the same. Missed during conversion. Will fix. -- With Best Regards, Andy Shevchenko