]> git.itanic.dy.fi Git - linux-stable/commitdiff
um: port_kern: fix -Wmissing-variable-declarations
authorNick Desaulniers <ndesaulniers@google.com>
Tue, 8 Aug 2023 17:31:45 +0000 (10:31 -0700)
committerRichard Weinberger <richard@nod.at>
Sat, 26 Aug 2023 20:44:37 +0000 (22:44 +0200)
I'm looking to enable -Wmissing-variable-declarations behind W=1. 0day
bot spotted the following instance:

  arch/um/drivers/port_kern.c:147:14: warning: no previous extern
  declaration for non-static variable 'port_work'
  [-Wmissing-variable-declarations]
  DECLARE_WORK(port_work, port_work_proc);
               ^
  arch/um/drivers/port_kern.c:147:1: note: declare 'static' if the
  variable is not intended to be used outside of this translation unit
  DECLARE_WORK(port_work, port_work_proc);
  ^

This symbol is not referenced by more than one translation unit, so give
it static storage.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/llvm/202308081050.sZEw4cQ5-lkp@intel.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/port_kern.c

index efa8b730409051346b8fb8b845a7587af5066839..c52b3ff3c092cff658866a9d2e9a9c832575b974 100644 (file)
@@ -144,7 +144,7 @@ static void port_work_proc(struct work_struct *unused)
        local_irq_restore(flags);
 }
 
-DECLARE_WORK(port_work, port_work_proc);
+static DECLARE_WORK(port_work, port_work_proc);
 
 static irqreturn_t port_interrupt(int irq, void *data)
 {