public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [jirislaby:devel 9/31] drivers/tty/serial/8250/8250_loongson.c:164:6: error: incompatible pointer to integer conversion assigning to 'int' from 'struct uart_8250_port *'
@ 2025-12-10 13:10 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-12-10 13:10 UTC (permalink / raw)
  To: Jiri Slaby (SUSE); +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head:   aaa90151bf411e640973aee67d80cf7c4c5e41ff
commit: 9013ba9b551281e9ea894b2e1af15af0c3db6f77 [9/31] serial8250 port operations work on struct uart_8250_port
config: um-allmodconfig (https://download.01.org/0day-ci/archive/20251210/202512102104.IujMeZkR-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251210/202512102104.IujMeZkR-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/202512102104.IujMeZkR-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/tty/serial/8250/8250_loongson.c:13:
   In file included from include/linux/io.h:12:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:1209:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
    1209 |         return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
         |                                                   ~~~~~~~~~~ ^
>> drivers/tty/serial/8250/8250_loongson.c:164:6: error: incompatible pointer to integer conversion assigning to 'int' from 'struct uart_8250_port *' [-Wint-conversion]
     164 |         ret = serial8250_register_8250_port(&uart);
         |             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/tty/serial/8250/8250_loongson.c:180:29: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct uart_8250_port *' [-Wint-conversion]
     180 |         serial8250_unregister_port(priv->line);
         |                                    ^~~~~~~~~~
   include/linux/serial_8250.h:178:56: note: passing argument to parameter here
     178 | void serial8250_unregister_port(struct uart_8250_port *);
         |                                                        ^
   drivers/tty/serial/8250/8250_loongson.c:189:26: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct uart_8250_port *' [-Wint-conversion]
     189 |         serial8250_suspend_port(priv->line);
         |                                 ^~~~~~~~~~
   include/linux/serial_8250.h:179:53: note: passing argument to parameter here
     179 | void serial8250_suspend_port(struct uart_8250_port *);
         |                                                     ^
   drivers/tty/serial/8250/8250_loongson.c:209:25: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct uart_8250_port *' [-Wint-conversion]
     209 |         serial8250_resume_port(priv->line);
         |                                ^~~~~~~~~~
   include/linux/serial_8250.h:180:52: note: passing argument to parameter here
     180 | void serial8250_resume_port(struct uart_8250_port *);
         |                                                    ^
   1 warning and 4 errors generated.


vim +164 drivers/tty/serial/8250/8250_loongson.c

25e95d76317685 Binbin Zhou 2025-10-11  106  
25e95d76317685 Binbin Zhou 2025-10-11  107  static int loongson_uart_probe(struct platform_device *pdev)
25e95d76317685 Binbin Zhou 2025-10-11  108  {
25e95d76317685 Binbin Zhou 2025-10-11  109  	struct device *dev = &pdev->dev;
25e95d76317685 Binbin Zhou 2025-10-11  110  	struct uart_8250_port uart = {};
25e95d76317685 Binbin Zhou 2025-10-11  111  	struct loongson_uart_priv *priv;
25e95d76317685 Binbin Zhou 2025-10-11  112  	struct uart_port *port;
25e95d76317685 Binbin Zhou 2025-10-11  113  	int ret;
25e95d76317685 Binbin Zhou 2025-10-11  114  
25e95d76317685 Binbin Zhou 2025-10-11  115  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
25e95d76317685 Binbin Zhou 2025-10-11  116  	if (!priv)
25e95d76317685 Binbin Zhou 2025-10-11  117  		return -ENOMEM;
25e95d76317685 Binbin Zhou 2025-10-11  118  
25e95d76317685 Binbin Zhou 2025-10-11  119  	priv->ddata = device_get_match_data(dev);
25e95d76317685 Binbin Zhou 2025-10-11  120  
25e95d76317685 Binbin Zhou 2025-10-11  121  	port = &uart.port;
25e95d76317685 Binbin Zhou 2025-10-11  122  	spin_lock_init(&port->lock);
25e95d76317685 Binbin Zhou 2025-10-11  123  	port->flags = UPF_SHARE_IRQ | UPF_FIXED_PORT | UPF_FIXED_TYPE | UPF_IOREMAP;
25e95d76317685 Binbin Zhou 2025-10-11  124  	port->iotype = UPIO_MEM;
25e95d76317685 Binbin Zhou 2025-10-11  125  	port->regshift = 0;
25e95d76317685 Binbin Zhou 2025-10-11  126  	port->dev = dev;
25e95d76317685 Binbin Zhou 2025-10-11  127  	port->type = PORT_16550A;
25e95d76317685 Binbin Zhou 2025-10-11  128  	port->private_data = priv;
25e95d76317685 Binbin Zhou 2025-10-11  129  
25e95d76317685 Binbin Zhou 2025-10-11  130  	port->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &priv->res);
25e95d76317685 Binbin Zhou 2025-10-11  131  	if (!port->membase)
25e95d76317685 Binbin Zhou 2025-10-11  132  		return -ENOMEM;
25e95d76317685 Binbin Zhou 2025-10-11  133  
25e95d76317685 Binbin Zhou 2025-10-11  134  	port->mapbase = priv->res->start;
25e95d76317685 Binbin Zhou 2025-10-11  135  	port->mapsize = resource_size(priv->res);
25e95d76317685 Binbin Zhou 2025-10-11  136  	port->serial_in = loongson_serial_in;
25e95d76317685 Binbin Zhou 2025-10-11  137  	port->serial_out = loongson_serial_out;
25e95d76317685 Binbin Zhou 2025-10-11  138  
25e95d76317685 Binbin Zhou 2025-10-11  139  	if (priv->ddata->has_frac) {
25e95d76317685 Binbin Zhou 2025-10-11  140  		port->get_divisor = loongson_frac_get_divisor;
25e95d76317685 Binbin Zhou 2025-10-11  141  		port->set_divisor = loongson_frac_set_divisor;
25e95d76317685 Binbin Zhou 2025-10-11  142  	}
25e95d76317685 Binbin Zhou 2025-10-11  143  
25e95d76317685 Binbin Zhou 2025-10-11  144  	ret = uart_read_port_properties(port);
25e95d76317685 Binbin Zhou 2025-10-11  145  	if (ret)
25e95d76317685 Binbin Zhou 2025-10-11  146  		return ret;
25e95d76317685 Binbin Zhou 2025-10-11  147  
25e95d76317685 Binbin Zhou 2025-10-11  148  	if (!port->uartclk) {
25e95d76317685 Binbin Zhou 2025-10-11  149  		priv->clk = devm_clk_get_enabled(dev, NULL);
25e95d76317685 Binbin Zhou 2025-10-11  150  		if (IS_ERR(priv->clk))
25e95d76317685 Binbin Zhou 2025-10-11  151  			return dev_err_probe(dev, PTR_ERR(priv->clk),
25e95d76317685 Binbin Zhou 2025-10-11  152  					     "Unable to determine clock frequency!\n");
25e95d76317685 Binbin Zhou 2025-10-11  153  		port->uartclk = clk_get_rate(priv->clk);
25e95d76317685 Binbin Zhou 2025-10-11  154  	}
25e95d76317685 Binbin Zhou 2025-10-11  155  
25e95d76317685 Binbin Zhou 2025-10-11  156  	priv->rst = devm_reset_control_get_optional_shared(dev, NULL);
25e95d76317685 Binbin Zhou 2025-10-11  157  	if (IS_ERR(priv->rst))
25e95d76317685 Binbin Zhou 2025-10-11  158  		return PTR_ERR(priv->rst);
25e95d76317685 Binbin Zhou 2025-10-11  159  
25e95d76317685 Binbin Zhou 2025-10-11  160  	ret = reset_control_deassert(priv->rst);
25e95d76317685 Binbin Zhou 2025-10-11  161  	if (ret)
25e95d76317685 Binbin Zhou 2025-10-11  162  		return ret;
25e95d76317685 Binbin Zhou 2025-10-11  163  
25e95d76317685 Binbin Zhou 2025-10-11 @164  	ret = serial8250_register_8250_port(&uart);
25e95d76317685 Binbin Zhou 2025-10-11  165  	if (ret < 0) {
25e95d76317685 Binbin Zhou 2025-10-11  166  		reset_control_assert(priv->rst);
25e95d76317685 Binbin Zhou 2025-10-11  167  		return ret;
25e95d76317685 Binbin Zhou 2025-10-11  168  	}
25e95d76317685 Binbin Zhou 2025-10-11  169  
25e95d76317685 Binbin Zhou 2025-10-11  170  	priv->line = ret;
25e95d76317685 Binbin Zhou 2025-10-11  171  	platform_set_drvdata(pdev, priv);
25e95d76317685 Binbin Zhou 2025-10-11  172  
25e95d76317685 Binbin Zhou 2025-10-11  173  	return 0;
25e95d76317685 Binbin Zhou 2025-10-11  174  }
25e95d76317685 Binbin Zhou 2025-10-11  175  
25e95d76317685 Binbin Zhou 2025-10-11  176  static void loongson_uart_remove(struct platform_device *pdev)
25e95d76317685 Binbin Zhou 2025-10-11  177  {
25e95d76317685 Binbin Zhou 2025-10-11  178  	struct loongson_uart_priv *priv = platform_get_drvdata(pdev);
25e95d76317685 Binbin Zhou 2025-10-11  179  
25e95d76317685 Binbin Zhou 2025-10-11 @180  	serial8250_unregister_port(priv->line);
25e95d76317685 Binbin Zhou 2025-10-11  181  	reset_control_assert(priv->rst);
25e95d76317685 Binbin Zhou 2025-10-11  182  }
25e95d76317685 Binbin Zhou 2025-10-11  183  

:::::: The code at line 164 was first introduced by commit
:::::: 25e95d763176854e961aaf0f8a76f435f2dab974 serial: 8250: Add Loongson uart driver support

:::::: TO: Binbin Zhou <zhoubinbin@loongson.cn>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-- 
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:[~2025-12-10 13:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-10 13:10 [jirislaby:devel 9/31] drivers/tty/serial/8250/8250_loongson.c:164:6: error: incompatible pointer to integer conversion assigning to 'int' from 'struct uart_8250_port *' 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