linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Monoses <jani@virtualro.ic.ro>
To: mj@suse.cz
Cc: linux-kernel@vger.kernel.org
Subject: [minor patch] pci.h
Date: Mon, 11 Dec 2000 18:34:30 +0200 (EET)	[thread overview]
Message-ID: <Pine.LNX.4.10.10012111826110.2565-100000@virtualro.ic.ro> (raw)


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/

                 reply	other threads:[~2000-12-11 17:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.10.10012111826110.2565-100000@virtualro.ic.ro \
    --to=jani@virtualro.ic.ro \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).