lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Mon, 19 Oct 2020 22:12:22 +0800
From:   kernel test robot <lkp@...el.com>
To:     Zhen Lei <thunder.leizhen@...wei.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Daniel Lezcano <daniel.lezcano@...aro.org>
Subject: drivers/clocksource/timer-sp804.c:68:12: warning: no previous
 prototype for 'sp804_clocksource_and_sched_clock_init'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7cf726a59435301046250c42131554d9ccc566b8
commit: 975434f8b24a55af31daa4634972890c061a0a0c clocksource/drivers/sp804: Delete the leading "__" of some functions
date:   4 weeks ago
config: riscv-randconfig-r015-20201019 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.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/torvalds/linux.git/commit/?id=975434f8b24a55af31daa4634972890c061a0a0c
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 975434f8b24a55af31daa4634972890c061a0a0c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

>> drivers/clocksource/timer-sp804.c:68:12: warning: no previous prototype for 'sp804_clocksource_and_sched_clock_init' [-Wmissing-prototypes]
      68 | int __init sp804_clocksource_and_sched_clock_init(void __iomem *base,
         |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/clocksource/timer-sp804.c:162:12: warning: no previous prototype for 'sp804_clockevents_init' [-Wmissing-prototypes]
     162 | int __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
         |            ^~~~~~~~~~~~~~~~~~~~~~

vim +/sp804_clocksource_and_sched_clock_init +68 drivers/clocksource/timer-sp804.c

    67	
  > 68	int __init sp804_clocksource_and_sched_clock_init(void __iomem *base,
    69							  const char *name,
    70							  struct clk *clk,
    71							  int use_sched_clock)
    72	{
    73		long rate;
    74	
    75		rate = sp804_get_clock_rate(clk, name);
    76		if (rate < 0)
    77			return -EINVAL;
    78	
    79		/* setup timer 0 as free-running clocksource */
    80		writel(0, base + TIMER_CTRL);
    81		writel(0xffffffff, base + TIMER_LOAD);
    82		writel(0xffffffff, base + TIMER_VALUE);
    83		writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
    84			base + TIMER_CTRL);
    85	
    86		clocksource_mmio_init(base + TIMER_VALUE, name,
    87			rate, 200, 32, clocksource_mmio_readl_down);
    88	
    89		if (use_sched_clock) {
    90			sched_clock_base = base;
    91			sched_clock_register(sp804_read, 32, rate);
    92		}
    93	
    94		return 0;
    95	}
    96	
    97	
    98	static void __iomem *clkevt_base;
    99	static unsigned long clkevt_reload;
   100	
   101	/*
   102	 * IRQ handler for the timer
   103	 */
   104	static irqreturn_t sp804_timer_interrupt(int irq, void *dev_id)
   105	{
   106		struct clock_event_device *evt = dev_id;
   107	
   108		/* clear the interrupt */
   109		writel(1, clkevt_base + TIMER_INTCLR);
   110	
   111		evt->event_handler(evt);
   112	
   113		return IRQ_HANDLED;
   114	}
   115	
   116	static inline void timer_shutdown(struct clock_event_device *evt)
   117	{
   118		writel(0, clkevt_base + TIMER_CTRL);
   119	}
   120	
   121	static int sp804_shutdown(struct clock_event_device *evt)
   122	{
   123		timer_shutdown(evt);
   124		return 0;
   125	}
   126	
   127	static int sp804_set_periodic(struct clock_event_device *evt)
   128	{
   129		unsigned long ctrl = TIMER_CTRL_32BIT | TIMER_CTRL_IE |
   130				     TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE;
   131	
   132		timer_shutdown(evt);
   133		writel(clkevt_reload, clkevt_base + TIMER_LOAD);
   134		writel(ctrl, clkevt_base + TIMER_CTRL);
   135		return 0;
   136	}
   137	
   138	static int sp804_set_next_event(unsigned long next,
   139		struct clock_event_device *evt)
   140	{
   141		unsigned long ctrl = TIMER_CTRL_32BIT | TIMER_CTRL_IE |
   142				     TIMER_CTRL_ONESHOT | TIMER_CTRL_ENABLE;
   143	
   144		writel(next, clkevt_base + TIMER_LOAD);
   145		writel(ctrl, clkevt_base + TIMER_CTRL);
   146	
   147		return 0;
   148	}
   149	
   150	static struct clock_event_device sp804_clockevent = {
   151		.features		= CLOCK_EVT_FEAT_PERIODIC |
   152					  CLOCK_EVT_FEAT_ONESHOT |
   153					  CLOCK_EVT_FEAT_DYNIRQ,
   154		.set_state_shutdown	= sp804_shutdown,
   155		.set_state_periodic	= sp804_set_periodic,
   156		.set_state_oneshot	= sp804_shutdown,
   157		.tick_resume		= sp804_shutdown,
   158		.set_next_event		= sp804_set_next_event,
   159		.rating			= 300,
   160	};
   161	
 > 162	int __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
   163					  struct clk *clk, const char *name)
   164	{
   165		struct clock_event_device *evt = &sp804_clockevent;
   166		long rate;
   167	
   168		rate = sp804_get_clock_rate(clk, name);
   169		if (rate < 0)
   170			return -EINVAL;
   171	
   172		clkevt_base = base;
   173		clkevt_reload = DIV_ROUND_CLOSEST(rate, HZ);
   174		evt->name = name;
   175		evt->irq = irq;
   176		evt->cpumask = cpu_possible_mask;
   177	
   178		writel(0, base + TIMER_CTRL);
   179	
   180		if (request_irq(irq, sp804_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
   181				"timer", &sp804_clockevent))
   182			pr_err("%s: request_irq() failed\n", "timer");
   183		clockevents_config_and_register(evt, rate, 0xf, 0xffffffff);
   184	
   185		return 0;
   186	}
   187	

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

Download attachment ".config.gz" of type "application/gzip" (43658 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ