public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [avpatel:riscv_acpi_b2_v7_611_rc1_full 40/40] drivers/tty/serial/8250/8250_platform.c:111:33: error: initializer for aggregate with no elements requires explicit braces
@ 2024-07-30 19:15 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-07-30 19:15 UTC (permalink / raw)
  To: Sunil V L; +Cc: llvm, oe-kbuild-all, Anup Patel

tree:   https://github.com/avpatel/linux.git riscv_acpi_b2_v7_611_rc1_full
head:   4423be73ba644a89e48da1cebbdf901f04b801f3
commit: 4423be73ba644a89e48da1cebbdf901f04b801f3 [40/40] serial: 8250_platform: Enable generic 16550A platform devices
config: arm-aspeed_g4_defconfig (https://download.01.org/0day-ci/archive/20240731/202407310329.UvSZglfK-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project ccae7b461be339e717d02f99ac857cf0bc7d17fc)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240731/202407310329.UvSZglfK-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407310329.UvSZglfK-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/tty/serial/8250/8250_platform.c:17:
   In file included from include/linux/serial_8250.h:11:
   In file included from include/linux/serial_core.h:16:
   In file included from include/linux/tty.h:11:
   In file included from include/linux/tty_port.h:5:
   In file included from include/linux/kfifo.h:40:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:8:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/tty/serial/8250/8250_platform.c:111:33: error: initializer for aggregate with no elements requires explicit braces
     111 |         struct uart_8250_port uart = { 0 };
         |                                        ^
   1 warning and 1 error generated.


vim +111 drivers/tty/serial/8250/8250_platform.c

   104	
   105	/*
   106	 * Generic 16550A platform devices
   107	 */
   108	static int serial8250_platform_probe(struct platform_device *pdev)
   109	{
   110		struct device *dev = &pdev->dev;
 > 111		struct uart_8250_port uart = { 0 };
   112		struct resource *regs;
   113		unsigned char iotype;
   114		int ret, line;
   115	
   116		regs = platform_get_resource(pdev, IORESOURCE_IO, 0);
   117		if (regs) {
   118			uart.port.iobase = regs->start;
   119			iotype = UPIO_PORT;
   120		} else {
   121			regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   122			if (!regs) {
   123				dev_err(dev, "no registers defined\n");
   124				return -EINVAL;
   125			}
   126	
   127			uart.port.mapbase = regs->start;
   128			uart.port.mapsize = resource_size(regs);
   129			uart.port.flags = UPF_IOREMAP;
   130			iotype = UPIO_MEM;
   131		}
   132	
   133		/* Default clock frequency*/
   134		uart.port.uartclk = 1843200;
   135		uart.port.type = PORT_16550A;
   136		uart.port.dev = &pdev->dev;
   137		uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
   138		ret = uart_read_and_validate_port_properties(&uart.port);
   139		/* no interrupt -> fall back to polling */
   140		if (ret == -ENXIO)
   141			ret = 0;
   142		if (ret)
   143			return ret;
   144	
   145		if (uart.port.mapbase) {
   146			uart.port.membase = devm_ioremap(dev, uart.port.mapbase, uart.port.mapsize);
   147			if (!uart.port.membase)
   148				return -ENOMEM;
   149		}
   150	
   151		/*
   152		 * The previous call may not set iotype correctly when reg-io-width
   153		 * property is absent and it doesn't support IO port resource.
   154		 */
   155		uart.port.iotype = iotype;
   156	
   157		line = serial8250_register_8250_port(&uart);
   158		if (line < 0)
   159			return -ENODEV;
   160	
   161		return 0;
   162	}
   163	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-30 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-30 19:15 [avpatel:riscv_acpi_b2_v7_611_rc1_full 40/40] drivers/tty/serial/8250/8250_platform.c:111:33: error: initializer for aggregate with no elements requires explicit braces kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox