mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Henningsson <coding@diwic.se>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.de>,
	Jaroslav Kysela <perex@perex.cz>
Subject: sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value
Date: Fri, 26 Nov 2021 08:16:09 +0800	[thread overview]
Message-ID: <202111260812.IlTs6tBq-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8ced7ca3570333998ad2088d5a6275701970e28e
commit: 08fdced60ca08e34e316a3ab945636fcdfcbc973 ALSA: rawmidi: Add framing mode
date:   6 months ago
config: mips-randconfig-r002-20211031 (https://download.01.org/0day-ci/archive/20211126/202111260812.IlTs6tBq-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d321548c3ce987f4f21350ba1c81fdb5d4354224)
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
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=08fdced60ca08e34e316a3ab945636fcdfcbc973
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 08fdced60ca08e34e316a3ab945636fcdfcbc973
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=mips 

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

All warnings (new ones prefixed by >>):

   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:26:31: warning: taking address of packed member 'stream' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(params.stream, &src->stream) ||
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:26:31: warning: taking address of packed member 'stream' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(params.stream, &src->stream) ||
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:27:36: warning: taking address of packed member 'buffer_size' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.buffer_size, &src->buffer_size) ||
                                             ^~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:27:36: warning: taking address of packed member 'buffer_size' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.buffer_size, &src->buffer_size) ||
                                             ^~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:28:34: warning: taking address of packed member 'avail_min' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.avail_min, &src->avail_min) ||
                                           ^~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:28:34: warning: taking address of packed member 'avail_min' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.avail_min, &src->avail_min) ||
                                           ^~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
>> sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.mode, &src->mode) ||
                                      ^~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
>> sound/core/rawmidi_compat.c:29:29: warning: taking address of packed member 'mode' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(params.mode, &src->mode) ||
                                      ^~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:30:21: warning: taking address of packed member 'no_active_sensing' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(val, &src->no_active_sensing))
                              ^~~~~~~~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:30:21: warning: taking address of packed member 'no_active_sensing' of class or structure 'snd_rawmidi_params32' may result in an unaligned pointer value [-Waddress-of-packed-member]
               get_user(val, &src->no_active_sensing))
                              ^~~~~~~~~~~~~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:63:31: warning: taking address of packed member 'stream' of class or structure 'compat_snd_rawmidi_status64' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(status.stream, &src->stream))
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:21: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                              ^~~
   In file included from sound/core/rawmidi.c:1608:
   sound/core/rawmidi_compat.c:63:31: warning: taking address of packed member 'stream' of class or structure 'compat_snd_rawmidi_status64' may result in an unaligned pointer value [-Waddress-of-packed-member]
           if (get_user(status.stream, &src->stream))
                                        ^~~~~~~~~~~
   arch/mips/include/asm/uaccess.h:135:42: note: expanded from macro 'get_user'
           const __typeof__(*(ptr)) __user *__p = (ptr);                   \
                                                   ^~~
   12 warnings generated.


vim +29 sound/core/rawmidi_compat.c

    19	
    20	static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile,
    21						   struct snd_rawmidi_params32 __user *src)
    22	{
    23		struct snd_rawmidi_params params;
    24		unsigned int val;
    25	
    26		if (get_user(params.stream, &src->stream) ||
    27		    get_user(params.buffer_size, &src->buffer_size) ||
    28		    get_user(params.avail_min, &src->avail_min) ||
  > 29		    get_user(params.mode, &src->mode) ||
    30		    get_user(val, &src->no_active_sensing))
    31			return -EFAULT;
    32		params.no_active_sensing = val;
    33		switch (params.stream) {
    34		case SNDRV_RAWMIDI_STREAM_OUTPUT:
    35			if (!rfile->output)
    36				return -EINVAL;
    37			return snd_rawmidi_output_params(rfile->output, &params);
    38		case SNDRV_RAWMIDI_STREAM_INPUT:
    39			if (!rfile->input)
    40				return -EINVAL;
    41			return snd_rawmidi_input_params(rfile->input, &params);
    42		}
    43		return -EINVAL;
    44	}
    45	

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

                 reply	other threads:[~2021-11-26  0:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202111260812.IlTs6tBq-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=coding@diwic.se \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®