Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3006395ybh; Mon, 16 Mar 2020 13:59:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu17CE8Vhc75JWIy6ELdR2XYnx8mmYVyjZJUmFC2fieAPFrFwZFart+Wd4y72Ifax8+tgG6 X-Received: by 2002:a05:6830:19ee:: with SMTP id t14mr969378ott.287.1584392359867; Mon, 16 Mar 2020 13:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584392359; cv=none; d=google.com; s=arc-20160816; b=H6/QEbqA2cQFMYefoQnJMZGsEaTspKyuLYNLpylVRytx3/h7XtVjP3EKogzJchOC0e UhIPwPYNl6CS+djE216fyTZFBTxZqcxSBO3gcf1GvSyEzlG+HjlChLp098YYwDP4lKEZ HWkkEmxUlfb5v1eh3a6fM6H3b8Q1sMcHfkBd15rSrMnIObSSESZ5sLokY8Ph/Iy3j1fj dKICQOhQpwakTw2RHGu4FXWvOLMQNqMPjTeD3OFdj/3oIz9EQEeU0UP9aj7qx5DNTtlF EklJPf9s7+dJ7rdIXlyeugEJ/AsWyxdTXzr+q6mf6/ZY6poLfcf8Qhrxzj92D11tyCX0 ibCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NZ/7vQHI7KE97BesE+3WxlmFuT1Y/pVRDjy/XH5FkC0=; b=OLlEgruCDnrj3NK1wGLcUlhVFvcp70STU4aZPxJ7FbW0ppgbK8i8HOsRScw3JocHPd G8Obf4WcbeRS+IbRG35itTR/abmjLbDnSLDoW6qre0OzXKdZDOs2NnrhIWViHUVYIRGT uKlbfuTgiO3FrciAZ4y8rYf4V0vxM2Na4+KC/q9YLERi5xB564q0nGB2uvqXvg4Z7ta6 RMwB1MiAL8N7YpJ50Jpy4eU66LYZwZIbmzwswrxrFMlaxuIK8VAUGQK+4eRq34euzRC0 9Cn6TR6AaTqZHj5Cyy0wDCg1E/rVa66N4WjyPb56k/QyhJd8FqXlbKYQr/5GwmmYncax qOkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="sp8cn/io"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si496858otl.297.2020.03.16.13.59.06; Mon, 16 Mar 2020 13:59:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="sp8cn/io"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732612AbgCPU4N (ORCPT + 99 others); Mon, 16 Mar 2020 16:56:13 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33852 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732567AbgCPU4N (ORCPT ); Mon, 16 Mar 2020 16:56:13 -0400 Received: by mail-pg1-f194.google.com with SMTP id t3so10418953pgn.1 for ; Mon, 16 Mar 2020 13:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NZ/7vQHI7KE97BesE+3WxlmFuT1Y/pVRDjy/XH5FkC0=; b=sp8cn/ioOKcQrBGgpv/MwvdbUYmqLpY3kwI0x736FzBzMjDBs+K3pg5UUG1Q1DCeI5 1zn/f5brLanFHqo0Pi0PlKHd5FTKycUoSSyfxNbIRzD0Gm8PrzXSWOP/yv1NXIywvuWV NvWUdv8eYUpXPvoGC6Q7n8PkYcU1IOx3Ty8eAJPkTabAUsLDTP0BN+QnS2rYduD9ixFa x8DTDXw1Y8QHmn3HdSK2F61wnQzHBQBCPgkC9kZDUmTWVrr3qd+cK8dXytoA6SleFib7 dNliIlDgmEDxwl4YuOOZ5bVeMwLMEEXEedpVexup+LT/AAjgdd16EmutVUrhVjABss71 cTQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NZ/7vQHI7KE97BesE+3WxlmFuT1Y/pVRDjy/XH5FkC0=; b=Jj0LhxD/9vO++w3kIh6eRX0zCNqXLU30XDf26QyDOSdR5kUbp/2YPVoAcZotRhgzBv aJ+go+stOWe8KRHHSlSM35XQSgW4exzOtQycOa4HQQLAHsUPQrhIM4I4adkxkNNirvPP CAD7AGtIPiuc62H5qfEwqviQ1a0TpvtTBIeH6TWNx/sqYiHDDyABufWKsv+Z+PANpuzl v8Re4BzwOjaXVq1HjYGyiUerL2pUibNw5H4G40JI8wuRO4SVGAFoQ0IBU7L0xtad9ZSa nONZeHbaNM3DTZgKeIofW5mu0iWt+ytZizz6+xdh1Iz4v7+igG8jKjKDQuu7gFFyaxE4 e1Fw== X-Gm-Message-State: ANhLgQ1dLLart//o1cc2L/Opd2IoljRGJDgSNQG8ICytmtyyXXVa5VR+ mcAPJ/q8nObDx2JRKV7ovpE4iJz2Kvp3ckxfxhNJkg== X-Received: by 2002:a05:6a00:42:: with SMTP id i2mr1554887pfk.108.1584392167596; Mon, 16 Mar 2020 13:56:07 -0700 (PDT) MIME-Version: 1.0 References: <20200316203452.32998-1-natechancellor@gmail.com> In-Reply-To: <20200316203452.32998-1-natechancellor@gmail.com> From: Nick Desaulniers Date: Mon, 16 Mar 2020 13:55:55 -0700 Message-ID: Subject: Re: [PATCH] mlx5: Remove uninitialized use of key in mlx5_core_create_mkey To: Nathan Chancellor Cc: Saeed Mahameed , Leon Romanovsky , Network Development , linux-rdma@vger.kernel.org, LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 16, 2020 at 1:35 PM Nathan Chancellor wrote: > > Clang warns: > > ../drivers/net/ethernet/mellanox/mlx5/core/mr.c:63:21: warning: variable > 'key' is uninitialized when used here [-Wuninitialized] > mkey_index, key, mkey->key); > ^~~ > ../drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h:54:6: note: > expanded from macro 'mlx5_core_dbg' > ##__VA_ARGS__) > ^~~~~~~~~~~ > ../include/linux/dev_printk.h:114:39: note: expanded from macro > 'dev_dbg' > dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__) > ^~~~~~~~~~~ > ../include/linux/dynamic_debug.h:158:19: note: expanded from macro > 'dynamic_dev_dbg' > dev, fmt, ##__VA_ARGS__) > ^~~~~~~~~~~ > ../include/linux/dynamic_debug.h:143:56: note: expanded from macro > '_dynamic_func_call' > __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__) > ^~~~~~~~~~~ > ../include/linux/dynamic_debug.h:125:15: note: expanded from macro > '__dynamic_func_call' > func(&id, ##__VA_ARGS__); \ > ^~~~~~~~~~~ > ../drivers/net/ethernet/mellanox/mlx5/core/mr.c:47:8: note: initialize > the variable 'key' to silence this warning > u8 key; > ^ > = '\0' > 1 warning generated. > > key's initialization was removed in commit fc6a9f86f08a ("{IB,net}/mlx5: > Assign mkey variant in mlx5_ib only") but its use was not fully removed. > Remove it now so that there is no more warning. > > Fixes: fc6a9f86f08a ("{IB,net}/mlx5: Assign mkey variant in mlx5_ib only") > Link: https://github.com/ClangBuiltLinux/linux/issues/932 > Signed-off-by: Nathan Chancellor Thanks for the patch and analysis, looks good to me! Reviewed-by: Nick Desaulniers > --- > drivers/net/ethernet/mellanox/mlx5/core/mr.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/mr.c b/drivers/net/ethernet/mellanox/mlx5/core/mr.c > index fd3e6d217c3b..366f2cbfc6db 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/mr.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/mr.c > @@ -44,7 +44,6 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, > u32 mkey_index; > void *mkc; > int err; > - u8 key; > > MLX5_SET(create_mkey_in, in, opcode, MLX5_CMD_OP_CREATE_MKEY); > > @@ -59,8 +58,7 @@ int mlx5_core_create_mkey(struct mlx5_core_dev *dev, > mkey->key |= mlx5_idx_to_mkey(mkey_index); > mkey->pd = MLX5_GET(mkc, mkc, pd); > > - mlx5_core_dbg(dev, "out 0x%x, key 0x%x, mkey 0x%x\n", > - mkey_index, key, mkey->key); > + mlx5_core_dbg(dev, "out 0x%x, mkey 0x%x\n", mkey_index, mkey->key); > return 0; > } > EXPORT_SYMBOL(mlx5_core_create_mkey); > -- > 2.26.0.rc1 > > -- -- Thanks, ~Nick Desaulniers