Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1af4c435f3ab9cdf72ce86c35a455c8bef1d6536
Commit:     1af4c435f3ab9cdf72ce86c35a455c8bef1d6536
Parent:     5eb620c81ce35aa0c533131bf4d06c4c8c2bfadf
Author:     Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Sat May 19 08:51:54 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Sat May 19 08:51:54 2007 -0700

    IB/core: Use start_port() and end_port()
    
    Clean up ib_query_port() and ib_modify_port() slightly by using the
    just-added start_port() and end_port() helpers.
    
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/core/device.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index b448e0b..b583196 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -569,10 +569,7 @@ int ib_query_port(struct ib_device *device,
                  u8 port_num,
                  struct ib_port_attr *port_attr)
 {
-       if (device->node_type == RDMA_NODE_IB_SWITCH) {
-               if (port_num)
-                       return -EINVAL;
-       } else if (port_num < 1 || port_num > device->phys_port_cnt)
+       if (port_num < start_port(device) || port_num > end_port(device))
                return -EINVAL;
 
        return device->query_port(device, port_num, port_attr);
@@ -644,10 +641,7 @@ int ib_modify_port(struct ib_device *device,
                   u8 port_num, int port_modify_mask,
                   struct ib_port_modify *port_modify)
 {
-       if (device->node_type == RDMA_NODE_IB_SWITCH) {
-               if (port_num)
-                       return -EINVAL;
-       } else if (port_num < 1 || port_num > device->phys_port_cnt)
+       if (port_num < start_port(device) || port_num > end_port(device))
                return -EINVAL;
 
        return device->modify_port(device, port_num, port_modify_mask,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to