From: Martin Mares Date: Fri, 26 Dec 2003 21:41:11 +0000 (+0000) Subject: setpci: -D should not disable reading X-Git-Tag: v3.0.0~153 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b251f40bc2c49892eee8827ef108695f3995ecd9;p=pciutils.git setpci: -D should not disable reading setpci.c (ex_op): The demo mode was never documented to disable reads, only writes, so conform with the definition. git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-12 --- diff --git a/ChangeLog b/ChangeLog index cc15ea5..7192ee0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * setpci.c (main): Better error messages. + * setpci.c (ex_op): The demo mode was never documented to disable reads, + only writes, so conform with the definition. + * pciutils.h, common.c, setpci.c: Introduced a NONRET macro encapsulating the GCC specific __attribute__((noreturn)) and killed the hack with redefining __attribute__ on non-GCC compilers. diff --git a/setpci.c b/setpci.c index 5af3589..c6b3cc0 100644 --- a/setpci.c +++ b/setpci.c @@ -124,24 +124,19 @@ exec_op(struct op *op, struct pci_dev *dev) { if (verbose) printf(" = "); - if (!demo_mode) + switch (width) { - switch (width) - { - case 1: - x = pci_read_byte(dev, addr); - break; - case 2: - x = pci_read_word(dev, addr); - break; - default: - x = pci_read_long(dev, addr); - break; - } - printf(formats[width], x); + case 1: + x = pci_read_byte(dev, addr); + break; + case 2: + x = pci_read_word(dev, addr); + break; + default: + x = pci_read_long(dev, addr); + break; } - else - putchar('?'); + printf(formats[width], x); putchar('\n'); } }