aboutsummaryrefslogtreecommitdiff
path: root/drivers/ieee1394/highlevel.c
diff options
context:
space:
mode:
authorBen Collins <bcollins@ubuntu.com>2006-06-12 18:15:31 -0400
committerBen Collins <bcollins@ubuntu.com>2006-06-12 18:15:31 -0400
commit6737231ead125c7cee7ce4d3a74179bdac085529 (patch)
treef0c996c8c48d07398c47ada5a2dacdcbf0800770 /drivers/ieee1394/highlevel.c
parente269d276792684a13ab0d9acd8c024ec7d6c5f4d (diff)
ieee1394: add preprocessor constant for invalid csr address
Replace occurrences of the magic value ~(u64)0 for invalid CSR address spaces by a named constant for better readability. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Diffstat (limited to 'drivers/ieee1394/highlevel.c')
-rw-r--r--drivers/ieee1394/highlevel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c
index 29c5255b933..165dcd66956 100644
--- a/drivers/ieee1394/highlevel.c
+++ b/drivers/ieee1394/highlevel.c
@@ -301,7 +301,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
{
struct hpsb_address_serve *as, *a1, *a2;
struct list_head *entry;
- u64 retval = ~0ULL;
+ u64 retval = CSR1212_INVALID_ADDR_SPACE;
unsigned long flags;
u64 align_mask = ~(alignment - 1);
@@ -314,9 +314,10 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
/* default range,
* avoids controller's posted write area (see OHCI 1.1 clause 1.5) */
- if (start == ~0ULL && end == ~0ULL) {
+ if (start == CSR1212_INVALID_ADDR_SPACE &&
+ end == CSR1212_INVALID_ADDR_SPACE) {
start = host->middle_addr_space;
- end = CSR1212_ALL_SPACE_END;
+ end = CSR1212_ALL_SPACE_END;
}
if (((start|end) & ~align_mask) || (start >= end) || (end > 0x1000000000000ULL)) {
@@ -360,7 +361,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl,
write_unlock_irqrestore(&addr_space_lock, flags);
- if (retval == ~0ULL) {
+ if (retval == CSR1212_INVALID_ADDR_SPACE) {
kfree(as);
}