All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: drivers/media/test-drivers/vidtv/vidtv_psi.c:667:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt' may result in an unaligned pointer value
Date: Mon, 08 Feb 2021 01:56:51 +0800	[thread overview]
Message-ID: <202102080148.SqEA3ItP-lkp@intel.com> (raw)

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

Hi Daniel,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: f90cf6079bf67988f8b1ad1ade70fc89d0080905 media: vidtv: add a bridge driver
date:   5 months ago
config: mips-randconfig-r032-20210207 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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=f90cf6079bf67988f8b1ad1ade70fc89d0080905
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f90cf6079bf67988f8b1ad1ade70fc89d0080905
        # 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 >>):

>> drivers/media/test-drivers/vidtv/vidtv_psi.c:667:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt' may result in an unaligned pointer value [-Waddress-of-packed-member]
           vidtv_psi_set_desc_loop_len(&pmt->bitfield2, desc_loop_len, 10);
                                        ^~~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:678:32: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt_stream' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   vidtv_psi_set_desc_loop_len(&s->bitfield2, desc_loop_len, 10);
                                                ^~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:710:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_sdt_service' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   vidtv_psi_set_desc_loop_len(&s->bitfield, desc_loop_len, 12);
                                                ^~~~~~~~~~~
   drivers/media/test-drivers/vidtv/vidtv_psi.c:97:19: warning: unused function 'vidtv_psi_sdt_serv_get_desc_loop_len' [-Wunused-function]
   static inline u16 vidtv_psi_sdt_serv_get_desc_loop_len(struct vidtv_psi_table_sdt_service *s)
                     ^
   drivers/media/test-drivers/vidtv/vidtv_psi.c:112:19: warning: unused function 'vidtv_psi_pmt_stream_get_desc_loop_len' [-Wunused-function]
   static inline u16 vidtv_psi_pmt_stream_get_desc_loop_len(struct vidtv_psi_table_pmt_stream *s)
                     ^
   drivers/media/test-drivers/vidtv/vidtv_psi.c:127:19: warning: unused function 'vidtv_psi_pmt_get_desc_loop_len' [-Wunused-function]
   static inline u16 vidtv_psi_pmt_get_desc_loop_len(struct vidtv_psi_table_pmt *p)
                     ^
   6 warnings generated.
--
>> drivers/media/test-drivers/vidtv/vidtv_channel.c:133:27: warning: taking address of packed member 'descriptor' of class or structure 'vidtv_psi_table_sdt_service' may result in an unaligned pointer value [-Waddress-of-packed-member]
                           vidtv_psi_desc_assign(&tail->descriptor, desc);
                                                  ^~~~~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_channel.c:231:29: warning: taking address of packed member 'descriptor' of class or structure 'vidtv_psi_table_pmt_stream' may result in an unaligned pointer value [-Waddress-of-packed-member]
                                           vidtv_psi_desc_assign(&tail->descriptor, desc);
                                                                  ^~~~~~~~~~~~~~~~
   2 warnings generated.


vim +667 drivers/media/test-drivers/vidtv/vidtv_psi.c

   655	
   656	void vidtv_psi_pmt_table_update_sec_len(struct vidtv_psi_table_pmt *pmt)
   657	{
   658		/* see ISO/IEC 13818-1 : 2000 p.46 */
   659		u16 length = 0;
   660		struct vidtv_psi_table_pmt_stream *s = pmt->stream;
   661		u16 desc_loop_len;
   662	
   663		/* from immediately after 'section_length' until 'program_info_length'*/
   664		length += PMT_LEN_UNTIL_PROGRAM_INFO_LENGTH;
   665	
   666		desc_loop_len = vidtv_psi_desc_comp_loop_len(pmt->descriptor);
 > 667		vidtv_psi_set_desc_loop_len(&pmt->bitfield2, desc_loop_len, 10);
   668	
   669		length += desc_loop_len;
   670	
   671		while (s) {
   672			/* skip both pointers at the end */
   673			length += sizeof(struct vidtv_psi_table_pmt_stream) -
   674				  sizeof(struct vidtv_psi_desc *) -
   675				  sizeof(struct vidtv_psi_table_pmt_stream *);
   676	
   677			desc_loop_len = vidtv_psi_desc_comp_loop_len(s->descriptor);
 > 678			vidtv_psi_set_desc_loop_len(&s->bitfield2, desc_loop_len, 10);
   679	
   680			length += desc_loop_len;
   681	
   682			s = s->next;
   683		}
   684	
   685		length += CRC_SIZE_IN_BYTES;
   686	
   687		vidtv_psi_set_sec_len(&pmt->header, length);
   688	}
   689	
   690	void vidtv_psi_sdt_table_update_sec_len(struct vidtv_psi_table_sdt *sdt)
   691	{
   692		/* see ETSI EN 300 468 V 1.10.1 p.24 */
   693		u16 length = 0;
   694		struct vidtv_psi_table_sdt_service *s = sdt->service;
   695		u16 desc_loop_len;
   696	
   697		/*
   698		 * from immediately after 'section_length' until
   699		 * 'reserved_for_future_use'
   700		 */
   701		length += SDT_LEN_UNTIL_RESERVED_FOR_FUTURE_USE;
   702	
   703		while (s) {
   704			/* skip both pointers at the end */
   705			length += sizeof(struct vidtv_psi_table_sdt_service) -
   706				  sizeof(struct vidtv_psi_desc *) -
   707				  sizeof(struct vidtv_psi_table_sdt_service *);
   708	
   709			desc_loop_len = vidtv_psi_desc_comp_loop_len(s->descriptor);
 > 710			vidtv_psi_set_desc_loop_len(&s->bitfield, desc_loop_len, 12);
   711	
   712			length += desc_loop_len;
   713	
   714			s = s->next;
   715		}
   716	
   717		length += CRC_SIZE_IN_BYTES;
   718	
   719		vidtv_psi_set_sec_len(&sdt->header, length);
   720	}
   721	

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org
Subject: drivers/media/test-drivers/vidtv/vidtv_psi.c:667:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt' may result in an unaligned pointer value
Date: Mon, 8 Feb 2021 01:56:51 +0800	[thread overview]
Message-ID: <202102080148.SqEA3ItP-lkp@intel.com> (raw)

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

Hi Daniel,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: f90cf6079bf67988f8b1ad1ade70fc89d0080905 media: vidtv: add a bridge driver
date:   5 months ago
config: mips-randconfig-r032-20210207 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
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=f90cf6079bf67988f8b1ad1ade70fc89d0080905
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f90cf6079bf67988f8b1ad1ade70fc89d0080905
        # 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 >>):

>> drivers/media/test-drivers/vidtv/vidtv_psi.c:667:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt' may result in an unaligned pointer value [-Waddress-of-packed-member]
           vidtv_psi_set_desc_loop_len(&pmt->bitfield2, desc_loop_len, 10);
                                        ^~~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:678:32: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt_stream' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   vidtv_psi_set_desc_loop_len(&s->bitfield2, desc_loop_len, 10);
                                                ^~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:710:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_sdt_service' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   vidtv_psi_set_desc_loop_len(&s->bitfield, desc_loop_len, 12);
                                                ^~~~~~~~~~~
   drivers/media/test-drivers/vidtv/vidtv_psi.c:97:19: warning: unused function 'vidtv_psi_sdt_serv_get_desc_loop_len' [-Wunused-function]
   static inline u16 vidtv_psi_sdt_serv_get_desc_loop_len(struct vidtv_psi_table_sdt_service *s)
                     ^
   drivers/media/test-drivers/vidtv/vidtv_psi.c:112:19: warning: unused function 'vidtv_psi_pmt_stream_get_desc_loop_len' [-Wunused-function]
   static inline u16 vidtv_psi_pmt_stream_get_desc_loop_len(struct vidtv_psi_table_pmt_stream *s)
                     ^
   drivers/media/test-drivers/vidtv/vidtv_psi.c:127:19: warning: unused function 'vidtv_psi_pmt_get_desc_loop_len' [-Wunused-function]
   static inline u16 vidtv_psi_pmt_get_desc_loop_len(struct vidtv_psi_table_pmt *p)
                     ^
   6 warnings generated.
--
>> drivers/media/test-drivers/vidtv/vidtv_channel.c:133:27: warning: taking address of packed member 'descriptor' of class or structure 'vidtv_psi_table_sdt_service' may result in an unaligned pointer value [-Waddress-of-packed-member]
                           vidtv_psi_desc_assign(&tail->descriptor, desc);
                                                  ^~~~~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_channel.c:231:29: warning: taking address of packed member 'descriptor' of class or structure 'vidtv_psi_table_pmt_stream' may result in an unaligned pointer value [-Waddress-of-packed-member]
                                           vidtv_psi_desc_assign(&tail->descriptor, desc);
                                                                  ^~~~~~~~~~~~~~~~
   2 warnings generated.


vim +667 drivers/media/test-drivers/vidtv/vidtv_psi.c

   655	
   656	void vidtv_psi_pmt_table_update_sec_len(struct vidtv_psi_table_pmt *pmt)
   657	{
   658		/* see ISO/IEC 13818-1 : 2000 p.46 */
   659		u16 length = 0;
   660		struct vidtv_psi_table_pmt_stream *s = pmt->stream;
   661		u16 desc_loop_len;
   662	
   663		/* from immediately after 'section_length' until 'program_info_length'*/
   664		length += PMT_LEN_UNTIL_PROGRAM_INFO_LENGTH;
   665	
   666		desc_loop_len = vidtv_psi_desc_comp_loop_len(pmt->descriptor);
 > 667		vidtv_psi_set_desc_loop_len(&pmt->bitfield2, desc_loop_len, 10);
   668	
   669		length += desc_loop_len;
   670	
   671		while (s) {
   672			/* skip both pointers at the end */
   673			length += sizeof(struct vidtv_psi_table_pmt_stream) -
   674				  sizeof(struct vidtv_psi_desc *) -
   675				  sizeof(struct vidtv_psi_table_pmt_stream *);
   676	
   677			desc_loop_len = vidtv_psi_desc_comp_loop_len(s->descriptor);
 > 678			vidtv_psi_set_desc_loop_len(&s->bitfield2, desc_loop_len, 10);
   679	
   680			length += desc_loop_len;
   681	
   682			s = s->next;
   683		}
   684	
   685		length += CRC_SIZE_IN_BYTES;
   686	
   687		vidtv_psi_set_sec_len(&pmt->header, length);
   688	}
   689	
   690	void vidtv_psi_sdt_table_update_sec_len(struct vidtv_psi_table_sdt *sdt)
   691	{
   692		/* see ETSI EN 300 468 V 1.10.1 p.24 */
   693		u16 length = 0;
   694		struct vidtv_psi_table_sdt_service *s = sdt->service;
   695		u16 desc_loop_len;
   696	
   697		/*
   698		 * from immediately after 'section_length' until
   699		 * 'reserved_for_future_use'
   700		 */
   701		length += SDT_LEN_UNTIL_RESERVED_FOR_FUTURE_USE;
   702	
   703		while (s) {
   704			/* skip both pointers at the end */
   705			length += sizeof(struct vidtv_psi_table_sdt_service) -
   706				  sizeof(struct vidtv_psi_desc *) -
   707				  sizeof(struct vidtv_psi_table_sdt_service *);
   708	
   709			desc_loop_len = vidtv_psi_desc_comp_loop_len(s->descriptor);
 > 710			vidtv_psi_set_desc_loop_len(&s->bitfield, desc_loop_len, 12);
   711	
   712			length += desc_loop_len;
   713	
   714			s = s->next;
   715		}
   716	
   717		length += CRC_SIZE_IN_BYTES;
   718	
   719		vidtv_psi_set_sec_len(&sdt->header, length);
   720	}
   721	

---
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: 28234 bytes --]

             reply	other threads:[~2021-02-07 17:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 17:56 kernel test robot [this message]
2021-02-07 17:56 ` drivers/media/test-drivers/vidtv/vidtv_psi.c:667:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_pmt' may result in an unaligned pointer value kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-01-14 17:23 kernel test robot
2021-01-14 17:23 ` kernel test robot

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=202102080148.SqEA3ItP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.