From b251f40bc2c49892eee8827ef108695f3995ecd9 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 26 Dec 2003 21:41:11 +0000 Subject: [PATCH] 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 --- ChangeLog | 3 +++ setpci.c | 27 +++++++++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) 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'); } } -- 2.39.2