Message ID | Y3soBt1jmXHUKhW9@mail.google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1434021wrr; Sun, 20 Nov 2022 23:27:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf4cjs6O+pIUeaEHAKH8idS169rLTZOixJ8hTTgj1p3QIUABVCYaZ8Wogaw9l2+ANJQJ+Dhr X-Received: by 2002:a17:906:444b:b0:7ad:dd43:5d53 with SMTP id i11-20020a170906444b00b007addd435d53mr13514484ejp.376.1669015678529; Sun, 20 Nov 2022 23:27:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669015678; cv=none; d=google.com; s=arc-20160816; b=CzjrmXbK9JRsBCIwqgFG43djDa3AAmtqN0WgPzUyL7cNs2qZshSpLQhWIVLWeVZX9V S4b/G9K2suLXXhDvGZVxbkkmjxFjjsbWb/7LNJH+fWWl4W6n3qVEW6biG6CzLsS9+EGH lhE7RjwtMchIb6/M516zLWANDiutyocWPFK0JMDoaAnXrDv/31YPXe0MJNMgXQeenhle +8jOLCs5jnQD7omhFwu3ue4oWN/wnAJHOkP3S+qlBArXOZL3dm0CiGNq4vMd0We+bzPn 2IiLL/014d+mSkYX0+Px6BKg+A7K+/UZZXac7n2fsgj/eyLszEF24ROhM7/mhQLUr8OT mTzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=C1MiOaGlNC43gZkqyEAf4nEibj9lSNJWEeV4vVtbOJE=; b=GVnOkoh96pTCuOQUzGaBtiMF3uAt3gGmV6niREMcckJTNIvG2vFRdbqfiQZvLZyzWZ bieB0dUujaX45HiD/GZtRsW4zufjkaK7eAxX8HyiWhZ8gmbqydB9Xbe3q/exnpi+ExwF eGlDSDt2+uLntebk/aRy6gMdpi8kBNTkqMGhdF1lbixPVMTgywFOcgoBrUO9ouOsPfJu we2pACF80+G84jEvRw3g6y44cQifdX2TaGIFQeA0RRy5drxjvNEFo91d97VQlOVBMp36 BYgi7KmjFGx4Od1AEtSpMnVrjbPUB/HOMctcstbqVg9OZZ2nSoDnFrIeSmfbgOPguyf5 YMHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=JGYzC6xq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp22-20020a1709071b1600b007801a197a1bsi6368361ejc.449.2022.11.20.23.27.32; Sun, 20 Nov 2022 23:27:58 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=JGYzC6xq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbiKUH0K (ORCPT <rfc822;peter110.wang@gmail.com> + 99 others); Mon, 21 Nov 2022 02:26:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbiKUH0J (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 21 Nov 2022 02:26:09 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D5F2A419; Sun, 20 Nov 2022 23:26:08 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id 136so10412545pga.1; Sun, 20 Nov 2022 23:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=C1MiOaGlNC43gZkqyEAf4nEibj9lSNJWEeV4vVtbOJE=; b=JGYzC6xqmct/PfIsIWjPN63rryv70dobhe3MPkw8h85uVfj85DjOITM2umZT/uEIkW fQzlMlsoFaL/uDPE4PT3MotMLZ16xLqfQI5uR/mmqez22GVROEiHybxzj5ET/9EwdImy w6dDvpnxM4xgSpoJltBFyuKs6JANcGcU9ycLlLc1Dv6IFuQh/yYY23EIFMymed2xZ7Y0 7Jcwri8zMp3DyzoqYyU1XNAU39kV0w4zwcexZiV8iY98BSigxr9R/U+PBr+7hyxH9gCa KJIS/B2pBx2tY25R8qhNj6MYXUQLJT2ollMY1N+w0dAvPs2UydLM49HJFFwa5pAfhJKu Vg0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=C1MiOaGlNC43gZkqyEAf4nEibj9lSNJWEeV4vVtbOJE=; b=WLr9P4Kx6ea0nGOdyytLTTLkXiLP/h1Eflko9cPodnpKSMy4jaT3lTkiN28m/Ij3/s W+z64A3BVQtF8O+qX38x/wQbe6jH5PMDupqn/ahbi9z+ueGoG1ROLU0YKuAuBlVnn/dc D26qm9ZpDYMlaCSVwXScAeJjKWa2gkFQ1IlViNVIaU/qzjQfc8vRaz1I0He38ftv7iWz NiEZeDKxAGe/ZeIIa0Mwg+ox9GekKti6pvuO3DL5Lc3dR9SDlkcvXRMI9BNrpCgISqIh X5Vf90Ln91+axLLhg7nBnHJytMFFqqDSLVDVtuMq/DFtVmiJLbDfPWU+tOp7sQCo3wN/ rScA== X-Gm-Message-State: ANoB5pn4uI/DKhOgF0q4aHf8WuUCpVpJQaD8I+AKwrdLNeeWYq7yNfu6 hcTUYtt4jDr4zii5+qW8nP3DPI9Qh8uDdaqq X-Received: by 2002:a62:f24e:0:b0:572:149c:e278 with SMTP id y14-20020a62f24e000000b00572149ce278mr19200844pfl.8.1669015567395; Sun, 20 Nov 2022 23:26:07 -0800 (PST) Received: from mail.google.com (125-237-50-34-fibre.sparkbb.co.nz. [125.237.50.34]) by smtp.gmail.com with ESMTPSA id z18-20020a170902ccd200b0017a032d7ae4sm8933920ple.104.2022.11.20.23.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Nov 2022 23:26:07 -0800 (PST) Date: Mon, 21 Nov 2022 20:25:58 +1300 From: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> To: Alex Deucher <alexander.deucher@amd.com>, Christian =?utf-8?b?S8O2bmln?= <christian.koenig@amd.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>, Rongguang Wei <weirongguang@kylinos.cn>, Slark Xiao <slark_xiao@163.com>, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, paulo.miguel.almeida.rodenas@gmail.com Subject: [PATCH] [next] drm/amdgpu: Replace remaining 1-element array with flex-array Message-ID: <Y3soBt1jmXHUKhW9@mail.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750089784566435059?= X-GMAIL-MSGID: =?utf-8?q?1750089784566435059?= |
Series |
[next] drm/amdgpu: Replace remaining 1-element array with flex-array
|
|
Commit Message
Paulo Miguel Almeida
Nov. 21, 2022, 7:25 a.m. UTC
One-element arrays are deprecated, and we are replacing them with
flexible array members instead. So, replace one-element array with
flexible-array member in struct GOP_VBIOS_CONTENT and refactor the
rest of the code accordingly.
Important to mention is that doing a build before/after this patch
results in no functional binary output differences.
This helps with the ongoing efforts to tighten the FORTIFY_SOURCE
routines on memcpy() and help us make progress towards globally
enabling -fstrict-flex-arrays=3 [1].
Link: https://github.com/KSPP/linux/issues/79
Link: https://github.com/KSPP/linux/issues/238
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 [1]
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
---
This should be the last one-element array that had references in source
code. Given the way it was used, no *.c code change was required.
I will move on to the atombios.h in the radeon driver.
---
drivers/gpu/drm/amd/include/atombios.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Applied. Thanks! Alex On Mon, Nov 21, 2022 at 2:26 AM Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> wrote: > > One-element arrays are deprecated, and we are replacing them with > flexible array members instead. So, replace one-element array with > flexible-array member in struct GOP_VBIOS_CONTENT and refactor the > rest of the code accordingly. > > Important to mention is that doing a build before/after this patch > results in no functional binary output differences. > > This helps with the ongoing efforts to tighten the FORTIFY_SOURCE > routines on memcpy() and help us make progress towards globally > enabling -fstrict-flex-arrays=3 [1]. > > Link: https://github.com/KSPP/linux/issues/79 > Link: https://github.com/KSPP/linux/issues/238 > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836 [1] > > Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> > --- > This should be the last one-element array that had references in source > code. Given the way it was used, no *.c code change was required. > > I will move on to the atombios.h in the radeon driver. > --- > drivers/gpu/drm/amd/include/atombios.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/include/atombios.h b/drivers/gpu/drm/amd/include/atombios.h > index 4dc738c51771..b78360a71bc9 100644 > --- a/drivers/gpu/drm/amd/include/atombios.h > +++ b/drivers/gpu/drm/amd/include/atombios.h > @@ -9292,7 +9292,7 @@ typedef struct { > > typedef struct { > VFCT_IMAGE_HEADER VbiosHeader; > - UCHAR VbiosContent[1]; > + UCHAR VbiosContent[]; > }GOP_VBIOS_CONTENT; > > typedef struct { > -- > 2.37.3 >
diff --git a/drivers/gpu/drm/amd/include/atombios.h b/drivers/gpu/drm/amd/include/atombios.h index 4dc738c51771..b78360a71bc9 100644 --- a/drivers/gpu/drm/amd/include/atombios.h +++ b/drivers/gpu/drm/amd/include/atombios.h @@ -9292,7 +9292,7 @@ typedef struct { typedef struct { VFCT_IMAGE_HEADER VbiosHeader; - UCHAR VbiosContent[1]; + UCHAR VbiosContent[]; }GOP_VBIOS_CONTENT; typedef struct {