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

  arch/um/drivers/hostaudio_kern.c:316:3: warning: no previous extern
  declaration for non-static variable 'module_data'
  [-Wmissing-variable-declarations]
  } module_data;
    ^
  arch/um/drivers/hostaudio_kern.c:313:1: note: declare 'static' if the
  variable is not intended to be used outside of this translation unit
  struct {
  ^

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/hostaudio_kern.c

index 5b064d360cb7495a6392edee68d9d4f5b5572854..c42b793bce6506162ee5cb72262e3bb80188791d 100644 (file)
@@ -310,7 +310,7 @@ static const struct file_operations hostmixer_fops = {
        .release        = hostmixer_release,
 };
 
-struct {
+static struct {
        int dev_audio;
        int dev_mixer;
 } module_data;