From patchwork Fri Feb 2 15:46:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126740 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp757310ljc; Fri, 2 Feb 2018 07:46:52 -0800 (PST) X-Google-Smtp-Source: AH8x224JQNmuxYmdVIh1O50Lco86sc8eYMgl3I8O25/swe4oG2wPvJYjLzK7jBbTDLKydKo6Y0UI X-Received: by 10.99.100.7 with SMTP id y7mr4509360pgb.359.1517586412754; Fri, 02 Feb 2018 07:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517586412; cv=none; d=google.com; s=arc-20160816; b=k4YQJt/Pjg0y00GGEPN+c+jJCotA6kx9VuMWOH85XVd+bFMyqi2oCZfLejLTew+nZv x/CtaEtkdYK8x310eUI3dMRayAYE+rjhUNBoUphA/LZjKkFQkMmNdl3XVJrYFLs2lmKI FGaay27OlltpdLT5yZmS27io+JI/34W90oWJIPe1kNQDR3F9Z4mwluq8yoDz2EkCkWLt SOBO8KAMalsN/hsTN3+UCxSu1CxddsPKBJkwH7JGbLrAFXOchh3tzZRto99j5HAoFEWs fPwHbcgvd5eYmPEdgvCxmcyLERb+4ysq4a3SyaasPmQPs3dr/cGm3/9HozQhfsL1pOqb LW1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QK30Lh1OoctOBeLh/9dm+3YSzWsuy7WS7Ool+K/M/cQ=; b=OlVYo1t6ecckJglRb5Owqrvgg1TGcuMufVbixzupRYJjQYlpXFHS8pvrnrWMuuDK5X 6XWNU7P1fcTomaXvLWnt+9FLdzeffgdxes9GRTfV6GmcMuQbDIUErZQBZ18U1xa0v9w6 0MPDgPqB1ePKjj3/H+3uJef6HHmDFNOZAYXhGgsGYx0DC8uKVu+Ftk5sQhxLh/FtLlXh 6vG8zPbNH0B//wrbZNKRsRF5DvyYqJoXH9wqtlIDXvsZvU6NAneo7T6qHO/zplJCFNEd zk2Wrp6WLR4ERGnSKgzcSBKSnZ8PI/BdjLOj+FvZA8PhgyJkW66GM0JWXf52PcOxDzu1 RHEw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si1594746pgm.407.2018.02.02.07.46.52; Fri, 02 Feb 2018 07:46:52 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207AbeBBPqt (ORCPT + 28 others); Fri, 2 Feb 2018 10:46:49 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:55139 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751567AbeBBPqk (ORCPT ); Fri, 2 Feb 2018 10:46:40 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0Ll5ba-1fG8kd12Qw-00b5x6; Fri, 02 Feb 2018 16:46:37 +0100 From: Arnd Bergmann To: Saeed Mahameed , Matan Barak , Leon Romanovsky Cc: Arnd Bergmann , Or Gerlitz , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: mlx5: remove pointless memcpy Date: Fri, 2 Feb 2018 16:46:30 +0100 Message-Id: <20180202154636.1624079-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:vW8LgAxomaJzXCYabU0L00RV+JG+Wiz6uUq7kBUNQUS713ZsveX tSla9lLLJKhwCIgkY48KDtUM8GCtaop4uH0R2W2WFpX+nJqpbhnCQjW8KHhC5KhTgLk+vYU 0yz6gfOVAOvezWVFyZ4n4JvWk+KeJVOy2lpc+lxD/bKX3+C019zL82hA41ssL5qQ7BETGRf 9c5tdEDbPFCuFxng5FBDg== X-UI-Out-Filterresults: notjunk:1; V01:K0:hqjj+lDM4gI=:xnCTCd4UY4V7m6kfddhp9h HJyTPAziy5WIHhP7DqSsvcBA6M9V1hHrYjBjIy/AsYSwtm68rDuBNgHChjctidC4CQzJCdF2e 1EaNdB1wD3BHEeJGvxWMTSrSyKz4MsWHaXuC64nMHofcfisbnjodL+M/xOlD+wh0hyrAL193z 1W6cLehRw9wr1uG0P+M8eXy/6vEyqEkQj64dCYIydkPagamuhndYheMNxhhzgcfWWjlfEN+r1 9Jkcg+Gar6vn+94fNKIgfwOgcj8h8X5yVabzdi0IfLfNVkp4LNwjLWLmccGH7rA7picIeSF4G EvPC86VbBZglNRCxW1kSE6y5qyeDGwoildtuAlWhM5a58TqbR8PeTMNebrBZH37WZ8LcDVLrj +zRpQAxj/qmcU88E3cf0uImnx7hyu+u9yAefz4xGewMlsmc21EvPOzOM7DN4D6raO2J2QYCVT OElv2xB96XtLXes6qCvcr9PxKgsw5qbGQ27XnTsXegZviCtL0NaKn/SkZrFmEWk+kpX8G5+iP ytA6d/4fxRJY621RFkuAWZgoQhaPPaHUZCDSwti+B84DiqP7+BGMCQ/VfoaWsMXfkvrn/Voeo /xcMq7DVqvmfsD1djMfBLatGlS0xIqY/MHl7Gf0PBlRHsNwgwY50X93E4SaiLTRlVQPcIzLme gRaPA8GjxuDLhuRnDse9m6T6wmzIGBAoSAYPQn47P3eK8dHgaIIatH02UH54GSat8rM6wdcf6 dGwXa0vf/9a4krXQZ3bbPR5syRaRp11TLybJpw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-8 notices that the memcpy in mlx5_core_query_xsrq() makes no sense because the source and destination variables are identical: drivers/net/ethernet/mellanox/mlx5/core/transobj.c: In function 'mlx5_core_query_xsrq': drivers/net/ethernet/mellanox/mlx5/core/transobj.c:347:3: error: 'memcpy' source argument is the same as destination [-Werror=restrict] Either one of the pointers should be something else, or the code is completely bogus. Removing the memcpy() won't change the behavior but gets rid of the warning. Fixes: 01949d0109ee ("net/mlx5_core: Enable XRCs and SRQs when using ISSI > 0") Signed-off-by: Arnd Bergmann --- Please review carefully, I have no idea what the author actually intended here. --- drivers/net/ethernet/mellanox/mlx5/core/transobj.c | 8 -------- 1 file changed, 8 deletions(-) -- 2.9.0 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c index 9e38343a951f..75450f7d53bf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/transobj.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/transobj.c @@ -332,20 +332,12 @@ int mlx5_core_destroy_xsrq(struct mlx5_core_dev *dev, u32 xsrqn) int mlx5_core_query_xsrq(struct mlx5_core_dev *dev, u32 xsrqn, u32 *out) { u32 in[MLX5_ST_SZ_DW(query_xrc_srq_in)] = {0}; - void *srqc; - void *xrc_srqc; int err; MLX5_SET(query_xrc_srq_in, in, opcode, MLX5_CMD_OP_QUERY_XRC_SRQ); MLX5_SET(query_xrc_srq_in, in, xrc_srqn, xsrqn); err = mlx5_cmd_exec(dev, in, sizeof(in), out, MLX5_ST_SZ_BYTES(query_xrc_srq_out)); - if (!err) { - xrc_srqc = MLX5_ADDR_OF(query_xrc_srq_out, out, - xrc_srq_context_entry); - srqc = MLX5_ADDR_OF(query_srq_out, out, srq_context_entry); - memcpy(srqc, xrc_srqc, MLX5_ST_SZ_BYTES(srqc)); - } return err; }