RDMA/ocrdma: Fix warnings about uninitialized variables
authorRoland Dreier <roland@purestorage.com>
Mon, 16 Apr 2012 18:32:17 +0000 (11:32 -0700)
committerRoland Dreier <roland@purestorage.com>
Tue, 8 May 2012 18:17:47 +0000 (11:17 -0700)
commitda4964387d997244b043dd812540bed851c45c9e
tree54b77bf1acbe9fb628a7ec52c0faa425a299531c
parentfe2caefcdf5869f308c102e3d64d40683bfad711
RDMA/ocrdma: Fix warnings about uninitialized variables

First, fix

    drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: In function 'ocrdma_alloc_pd':
    drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:371:17: warning: 'dpp_page_addr' may be used uninitialized in this function [-Wuninitialized]
    drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:337:6: note: 'dpp_page_addr' was declared here

which seems that it may border on a bug (the call to ocrdma_del_mmap()
might conceivably do bad things if pd->dpp_enabled is not set and
dpp_page_addr ends up with just the wrong value).

Also take care of:

    drivers/infiniband/hw/ocrdma/ocrdma_hw.c: In function 'ocrdma_init_hw':
    drivers/infiniband/hw/ocrdma/ocrdma_hw.c:2587:5: warning: 'status' may be used uninitialized in this function [-Wuninitialized]
    drivers/infiniband/hw/ocrdma/ocrdma_hw.c:2549:17: note: 'status' was declared here

which is only real if num_eq == 0, which should be impossible.

Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/ocrdma/ocrdma_hw.c
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c