lkml.org 
[lkml]   [2016]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 102/217] mlx4: add missing braces in verify_qp_parameters
    3.16.35-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Arnd Bergmann <arnd@arndb.de>

    commit baefd7015cdb304ce6c94f9679d0486c71954766 upstream.

    The implementation of QP paravirtualization back in linux-3.7 included
    some code that looks very dubious, and gcc-6 has grown smart enough
    to warn about it:

    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'verify_qp_parameters':
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3154:5: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
    if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) {
    ^~
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3144:4: note: ...this 'if' clause, but it is not
    if (slave != mlx4_master_func_num(dev))

    >From looking at the context, I'm reasonably sure that the indentation
    is correct but that it should have contained curly braces from the
    start, as the update_gid() function in the same patch correctly does.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Fixes: 54679e148287 ("mlx4: Implement QP paravirtualization and maintain phys_pkey_cache for smp_snoop")
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
    +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
    @@ -2886,7 +2886,7 @@ static int verify_qp_parameters(struct m
    case QP_TRANS_RTS2RTS:
    case QP_TRANS_SQD2SQD:
    case QP_TRANS_SQD2RTS:
    - if (slave != mlx4_master_func_num(dev))
    + if (slave != mlx4_master_func_num(dev)) {
    if (optpar & MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH) {
    port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1;
    if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB)
    @@ -2905,6 +2905,7 @@ static int verify_qp_parameters(struct m
    if (qp_ctx->alt_path.mgid_index >= num_gids)
    return -EINVAL;
    }
    + }
    break;
    default:
    break;
    \
     
     \ /
      Last update: 2016-04-27 02:01    [W:4.055 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site