drivers/tty/serial/8250/8250_platform.c:111:40: warning: excess elements in struct initializer
kernel test robot
build bottree: 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: alpha-defconfig (https://download.01.org/0day-ci/archive/20240731/[email protected]/config) compiler: alpha-linux-gcc (GCC) 13.3.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240731/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
drivers/tty/serial/8250/8250_platform.c: In function 'serial8250_platform_probe':
>> drivers/tty/serial/8250/8250_platform.c:111:40: warning: excess elements in struct initializer
111 | struct uart_8250_port uart = { 0 };
| ^
drivers/tty/serial/8250/8250_platform.c:111:40: note: (near initialization for 'uart.port.lock.<anonymous>.rlock.raw_lock')
drivers/tty/serial/8250/8250_platform.c: At top level:
drivers/tty/serial/8250/8250_platform.c:271:36: warning: 'acpi_platform_serial_table' defined but not used [-Wunused-const-variable=]
271 | static const struct acpi_device_id acpi_platform_serial_table[] = {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~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
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki