diff options
| author | Matt Jacob <mjacob@FreeBSD.org> | 2007-04-02 01:04:20 +0000 |
|---|---|---|
| committer | Matt Jacob <mjacob@FreeBSD.org> | 2007-04-02 01:04:20 +0000 |
| commit | 9a1b0d43c2f8d1deb2221cb48d3c0227875cc5fa (patch) | |
| tree | 301dc2dba02ff47c95da310a9856c01c9754f539 /sys/dev/isp/isp_library.c | |
| parent | 7045ea1ddea177b576a7a552c8ae4182e3f59376 (diff) | |
Notes
Diffstat (limited to 'sys/dev/isp/isp_library.c')
| -rw-r--r-- | sys/dev/isp/isp_library.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/isp/isp_library.c b/sys/dev/isp/isp_library.c index 98ec5d5f8021..2f628bf0287d 100644 --- a/sys/dev/isp/isp_library.c +++ b/sys/dev/isp/isp_library.c @@ -1499,12 +1499,12 @@ isp_save_xs_tgt(ispsoftc_t *isp, void *xs, uint32_t *handlep) void * isp_find_xs_tgt(ispsoftc_t *isp, uint32_t handle) { - if (handle == 0 || (handle & 0x8000) == 0 || - (handle & 0x7fff) > isp->isp_maxcmds) { + if (handle == 0 || IS_TARGET_HANDLE(handle) == 0 || + (handle & ISP_HANDLE_MASK) > isp->isp_maxcmds) { isp_prt(isp, ISP_LOGERR, "bad handle in isp_find_xs_tgt"); return (NULL); } else { - return (isp->isp_tgtlist[(handle & 0x7fff) - 1]); + return (isp->isp_tgtlist[(handle & ISP_HANDLE_MASK) - 1]); } } @@ -1515,7 +1515,7 @@ isp_find_tgt_handle(ispsoftc_t *isp, void *xs) if (xs != NULL) { for (i = 0; i < isp->isp_maxcmds; i++) { if (isp->isp_tgtlist[i] == xs) { - return ((i+1) & 0x7fff); + return ((i+1) & ISP_HANDLE_MASK); } } } @@ -1525,12 +1525,12 @@ isp_find_tgt_handle(ispsoftc_t *isp, void *xs) void isp_destroy_tgt_handle(ispsoftc_t *isp, uint32_t handle) { - if (handle == 0 || (handle & 0x8000) == 0 || - (handle & 0x7fff) > isp->isp_maxcmds) { + if (handle == 0 || IS_TARGET_HANDLE(handle) == 0 || + (handle & ISP_HANDLE_MASK) > isp->isp_maxcmds) { isp_prt(isp, ISP_LOGERR, "bad handle in isp_destroy_tgt_handle"); } else { - isp->isp_tgtlist[(handle & 0x7fff) - 1] = NULL; + isp->isp_tgtlist[(handle & ISP_HANDLE_MASK) - 1] = NULL; } } |
