[arm-platforms:irq/irq_chip_ro 5/9] drivers/irqchip/irq-versatile-fpga.c:72:9: error: implicit declaration of function 'seq_printf'; did you mean 'scnprintf'?

kernel test robot lkp at intel.com
Sun Jan 30 22:09:11 PST 2022


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/irq_chip_ro
head:   f63a5ded3ea0cd2c587db00f89d219789fbee683
commit: 2c12b32e6767380c697a9dd8bf032c643228485c [5/9] irqchip/versatile-fpga: Switch to dynamic chip name output
config: arm-integrator_defconfig (https://download.01.org/0day-ci/archive/20220131/202201311454.gbUcvZPq-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?id=2c12b32e6767380c697a9dd8bf032c643228485c
        git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
        git fetch --no-tags arm-platforms irq/irq_chip_ro
        git checkout 2c12b32e6767380c697a9dd8bf032c643228485c
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   drivers/irqchip/irq-versatile-fpga.c: In function 'fpga_irq_print_chip':
>> drivers/irqchip/irq-versatile-fpga.c:72:9: error: implicit declaration of function 'seq_printf'; did you mean 'scnprintf'? [-Werror=implicit-function-declaration]
      72 |         seq_printf(p, "%s", f->np->name);
         |         ^~~~~~~~~~
         |         scnprintf
   drivers/irqchip/irq-versatile-fpga.c: In function 'fpga_irqdomain_map':
   drivers/irqchip/irq-versatile-fpga.c:150:39: warning: passing argument 2 of 'irq_set_chip_and_handler' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     150 |         irq_set_chip_and_handler(irq, &fpga_chip,
         |                                       ^~~~~~~~~~
   In file included from drivers/irqchip/irq-versatile-fpga.c:6:
   include/linux/irq.h:718:80: note: expected 'struct irq_chip *' but argument is of type 'const struct irq_chip *'
     718 | static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *chip,
         |                                                               ~~~~~~~~~~~~~~~~~^~~~
   drivers/irqchip/irq-versatile-fpga.c: In function 'fpga_irq_init':
>> drivers/irqchip/irq-versatile-fpga.c:187:30: error: 'irq_start' undeclared (first use in this function); did you mean 'irq_stat'?
     187 |                         if (!irq_start)
         |                              ^~~~~~~~~
         |                              irq_stat
   drivers/irqchip/irq-versatile-fpga.c:187:30: note: each undeclared identifier is reported only once for each function it appears in
   cc1: some warnings being treated as errors


vim +72 drivers/irqchip/irq-versatile-fpga.c

    67	
    68	static void fpga_irq_print_chip(struct irq_data *d, struct seq_file *p)
    69	{
    70		struct fpga_irq_data *f = irq_data_get_irq_chip_data(d);
    71	
  > 72		seq_printf(p, "%s", f->np->name);
    73	}
    74	
    75	static const struct irq_chip fpga_chip = {
    76		.irq_ack	= fpga_irq_mask,
    77		.irq_mask	= fpga_irq_mask,
    78		.irq_unmask	= fpga_irq_unmask,
    79		.irq_print_chip	= fpga_irq_print_chip,
    80	};
    81	
    82	static void fpga_irq_handle(struct irq_desc *desc)
    83	{
    84		struct irq_chip *chip = irq_desc_get_chip(desc);
    85		struct fpga_irq_data *f = irq_desc_get_handler_data(desc);
    86		u32 status;
    87	
    88		chained_irq_enter(chip, desc);
    89	
    90		status = readl(f->base + IRQ_STATUS);
    91		if (status == 0) {
    92			do_bad_IRQ(desc);
    93			goto out;
    94		}
    95	
    96		do {
    97			unsigned int irq = ffs(status) - 1;
    98	
    99			status &= ~(1 << irq);
   100			generic_handle_domain_irq(f->domain, irq);
   101		} while (status);
   102	
   103	out:
   104		chained_irq_exit(chip, desc);
   105	}
   106	
   107	/*
   108	 * Handle each interrupt in a single FPGA IRQ controller.  Returns non-zero
   109	 * if we've handled at least one interrupt.  This does a single read of the
   110	 * status register and handles all interrupts in order from LSB first.
   111	 */
   112	static int handle_one_fpga(struct fpga_irq_data *f, struct pt_regs *regs)
   113	{
   114		int handled = 0;
   115		int irq;
   116		u32 status;
   117	
   118		while ((status  = readl(f->base + IRQ_STATUS))) {
   119			irq = ffs(status) - 1;
   120			generic_handle_domain_irq(f->domain, irq);
   121			handled = 1;
   122		}
   123	
   124		return handled;
   125	}
   126	
   127	/*
   128	 * Keep iterating over all registered FPGA IRQ controllers until there are
   129	 * no pending interrupts.
   130	 */
   131	static asmlinkage void __exception_irq_entry fpga_handle_irq(struct pt_regs *regs)
   132	{
   133		int i, handled;
   134	
   135		do {
   136			for (i = 0, handled = 0; i < fpga_irq_id; ++i)
   137				handled |= handle_one_fpga(&fpga_irq_devices[i], regs);
   138		} while (handled);
   139	}
   140	
   141	static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq,
   142			irq_hw_number_t hwirq)
   143	{
   144		struct fpga_irq_data *f = d->host_data;
   145	
   146		/* Skip invalid IRQs, only register handlers for the real ones */
   147		if (!(f->valid & BIT(hwirq)))
   148			return -EPERM;
   149		irq_set_chip_data(irq, f);
   150		irq_set_chip_and_handler(irq, &fpga_chip,
   151					handle_level_irq);
   152		irq_set_probe(irq);
   153		return 0;
   154	}
   155	
   156	static const struct irq_domain_ops fpga_irqdomain_ops = {
   157		.map = fpga_irqdomain_map,
   158		.xlate = irq_domain_xlate_onetwocell,
   159	};
   160	
   161	static void __init fpga_irq_init(void __iomem *base, int parent_irq,
   162					 u32 valid, struct device_node *node)
   163	{
   164		struct fpga_irq_data *f;
   165		int i;
   166	
   167		if (fpga_irq_id >= ARRAY_SIZE(fpga_irq_devices)) {
   168			pr_err("%s: too few FPGA IRQ controllers, increase CONFIG_VERSATILE_FPGA_IRQ_NR\n", __func__);
   169			return;
   170		}
   171		f = &fpga_irq_devices[fpga_irq_id];
   172		f->base = base;
   173		f->np = node;
   174		f->valid = valid;
   175	
   176		if (parent_irq != -1) {
   177			irq_set_chained_handler_and_data(parent_irq, fpga_irq_handle,
   178							 f);
   179		}
   180	
   181		f->domain = irq_domain_add_linear(node, fls(valid),
   182						  &fpga_irqdomain_ops, f);
   183	
   184		/* This will allocate all valid descriptors in the linear case */
   185		for (i = 0; i < fls(valid); i++)
   186			if (valid & BIT(i)) {
 > 187				if (!irq_start)
   188					irq_create_mapping(f->domain, i);
   189				f->used_irqs++;
   190			}
   191	
   192		pr_info("FPGA IRQ chip %d \"%s\" @ %p, %u irqs",
   193			fpga_irq_id, node->name, base, f->used_irqs);
   194		if (parent_irq != -1)
   195			pr_cont(", parent IRQ: %d\n", parent_irq);
   196		else
   197			pr_cont("\n");
   198	
   199		fpga_irq_id++;
   200	}
   201	

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



More information about the linux-arm-kernel mailing list