Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1462522rdb; Wed, 16 Aug 2023 12:06:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzBu79LAo3FyreWDk4rU1rSHqnGBG1ZO5gxxDfoMaJ6L0z70hdoPEEECn0o775zzvheQG5 X-Received: by 2002:a2e:9c86:0:b0:2b4:6f0c:4760 with SMTP id x6-20020a2e9c86000000b002b46f0c4760mr2063011lji.11.1692212793320; Wed, 16 Aug 2023 12:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692212793; cv=none; d=google.com; s=arc-20160816; b=aLJhNGp+mcIVGDP/Q/DFUXhLYBEMEwBupHIbhZaC9cJBoRg3ohRNIdg95HqEXtu5dX X850tkltkyC1Omp/qRNyvGuiAvRmrAwiiMBxXSUREHSw2owznuoc1g1XDUzA31kNfGYQ jQEqdUdgEvj4j+kA6PbvZ8B9hzuhGuUtqHgcrCcaOv5OEUmQAYi2A/WXVLYwsWJKgTI5 fzsRla1nPq9t/fLckM4nomtxPJpLMCIwUrE/1tnlr3l2GTyy+icI6Bor/cRCcBKN2+js R1MXImfhpmU1YvJB0lZ+AOyQWVmeOpC0yOSxqoHthEMrg4M9/5ABtLDRgW2imOQ/nYDv Jt6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=oWNNPmmmwGipLm8PGbJBp3DzVe3nn5DN+j1htkfdxJY=; fh=ARO/j8d+VwZgCgzzXO+mhZVoMcWw7iIsPCNeq+90p6I=; b=yNTYUcKtRHdciX+rF97itdrO3/8ktuQGDiuo6l5kp57lZpSu3MHxylwDrp99usRV// ANpsxPDddM77kbIDUk6DhM6d6e9XezHL5h0wV6jMcmSNYIG8DFCkvkpT4/enXUHjsLAG XtxoygeF7HWcQVywjy4XVJ1cg22gMrnY3LauKL99Ygq1XN//WS5B51LFYWS16/Y2lStR or1whUVQYje271xPLL+woxtN5acUBMbJdCVoEt6Be/tsvRsLeqHT7XEqn7V2zPpWQNqX qREtxrxAAPoZgMDvUCzU0Y6Q0Q3JVhB9zfkAKWrG4TJBxEDsXedicU0s9ztpnIU9wAMW E6zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SZ7Cytm4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y10-20020a170906524a00b00992acaba375si11348870ejm.842.2023.08.16.12.05.58; Wed, 16 Aug 2023 12:06:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SZ7Cytm4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242142AbjHPGdD (ORCPT + 99 others); Wed, 16 Aug 2023 02:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242122AbjHPGcg (ORCPT ); Wed, 16 Aug 2023 02:32:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B68591FE6; Tue, 15 Aug 2023 23:32:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5412B63909; Wed, 16 Aug 2023 06:32:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E39C0C433C7; Wed, 16 Aug 2023 06:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692167554; bh=4C7hmNUEzoSY6ll+R3hCEyiSVy1EjMg5kCs8oKOrzRs=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=SZ7Cytm4OaQDzwGY4WhJvJyy+clKCtC4BKWX53ctAECQhhnhpdc7A/gcSpGTi2qYZ zQYoqJ0FNkihN+69B8d147mBrZr7X7cxyb4kZwP/xT3coJLHHbNlZUAdMUA1LAGFdx vyIPJ7+YtycT+UnrVA0WTtGhA6+h3L+H+HQfZFyFc/mPTii1yxwLQZ/Q1mmYLBMvlH Dx5J8Q+BhgcNPv1daYMqTO5QafAghBlpPJdqWBUtwcBpXZR8L0OH4+VFiWX4DuZhku TuQ+h06q0EPkusnH9H0CYSLuupctV3ox1g/ZB1oXrfPHPkh3J8WERgBZ9zKO16exS0 OK974DtLC9sMg== From: Leon Romanovsky To: Yishai Hadas , Jason Gunthorpe , "Gustavo A. R. Silva" Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org In-Reply-To: References: Subject: Re: [PATCH][next] RDMA/mlx4: Copy union directly Message-Id: <169216755001.1947971.13071516719161593963.b4-ty@kernel.org> Date: Wed, 16 Aug 2023 09:32:30 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12-dev-a055d X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 15 Aug 2023 14:39:53 -0600, Gustavo A. R. Silva wrote: > Copy union directly instead of using memcpy(). > > Note that in this case, a direct assignment is more readable and > consistent with the subsequent assignments. > > This addresses the following -Wstringop-overflow warning seen in s390 > with defconfig: > drivers/infiniband/hw/mlx4/main.c:296:33: warning: writing 16 bytes into a region of size 0 [-Wstringop-overflow=] > 296 | memcpy(&port_gid_table->gids[free].gid, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > 297 | &attr->gid, sizeof(attr->gid)); > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > [...] Applied, thanks! [1/1] RDMA/mlx4: Copy union directly https://git.kernel.org/rdma/rdma/c/18ddaeb03bdb65 Best regards, -- Leon Romanovsky