[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202102080148.SqEA3ItP-lkp@intel.com>
Date: Mon, 8 Feb 2021 01:56:51 +0800
From: kernel test robot <lkp@...el.com>
To: "Daniel W. S. Almeida" <dwlsalmeida@...il.com>
Cc: kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
linux-kernel@...r.kernel.org,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.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
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@...el.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
Download attachment ".config.gz" of type "application/gzip" (28234 bytes)
Powered by blists - more mailing lists