diff options
author | Naresh Gottumukkala <bgottumukkala@emulex.com> | 2013-08-07 03:22:32 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-08-12 13:58:37 -0400 |
commit | f99b1649dbb6342d618307faef1f214fd54928b9 (patch) | |
tree | 29eeeb358a40d6d5021c90cc845e5e329043b832 /drivers/infiniband/hw/ocrdma/ocrdma_ah.c | |
parent | c095ba7224d8edc71dcef0d655911399a8bd4a3f (diff) |
RDMA/ocrdma: Style and redundant code cleanup
Code cleanup and remove redundant code:
1) redundant initialization removed
2) braces changed as per CodingStyle.
3) redundant checks removed
4) extra braces in return statements removed.
5) removed unused pd pointer from mr.
6) reorganized get_dma_mr()
7) fixed set_av() to return error on invalid sgid index.
8) reference to ocrdma_dev removed from struct ocrdma_pd.
Signed-off-by: Naresh Gottumukkala <bgottumukkala@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/ocrdma/ocrdma_ah.c')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_ah.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c index f4c587c68f64..a6bb3d074d2d 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c | |||
@@ -92,7 +92,7 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr) | |||
92 | int status; | 92 | int status; |
93 | struct ocrdma_ah *ah; | 93 | struct ocrdma_ah *ah; |
94 | struct ocrdma_pd *pd = get_ocrdma_pd(ibpd); | 94 | struct ocrdma_pd *pd = get_ocrdma_pd(ibpd); |
95 | struct ocrdma_dev *dev = pd->dev; | 95 | struct ocrdma_dev *dev = get_ocrdma_dev(ibpd->device); |
96 | 96 | ||
97 | if (!(attr->ah_flags & IB_AH_GRH)) | 97 | if (!(attr->ah_flags & IB_AH_GRH)) |
98 | return ERR_PTR(-EINVAL); | 98 | return ERR_PTR(-EINVAL); |
@@ -100,7 +100,7 @@ struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr) | |||
100 | ah = kzalloc(sizeof *ah, GFP_ATOMIC); | 100 | ah = kzalloc(sizeof *ah, GFP_ATOMIC); |
101 | if (!ah) | 101 | if (!ah) |
102 | return ERR_PTR(-ENOMEM); | 102 | return ERR_PTR(-ENOMEM); |
103 | ah->dev = pd->dev; | 103 | ah->dev = dev; |
104 | 104 | ||
105 | status = ocrdma_alloc_av(dev, ah); | 105 | status = ocrdma_alloc_av(dev, ah); |
106 | if (status) | 106 | if (status) |