That is going to be unreachable code. The outstanding lock can only take
on the value lock_nocheck, lock_exclusive, lock_shared, or
lock_none. All of which are checked. The correct fix would be to change
it to an switch so a warning will be printed if any other valid lock
values are added.

-Nathan

On Mon, Apr 13, 2015 at 11:32:00AM -0400, git...@crest.iu.edu wrote:
> This is an automated email from the git hooks/post-receive script. It was
> generated because a ref change was pushed to the repository containing
> the project "open-mpi/ompi".
> 
> The branch, master has been updated
>        via  40b7643119f2fbb9c08e9987e93d543e247cede4 (commit)
>       from  9c6d452d6b95a2aebffb23a7a7c8a985b60edd36 (commit)
> 
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
> 
> - Log -----------------------------------------------------------------
> https://github.com/open-mpi/ompi/commit/40b7643119f2fbb9c08e9987e93d543e247cede4
> 
> commit 40b7643119f2fbb9c08e9987e93d543e247cede4
> Author: Jeff Squyres <jsquy...@cisco.com>
> Date:   Mon Apr 13 11:31:43 2015 -0400
> 
>     osc_sm_passive_target.c: ensure ret is always defined
>     
>     Fixes a compiler warning
> 
> diff --git a/ompi/mca/osc/sm/osc_sm_passive_target.c 
> b/ompi/mca/osc/sm/osc_sm_passive_target.c
> index c54be0b..b2398ed 100644
> --- a/ompi/mca/osc/sm/osc_sm_passive_target.c
> +++ b/ompi/mca/osc/sm/osc_sm_passive_target.c
> @@ -3,6 +3,7 @@
>   * Copyright (c) 2011      Sandia National Laboratories.  All rights 
> reserved.
>   * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights
>   *                         reserved.
> + * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
>   * $COPYRIGHT$
>   * 
>   * Additional copyrights may follow
> @@ -160,6 +161,8 @@ ompi_osc_sm_unlock(int target,
>          ret = end_exclusive(module, target);
>      } else if (module->outstanding_locks[target] == lock_shared) {
>          ret = end_shared(module, target);
> +    } else {
> +        ret = OMPI_SUCCESS;
>      }
>  
>      module->outstanding_locks[target] = lock_none;
> 
> 
> -----------------------------------------------------------------------
> 
> Summary of changes:
>  ompi/mca/osc/sm/osc_sm_passive_target.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 
> hooks/post-receive
> -- 
> open-mpi/ompi
> _______________________________________________
> ompi-commits mailing list
> ompi-comm...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/ompi-commits

Attachment: pgpbnxtXVVSzJ.pgp
Description: PGP signature

Reply via email to