[coreboot] [PATCH]ich_gpio_dump util ACK?

ron minnich rminnich at gmail.com
Sun Mar 9 08:23:47 CET 2008

I should have been clearer.

+		perror("You need to be root.\n");

No, the issue here is the iopl failed. In many cases it will be "you
need to be root" but you can't be sure in all.

So you want this:

+		perror("Enabling IO ports via iopl(3)");

perror will take care of telling why; you need to let the user know
what the program
was trying to do.

Also, just FYI:
+	printf("GPIOBASE = 0x%04x\n\n", gpiobadd);
+	pci_free_dev(sb);
+	pci_cleanup(pacc);
+	map_gpio(gpiobadd);

It's clean coding style, but the pci_free_dev and pci_cleanup are not
really necessary ... your program is leaving right after the map_gpio,
and these operations are not doing anything that you need to. Plus, if
someone wants to add some more looking around in the pci space, later,
they'll have to move this free/cleanup code around. But not really a
huge deal either way.



More information about the coreboot mailing list