linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Henningsson <coding@diwic.se>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@perex.cz>
Subject: [linux-next:master 2287/14009] 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: Thu, 1 Jul 2021 06:02:41 +0800	[thread overview]
Message-ID: <202107010626.8B5G8G6i-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 9341 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2e0046650f0f192a84a1793f0dc2f0991ed9a3e4
commit: 08fdced60ca08e34e316a3ab945636fcdfcbc973 [2287/14009] ALSA: rawmidi: Add framing mode
config: mips-buildonly-randconfig-r005-20210630 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d21d5472501460933e78aead04cf59579025ba4)
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/next/linux-next.git/commit/?id=08fdced60ca08e34e316a3ab945636fcdfcbc973
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 08fdced60ca08e34e316a3ab945636fcdfcbc973
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross 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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46454 bytes --]

                 reply	other threads:[~2021-06-30 22:04 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=202107010626.8B5G8G6i-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=coding@diwic.se \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --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;
as well as URLs for NNTP newsgroup(s).