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:1457:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value
Date: Thu, 01 Jul 2021 18:46:06 +0800	[thread overview]
Message-ID: <202107011800.sEf9iILF-lkp@intel.com> (raw)

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

Hi Daniel,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dbe69e43372212527abf48609aba7fc39a6daa27
commit: c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da media: vidtv: psi: add a Network Information Table (NIT)
date:   7 months ago
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/torvalds/linux.git/commit/?id=c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da
        # 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:753: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:764: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:796: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:1457:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
           vidtv_psi_set_desc_loop_len(&nit->bitfield, desc_loop_len, 12);
                                        ^~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1472:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_transport' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   vidtv_psi_set_desc_loop_len(&t->bitfield, desc_loop_len, 12);
                                                ^~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1480:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
           vidtv_psi_set_desc_loop_len(&nit->bitfield2, transport_loop_len, 12);
                                        ^~~~~~~~~~~~~~
   drivers/media/test-drivers/vidtv/vidtv_psi.c:92: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:103: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:114: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)
                     ^
   9 warnings generated.


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

  1442	
  1443	static void vidtv_psi_nit_table_update_sec_len(struct vidtv_psi_table_nit *nit)
  1444	{
  1445		u16 length = 0;
  1446		struct vidtv_psi_table_transport *t = nit->transport;
  1447		u16 desc_loop_len;
  1448		u16 transport_loop_len = 0;
  1449	
  1450		/*
  1451		 * from immediately after 'section_length' until
  1452		 * 'network_descriptor_length'
  1453		 */
  1454		length += NIT_LEN_UNTIL_NETWORK_DESCRIPTOR_LEN;
  1455	
  1456		desc_loop_len = vidtv_psi_desc_comp_loop_len(nit->descriptor);
> 1457		vidtv_psi_set_desc_loop_len(&nit->bitfield, desc_loop_len, 12);
  1458	
  1459		length += desc_loop_len;
  1460	
  1461		length += sizeof_field(struct vidtv_psi_table_nit, bitfield2);
  1462	
  1463		while (t) {
  1464			/* skip both pointers at the end */
  1465			transport_loop_len += sizeof(struct vidtv_psi_table_transport) -
  1466					      sizeof(struct vidtv_psi_desc *) -
  1467					      sizeof(struct vidtv_psi_table_transport *);
  1468	
  1469			length += transport_loop_len;
  1470	
  1471			desc_loop_len = vidtv_psi_desc_comp_loop_len(t->descriptor);
> 1472			vidtv_psi_set_desc_loop_len(&t->bitfield, desc_loop_len, 12);
  1473	
  1474			length += desc_loop_len;
  1475	
  1476			t = t->next;
  1477		}
  1478	
  1479		// Actually sets the transport stream loop len, maybe rename this function later
> 1480		vidtv_psi_set_desc_loop_len(&nit->bitfield2, transport_loop_len, 12);
  1481		length += CRC_SIZE_IN_BYTES;
  1482	
  1483		vidtv_psi_set_sec_len(&nit->header, length);
  1484	}
  1485	

---
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: 45128 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: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
	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:1457:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value
Date: Thu, 1 Jul 2021 18:46:06 +0800	[thread overview]
Message-ID: <202107011800.sEf9iILF-lkp@intel.com> (raw)

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

Hi Daniel,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dbe69e43372212527abf48609aba7fc39a6daa27
commit: c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da media: vidtv: psi: add a Network Information Table (NIT)
date:   7 months ago
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/torvalds/linux.git/commit/?id=c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout c2f78f0cb294aa6f009d3a170f4ee8ad199ba5da
        # 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:753: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:764: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:796: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:1457:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
           vidtv_psi_set_desc_loop_len(&nit->bitfield, desc_loop_len, 12);
                                        ^~~~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1472:32: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_transport' may result in an unaligned pointer value [-Waddress-of-packed-member]
                   vidtv_psi_set_desc_loop_len(&t->bitfield, desc_loop_len, 12);
                                                ^~~~~~~~~~~
>> drivers/media/test-drivers/vidtv/vidtv_psi.c:1480:31: warning: taking address of packed member 'bitfield2' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value [-Waddress-of-packed-member]
           vidtv_psi_set_desc_loop_len(&nit->bitfield2, transport_loop_len, 12);
                                        ^~~~~~~~~~~~~~
   drivers/media/test-drivers/vidtv/vidtv_psi.c:92: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:103: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:114: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)
                     ^
   9 warnings generated.


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

  1442	
  1443	static void vidtv_psi_nit_table_update_sec_len(struct vidtv_psi_table_nit *nit)
  1444	{
  1445		u16 length = 0;
  1446		struct vidtv_psi_table_transport *t = nit->transport;
  1447		u16 desc_loop_len;
  1448		u16 transport_loop_len = 0;
  1449	
  1450		/*
  1451		 * from immediately after 'section_length' until
  1452		 * 'network_descriptor_length'
  1453		 */
  1454		length += NIT_LEN_UNTIL_NETWORK_DESCRIPTOR_LEN;
  1455	
  1456		desc_loop_len = vidtv_psi_desc_comp_loop_len(nit->descriptor);
> 1457		vidtv_psi_set_desc_loop_len(&nit->bitfield, desc_loop_len, 12);
  1458	
  1459		length += desc_loop_len;
  1460	
  1461		length += sizeof_field(struct vidtv_psi_table_nit, bitfield2);
  1462	
  1463		while (t) {
  1464			/* skip both pointers at the end */
  1465			transport_loop_len += sizeof(struct vidtv_psi_table_transport) -
  1466					      sizeof(struct vidtv_psi_desc *) -
  1467					      sizeof(struct vidtv_psi_table_transport *);
  1468	
  1469			length += transport_loop_len;
  1470	
  1471			desc_loop_len = vidtv_psi_desc_comp_loop_len(t->descriptor);
> 1472			vidtv_psi_set_desc_loop_len(&t->bitfield, desc_loop_len, 12);
  1473	
  1474			length += desc_loop_len;
  1475	
  1476			t = t->next;
  1477		}
  1478	
  1479		// Actually sets the transport stream loop len, maybe rename this function later
> 1480		vidtv_psi_set_desc_loop_len(&nit->bitfield2, transport_loop_len, 12);
  1481		length += CRC_SIZE_IN_BYTES;
  1482	
  1483		vidtv_psi_set_sec_len(&nit->header, length);
  1484	}
  1485	

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

             reply	other threads:[~2021-07-01 10:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 10:46 kernel test robot [this message]
2021-07-01 10:46 ` drivers/media/test-drivers/vidtv/vidtv_psi.c:1457:31: warning: taking address of packed member 'bitfield' of class or structure 'vidtv_psi_table_nit' may result in an unaligned pointer value kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-02-07 18:51 kernel test robot
2021-02-07 18:51 ` kernel test robot
2021-01-14 19:00 kernel test robot
2021-01-14 19:00 ` 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=202107011800.sEf9iILF-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.