linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vt: use flexible-array member instead of zero-length array
@ 2020-12-31 12:04 Tian Tao
  2020-12-31 14:49 ` kernel test robot
  2020-12-31 14:53 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Tian Tao @ 2020-12-31 12:04 UTC (permalink / raw)
  To: gregkh, jirislaby; +Cc: linux-kernel

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 <tiantao6@hisilicon.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vt: use flexible-array member instead of zero-length array
  2020-12-31 12:04 [PATCH] vt: use flexible-array member instead of zero-length array Tian Tao
@ 2020-12-31 14:49 ` kernel test robot
  2020-12-31 14:53 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-12-31 14:49 UTC (permalink / raw)
  To: Tian Tao, gregkh, jirislaby; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2008 bytes --]

Hi Tian,

I love your patch! Yet something to improve:

[auto build test ERROR on tty/tty-testing]
[also build test ERROR on v5.11-rc1 next-20201223]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Tian-Tao/vt-use-flexible-array-member-instead-of-zero-length-array/20201231-200832
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: microblaze-randconfig-r015-20201231 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/c44b31ae1f6fc407170012bd6b5251e869299619
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Tian-Tao/vt-use-flexible-array-member-instead-of-zero-length-array/20201231-200832
        git checkout c44b31ae1f6fc407170012bd6b5251e869299619
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/tty/vt/vt.c:335:12: error: flexible array member in a struct with no named members
     335 |  char32_t *lines[];
         |            ^~~~~


vim +335 drivers/tty/vt/vt.c

   329	
   330	/*
   331	 * Our screen buffer is preceded by an array of line pointers so that
   332	 * scrolling only implies some pointer shuffling.
   333	 */
   334	struct uni_screen {
 > 335		char32_t *lines[];
   336	};
   337	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23808 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vt: use flexible-array member instead of zero-length array
  2020-12-31 12:04 [PATCH] vt: use flexible-array member instead of zero-length array Tian Tao
  2020-12-31 14:49 ` kernel test robot
@ 2020-12-31 14:53 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-12-31 14:53 UTC (permalink / raw)
  To: Tian Tao; +Cc: jirislaby, linux-kernel

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 <tiantao6@hisilicon.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-31 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 12:04 [PATCH] vt: use flexible-array member instead of zero-length array Tian Tao
2020-12-31 14:49 ` kernel test robot
2020-12-31 14:53 ` Greg KH

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).