diff options
author | Ben Collins <bcollins@ubuntu.com> | 2006-06-12 18:15:31 -0400 |
---|---|---|
committer | Ben Collins <bcollins@ubuntu.com> | 2006-06-12 18:15:31 -0400 |
commit | 6737231ead125c7cee7ce4d3a74179bdac085529 (patch) | |
tree | f0c996c8c48d07398c47ada5a2dacdcbf0800770 /drivers/ieee1394/highlevel.c | |
parent | e269d276792684a13ab0d9acd8c024ec7d6c5f4d (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.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ieee1394/highlevel.c b/drivers/ieee1394/highlevel.c index 29c5255b933c..165dcd669560 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, | |||
301 | { | 301 | { |
302 | struct hpsb_address_serve *as, *a1, *a2; | 302 | struct hpsb_address_serve *as, *a1, *a2; |
303 | struct list_head *entry; | 303 | struct list_head *entry; |
304 | u64 retval = ~0ULL; | 304 | u64 retval = CSR1212_INVALID_ADDR_SPACE; |
305 | unsigned long flags; | 305 | unsigned long flags; |
306 | u64 align_mask = ~(alignment - 1); | 306 | u64 align_mask = ~(alignment - 1); |
307 | 307 | ||
@@ -314,9 +314,10 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, | |||
314 | 314 | ||
315 | /* default range, | 315 | /* default range, |
316 | * avoids controller's posted write area (see OHCI 1.1 clause 1.5) */ | 316 | * avoids controller's posted write area (see OHCI 1.1 clause 1.5) */ |
317 | if (start == ~0ULL && end == ~0ULL) { | 317 | if (start == CSR1212_INVALID_ADDR_SPACE && |
318 | end == CSR1212_INVALID_ADDR_SPACE) { | ||
318 | start = host->middle_addr_space; | 319 | start = host->middle_addr_space; |
319 | end = CSR1212_ALL_SPACE_END; | 320 | end = CSR1212_ALL_SPACE_END; |
320 | } | 321 | } |
321 | 322 | ||
322 | if (((start|end) & ~align_mask) || (start >= end) || (end > 0x1000000000000ULL)) { | 323 | if (((start|end) & ~align_mask) || (start >= end) || (end > 0x1000000000000ULL)) { |
@@ -360,7 +361,7 @@ u64 hpsb_allocate_and_register_addrspace(struct hpsb_highlevel *hl, | |||
360 | 361 | ||
361 | write_unlock_irqrestore(&addr_space_lock, flags); | 362 | write_unlock_irqrestore(&addr_space_lock, flags); |
362 | 363 | ||
363 | if (retval == ~0ULL) { | 364 | if (retval == CSR1212_INVALID_ADDR_SPACE) { |
364 | kfree(as); | 365 | kfree(as); |
365 | } | 366 | } |
366 | 367 | ||