Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp11238146pxu; Thu, 31 Dec 2020 04:07:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzji5YrnbVuF1onXs+wVpnuVnOOamx3bnkvizNmsRnJulWQWPrZi6JghebBPDTPb++fzDYm X-Received: by 2002:a17:906:22c7:: with SMTP id q7mr52962363eja.486.1609416430669; Thu, 31 Dec 2020 04:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609416430; cv=none; d=google.com; s=arc-20160816; b=HXxQ8S+M+sy2NZ5BWWA+RNRTrQ2rS0asaY8dbclN/PpZNHp9XK3XXH1lyBXt4FZ5dk ryg2vX95w9lRktLBwKGe18Ed7YBLcYyx/+3fSzRYiiOQp9wQEnPF0czJbMPus9i05TrI vx1C73k+cQISjqaUOTRjYUfOXFteTMr1DX5fM7kJdaSrYkKdM8LrIlWrGWZX67CJ089j Ivdmm1q6iJybQcMp2ygQC3EnLcNc2+zmF93wqE9NytuOv3j6g//NDy6qEUkKmmezFU7/ GBV58XoNzxW9pCXVgdT8Dpxx+NxgzXRspAap6aZlP8B4tb3UHzx8T9XMfO+MWwHcNiha bKLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=tjyCoXm2jb87diLe4BsMJ0FDggX4fmCcEAH0BP6Nlao=; b=nJjme83+bEYp8wRGZldgecjYtGy5Qh+P4hWFFNCkV3hVN3RtM0M5FVsgPdyk5tiUPL Z4TqBHabB07U48YpS6wN/VhZqr+Zw83QjFjHdhAA3lCfXwJrx90oYk2x5pRifzgoiIIl rFzRmxUPBfS54WQBhgwZkCq3CeDJU3lxdXnKgFSu3XZTYphTbGfNfxQY4oyh/X3cxqfz YPUsfqfyUvkyxy0mk52gAF2olwE/dD5MdwdRQfSURWFKIvMrXIILlvipxoZjMRlSiTjb nKLBwLJsmpF68UBj0/vsOtvt54Hkc83LgiYnvTh2yRy9RU7Y6JnzC0OtUivvtQfmGFnw IMRA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si24674074edv.64.2020.12.31.04.06.48; Thu, 31 Dec 2020 04:07:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726354AbgLaMEr (ORCPT + 99 others); Thu, 31 Dec 2020 07:04:47 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10100 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726071AbgLaMEr (ORCPT ); Thu, 31 Dec 2020 07:04:47 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D66H91P6LzMChy; Thu, 31 Dec 2020 20:03:01 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Thu, 31 Dec 2020 20:04:01 +0800 From: Tian Tao To: , CC: Subject: [PATCH] vt: use flexible-array member instead of zero-length array Date: Thu, 31 Dec 2020 20:04:00 +0800 Message-ID: <1609416240-35298-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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[]; }; static struct uni_screen *vc_uniscr_alloc(unsigned int cols, unsigned int rows) -- 2.7.4