[minor patch] pci.h

From: Jani Monoses (jani@virtualro.ic.ro)
Date: Mon Dec 11 2000 - 11:34:30 EST


Hi Martin
        this patch makes computing of pci_resource_len a bit more
straightforward and hopefully still correct.Plus an aesthetic change in a
struct declaration :)

--- /usr/src/clean/linux/include/linux/pci.h Mon Dec 11 16:49:19 2000
+++ pci.h Mon Dec 11 17:54:24 2000
@@ -432,8 +432,7 @@
         int (*write_dword)(struct pci_dev *, int where, u32 val);
 };
 
-struct pbus_set_ranges_data
-{
+struct pbus_set_ranges_data {
         int found_vga;
         unsigned long io_start, io_end;
         unsigned long mem_start, mem_end;
@@ -636,9 +635,8 @@
 #define pci_resource_end(dev,bar) ((dev)->resource[(bar)].end)
 #define pci_resource_flags(dev,bar) ((dev)->resource[(bar)].flags)
 #define pci_resource_len(dev,bar) \
- ((pci_resource_start((dev),(bar)) == 0 && \
- pci_resource_end((dev),(bar)) == \
- pci_resource_start((dev),(bar))) ? 0 : \
+ (!(pci_resource_start((dev),(bar)) || \
+ pci_resource_end((dev),(bar))) ? 0 : \
                                                           \
          (pci_resource_end((dev),(bar)) - \
           pci_resource_start((dev),(bar)) + 1))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Dec 15 2000 - 21:00:22 EST