Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp11366002pxu; Thu, 31 Dec 2020 07:28:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyW9NRUVhAq9bGP5Y8HSiVnvbE1fTPHUxBHCbDMNKXxHgD61g/V76JYF8VRjtLRgy4nEt6D X-Received: by 2002:a17:906:bc9b:: with SMTP id lv27mr52431856ejb.505.1609428518838; Thu, 31 Dec 2020 07:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609428518; cv=none; d=google.com; s=arc-20160816; b=eeBSfaHfbKYZhcVmZOi/HtGTlR+CJsR4FAgXNqrFpwS2RijHKmFp54FWU+joD6Dpjl X/od5/4zw55061z1TpJPhG1rOtZBB47ob+tDy38tQq6vl9KlrFyLEnCFFwhPcMD+RKaS E1DrKWAwgigArslyCapsCi5gzzo6W73Nd2M84IwzfCS7XavKlVEa+f/1yw1VxgO6QALV AqDSNEKmoOTwtVbOfJiIB/Q+BqEqb4VWrSkHGgK93YzG4ZI5rmb5WxXdDcskjSCSKfzd 0VmTJu/L4y7Qf3BLOtQM6DX07L9jI67jxTqZ/5TPV4LGjNyWdljJADa0cJa7kh4kr8dg vScQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=F2NZv+41xYpQqfMOOvPyg0Je/Cj7DtaHSeVLn7kN1d4=; b=fsDlNXN5ox61vud7mbbzcOZVKpGzaVP7EIVKMrSLelby/t2KTn5Aex1R3M1HlUI/Ln 4oO9aW+XtbEmqQqBP/fP/522Z3oDMmnOAHzA2nfbpNOMLFoV2IWCCUWHXJ/Y18aMiWUo HwfN3J1h1uSOzPLENpcNQl0Ty0mVcyZOhXBzpYQ/R49h868wfVOr1pH6vneAVHXUXXCf mCawW3+hvv/R+E4KZ0bvqiDjZGfCJ1coOX6LFgw3QszWx8psj6iwIWYPOrBi5v4LnrNj 0pE2Trfh/nI5Jtas/ACmL4n8CWgVGHLB9tT96OlYFyRZyACNG7QkJVTQufyBmBdzjOdJ InPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BxyuR7pG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r4si24277903edm.79.2020.12.31.07.28.14; Thu, 31 Dec 2020 07:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BxyuR7pG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726743AbgLaOw1 (ORCPT + 99 others); Thu, 31 Dec 2020 09:52:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:52666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbgLaOw0 (ORCPT ); Thu, 31 Dec 2020 09:52:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D0D3A223E4; Thu, 31 Dec 2020 14:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609426306; bh=mttXVcNsr3pH/aRjWc5qpqienEdbGGWuobbapRQZ0FI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BxyuR7pGdLDm8HrFV0Cuk3wWbUmQZXV6CzL+5Iyp6DjuWM87772sLTM55XBYOXg7K Q60gyWRtScHrWlv1IgTtzbTAEq+JWiGokfCFxKigG6mpxi/K8z2hNgXBlp9AJ7h6mV xk2Q2Iu+xxdhX3DeCLMcSekOrrbFn1+EeWtX0vgs= Date: Thu, 31 Dec 2020 15:53:10 +0100 From: Greg KH To: Tian Tao Cc: jirislaby@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vt: use flexible-array member instead of zero-length array Message-ID: References: <1609416240-35298-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1609416240-35298-1-git-send-email-tiantao6@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 31, 2020 at 08:04:00PM +0800, Tian Tao wrote: > Use flexible-array member introduced in C99 instead of zero-length > array. Most of zero-length array was already taken care in previous > patch [1]. Now modified few more cases which were not handled earlier. > > [1]. https://patchwork.kernel.org/patch/11394197/ > > Signed-off-by: Tian Tao > --- > drivers/tty/vt/vt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c > index d04a162..86b4c5f 100644 > --- a/drivers/tty/vt/vt.c > +++ b/drivers/tty/vt/vt.c > @@ -332,7 +332,7 @@ typedef uint32_t char32_t; > * scrolling only implies some pointer shuffling. > */ > struct uni_screen { > - char32_t *lines[0]; > + char32_t *lines[]; Are you _sure_ you can do this? What testing did you do? thanks, greg k-h