Skip to contentSkip to conversation

drivers/tty/mips_ejtag_fdc.c:343:32: error: incompatible pointer types passing 'const char **' to parameter of type 'const u8 **' (aka 'const unsigned char **')

DISCUSSION kernel test robot 2 participants 2 messages Jan 10, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw

Hi Jiri,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2144da25584eb10b84252230319b5783f6a83041
commit: ce7cbd9a6c81b5fc899bbc730072a1bddeae5d0d tty: mips_ejtag_fdc: use u8 for character pointers
date:   1 year, 1 month ago
config: mips-randconfig-r054-20250110 (https://download.01.org/0day-ci/archive/20250110/[email protected]/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250110/[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 errors (new ones prefixed by >>):

>> drivers/tty/mips_ejtag_fdc.c:343:32: error: incompatible pointer types passing 'const char **' to parameter of type 'const u8 **' (aka 'const unsigned char **') [-Werror,-Wincompatible-pointer-types]
     343 |                 word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1);
         |                                              ^~~~~~~~
   drivers/tty/mips_ejtag_fdc.c:216:57: note: passing argument to parameter 'ptrs' here
     216 | static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs,
         |                                                         ^
   drivers/tty/mips_ejtag_fdc.c:1224:31: error: incompatible pointer types passing 'const char *[1]' to parameter of type 'const u8 **' (aka 'const unsigned char **') [-Werror,-Wincompatible-pointer-types]
    1224 |         word = mips_ejtag_fdc_encode(bufs, &kgdbfdc_wbuflen, 1);
         |                                      ^~~~

drivers/tty/mips_ejtag_fdc.c:216:57: note: passing argument to parameter 'ptrs' here
216 | static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs,
| ^
2 errors generated.

vim +343 drivers/tty/mips_ejtag_fdc.c

4cebec609aea6d James Hogan 2015-01-29  299  
4cebec609aea6d James Hogan 2015-01-29  300  /* Low level console write shared by early console and normal console */
4cebec609aea6d James Hogan 2015-01-29  301  static void mips_ejtag_fdc_console_write(struct console *c, const char *s,
4cebec609aea6d James Hogan 2015-01-29  302  					 unsigned int count)
4cebec609aea6d James Hogan 2015-01-29  303  {
4cebec609aea6d James Hogan 2015-01-29  304  	struct mips_ejtag_fdc_console *cons =
4cebec609aea6d James Hogan 2015-01-29  305  		container_of(c, struct mips_ejtag_fdc_console, cons);
4cebec609aea6d James Hogan 2015-01-29  306  	void __iomem *regs;
4cebec609aea6d James Hogan 2015-01-29  307  	struct fdc_word word;
4cebec609aea6d James Hogan 2015-01-29  308  	unsigned long flags;
4cebec609aea6d James Hogan 2015-01-29  309  	unsigned int i, buf_len, cpu;
4cebec609aea6d James Hogan 2015-01-29  310  	bool done_cr = false;
4cebec609aea6d James Hogan 2015-01-29  311  	char buf[4];
4cebec609aea6d James Hogan 2015-01-29  312  	const char *buf_ptr = buf;
4cebec609aea6d James Hogan 2015-01-29  313  	/* Number of bytes of input data encoded up to each byte in buf */
4cebec609aea6d James Hogan 2015-01-29  314  	u8 inc[4];
4cebec609aea6d James Hogan 2015-01-29  315  
4cebec609aea6d James Hogan 2015-01-29  316  	local_irq_save(flags);
4cebec609aea6d James Hogan 2015-01-29  317  	cpu = smp_processor_id();
4cebec609aea6d James Hogan 2015-01-29  318  	regs = cons->regs[cpu];
4cebec609aea6d James Hogan 2015-01-29  319  	/* First console output on this CPU? */
4cebec609aea6d James Hogan 2015-01-29  320  	if (!regs) {
4cebec609aea6d James Hogan 2015-01-29  321  		regs = mips_cdmm_early_probe(0xfd);
4cebec609aea6d James Hogan 2015-01-29  322  		cons->regs[cpu] = regs;
4cebec609aea6d James Hogan 2015-01-29  323  	}
4cebec609aea6d James Hogan 2015-01-29  324  	/* Already tried and failed to find FDC on this CPU? */
4cebec609aea6d James Hogan 2015-01-29  325  	if (IS_ERR(regs))
4cebec609aea6d James Hogan 2015-01-29  326  		goto out;
4cebec609aea6d James Hogan 2015-01-29  327  	while (count) {
4cebec609aea6d James Hogan 2015-01-29  328  		/*
4cebec609aea6d James Hogan 2015-01-29  329  		 * Copy the next few characters to a buffer so we can inject
4cebec609aea6d James Hogan 2015-01-29  330  		 * carriage returns before newlines.
4cebec609aea6d James Hogan 2015-01-29  331  		 */
4cebec609aea6d James Hogan 2015-01-29  332  		for (buf_len = 0, i = 0; buf_len < 4 && i < count; ++buf_len) {
4cebec609aea6d James Hogan 2015-01-29  333  			if (s[i] == '\n' && !done_cr) {
4cebec609aea6d James Hogan 2015-01-29  334  				buf[buf_len] = '\r';
4cebec609aea6d James Hogan 2015-01-29  335  				done_cr = true;
4cebec609aea6d James Hogan 2015-01-29  336  			} else {
4cebec609aea6d James Hogan 2015-01-29  337  				buf[buf_len] = s[i];
4cebec609aea6d James Hogan 2015-01-29  338  				done_cr = false;
4cebec609aea6d James Hogan 2015-01-29  339  				++i;
4cebec609aea6d James Hogan 2015-01-29  340  			}
4cebec609aea6d James Hogan 2015-01-29  341  			inc[buf_len] = i;
4cebec609aea6d James Hogan 2015-01-29  342  		}
4cebec609aea6d James Hogan 2015-01-29 @343  		word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1);
4cebec609aea6d James Hogan 2015-01-29  344  		count -= inc[word.bytes - 1];
4cebec609aea6d James Hogan 2015-01-29  345  		s += inc[word.bytes - 1];
4cebec609aea6d James Hogan 2015-01-29  346  
4cebec609aea6d James Hogan 2015-01-29  347  		/* Busy wait until there's space in fifo */
70f041b6e1ff50 James Hogan 2015-04-28  348  		while (__raw_readl(regs + REG_FDSTAT) & REG_FDSTAT_TXF)
4cebec609aea6d James Hogan 2015-01-29  349  			;
70f041b6e1ff50 James Hogan 2015-04-28  350  		__raw_writel(word.word, regs + REG_FDTX(c->index));
4cebec609aea6d James Hogan 2015-01-29  351  	}
4cebec609aea6d James Hogan 2015-01-29  352  out:
4cebec609aea6d James Hogan 2015-01-29  353  	local_irq_restore(flags);
4cebec609aea6d James Hogan 2015-01-29  354  }
4cebec609aea6d James Hogan 2015-01-29  355  

:::::: The code at line 343 was first introduced by commit
:::::: 4cebec609aea6dff23e67a42b6516d852fa87d07 TTY: Add MIPS EJTAG Fast Debug Channel TTY driver

:::::: TO: James Hogan <[email protected]>
:::::: CC: Ralf Baechle <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#1 lore raw
Quoted 17 lines · kernel test robot

Hi Jiri,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2144da25584eb10b84252230319b5783f6a83041
commit: ce7cbd9a6c81b5fc899bbc730072a1bddeae5d0d tty: mips_ejtag_fdc: use u8 for character pointers
date:   1 year, 1 month ago
config: mips-randconfig-r054-20250110 (https://download.01.org/0day-ci/archive/20250110/[email protected]/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250110/[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]/

Quoted 4 lines

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers/tty/mips_ejtag_fdc.c:343:32: error: incompatible pointer types passing 'const char **' to parameter of type 'const u8 **' (aka 'const unsigned char **') [-Werror,-Wincompatible-pointer-types]

      343 |                 word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1);

This one was fixed by:
commit 188942f05ce45f80c06f7242ad7478bd204c3387

Author: Serge Semin <[email protected]>
Date:   Thu Feb 15 20:17:29 2024 +0300

tty: mips_ejtag_fdc: Fix passing incompatible pointer type warning

Quoted 3 lines

drivers/tty/mips_ejtag_fdc.c:1224:31: error: incompatible pointer types passing 'const char *[1]' to parameter of type 'const u8 **' (aka 'const unsigned char **') [-Werror,-Wincompatible-pointer-types]
1224 | word = mips_ejtag_fdc_encode(bufs, &kgdbfdc_wbuflen, 1);
| ^~~~

This one, I will fix.

thanks,

Signature · 2 lines
js
suse labs