linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling@amd.com>
To: cgel.zte@gmail.com
Cc: airlied@linux.ie, Zeal Robot <zealci@zte.com.cn>,
	Xinhui.Pan@amd.com, linux-kernel@vger.kernel.org,
	amd-gfx@lists.freedesktop.org,
	Changcheng Deng <deng.changcheng@zte.com.cn>,
	dri-devel@lists.freedesktop.org, alexander.deucher@amd.com,
	christian.koenig@amd.com
Subject: Re: [PATCH] drm/amdkfd: Replace zero-length array with flexible-array member
Date: Tue, 15 Feb 2022 19:01:16 -0500	[thread overview]
Message-ID: <35be6c0b-e6a8-d0f1-1870-6a77a18556c7@amd.com> (raw)
In-Reply-To: <20220215091142.1775600-1-deng.changcheng@zte.com.cn>


On 2022-02-15 04:11, cgel.zte@gmail.com wrote:
> From: Changcheng Deng <deng.changcheng@zte.com.cn>
>
> There is a regular need in the kernel to provide a way to declare having
> a dynamically sized set of trailing elements in a structure. Kernel code
> should always use "flexible array members" for these cases. The older
> style of one-element or zero-length arrays should no longer be used.
> Reference:
> https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>

Makes sense. I'm applying this patch to amd-staging-drm-next.

I also found a similar issue in include/uapi/linux/kfd_ioctl.h. I'll 
send another patch to fix that as well.

Regards,
   Felix


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> index e54a52785690..7d39191d13f6 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> @@ -1084,7 +1084,7 @@ struct kfd_criu_svm_range_priv_data {
>   	uint64_t start_addr;
>   	uint64_t size;
>   	/* Variable length array of attributes */
> -	struct kfd_ioctl_svm_attribute attrs[0];
> +	struct kfd_ioctl_svm_attribute attrs[];
>   };
>   
>   struct kfd_criu_queue_priv_data {

      parent reply	other threads:[~2022-02-16  0:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15  9:11 [PATCH] drm/amdkfd: Replace zero-length array with flexible-array member cgel.zte
2022-02-15  9:21 ` Christian König
2022-02-16  0:01 ` Felix Kuehling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35be6c0b-e6a8-d0f1-1870-6a77a18556c7@amd.com \
    --to=felix.kuehling@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=cgel.zte@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=deng.changcheng@zte.com.cn \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).