block/partitions/ldm.c:134:9: warning: 'strncpy' specified bound 16 equals destination size
by kernel test robot
Hi Heiko,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42eb8fdac2fc5d62392dcfcf0253753e821a97b0
commit: 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e init/Kconfig: make COMPILE_TEST depend on !S390
date: 12 months ago
config: s390-buildonly-randconfig-r006-20211118 (attached as .config)
compiler: s390-linux-gcc (GCC) 11.2.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In function 'ldm_parse_tocblock',
inlined from 'ldm_validate_tocblocks' at block/partitions/ldm.c:386:7:
>> block/partitions/ldm.c:134:9: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
134 | strncpy (toc->bitmap1_name, data + 0x24, sizeof (toc->bitmap1_name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
block/partitions/ldm.c:145:9: warning: 'strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
145 | strncpy (toc->bitmap2_name, data + 0x46, sizeof (toc->bitmap2_name));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncpy +134 block/partitions/ldm.c
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 111
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 112 /**
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 113 * ldm_parse_tocblock - Read the LDM Database TOCBLOCK structure
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 114 * @data: Raw database TOCBLOCK structure loaded from the device
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 115 * @toc: In-memory toc structure in which to return parsed information
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 116 *
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 117 * This parses the LDM Database TOCBLOCK (table of contents) structure supplied
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 118 * in @data and sets up the in-memory tocblock structure @toc with the obtained
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 119 * information.
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 120 *
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 121 * N.B. The *_start and *_size values returned in @toc are not range-checked.
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 122 *
130c6b98984a05 fs/partitions/ldm.c Richard Knutsson 2006-09-30 123 * Return: 'true' @toc contains the TOCBLOCK data
130c6b98984a05 fs/partitions/ldm.c Richard Knutsson 2006-09-30 124 * 'false' @toc contents are undefined
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 125 */
130c6b98984a05 fs/partitions/ldm.c Richard Knutsson 2006-09-30 126 static bool ldm_parse_tocblock (const u8 *data, struct tocblock *toc)
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 127 {
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 128 BUG_ON (!data || !toc);
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 129
b7bbf8fa6ba329 fs/partitions/ldm.c Harvey Harrison 2008-07-25 130 if (MAGIC_TOCBLOCK != get_unaligned_be64(data)) {
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 131 ldm_crit ("Cannot find TOCBLOCK, database may be corrupt.");
130c6b98984a05 fs/partitions/ldm.c Richard Knutsson 2006-09-30 132 return false;
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 133 }
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 @134 strncpy (toc->bitmap1_name, data + 0x24, sizeof (toc->bitmap1_name));
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 135 toc->bitmap1_name[sizeof (toc->bitmap1_name) - 1] = 0;
b7bbf8fa6ba329 fs/partitions/ldm.c Harvey Harrison 2008-07-25 136 toc->bitmap1_start = get_unaligned_be64(data + 0x2E);
b7bbf8fa6ba329 fs/partitions/ldm.c Harvey Harrison 2008-07-25 137 toc->bitmap1_size = get_unaligned_be64(data + 0x36);
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 138
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 139 if (strncmp (toc->bitmap1_name, TOC_BITMAP1,
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 140 sizeof (toc->bitmap1_name)) != 0) {
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 141 ldm_crit ("TOCBLOCK's first bitmap is '%s', should be '%s'.",
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 142 TOC_BITMAP1, toc->bitmap1_name);
130c6b98984a05 fs/partitions/ldm.c Richard Knutsson 2006-09-30 143 return false;
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 144 }
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 145 strncpy (toc->bitmap2_name, data + 0x46, sizeof (toc->bitmap2_name));
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 146 toc->bitmap2_name[sizeof (toc->bitmap2_name) - 1] = 0;
b7bbf8fa6ba329 fs/partitions/ldm.c Harvey Harrison 2008-07-25 147 toc->bitmap2_start = get_unaligned_be64(data + 0x50);
b7bbf8fa6ba329 fs/partitions/ldm.c Harvey Harrison 2008-07-25 148 toc->bitmap2_size = get_unaligned_be64(data + 0x58);
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 149 if (strncmp (toc->bitmap2_name, TOC_BITMAP2,
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 150 sizeof (toc->bitmap2_name)) != 0) {
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 151 ldm_crit ("TOCBLOCK's second bitmap is '%s', should be '%s'.",
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 152 TOC_BITMAP2, toc->bitmap2_name);
130c6b98984a05 fs/partitions/ldm.c Richard Knutsson 2006-09-30 153 return false;
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 154 }
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 155 ldm_debug ("Parsed TOCBLOCK successfully.");
130c6b98984a05 fs/partitions/ldm.c Richard Knutsson 2006-09-30 156 return true;
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 157 }
^1da177e4c3f41 fs/partitions/ldm.c Linus Torvalds 2005-04-16 158
:::::: The code at line 134 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH net-next 5/9] net: constify netdev->dev_addr
by kernel test robot
Hi Jakub,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/net-constify-netd...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 75082e7f46809432131749f4ecea66864d0f7438
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/ea5373ba01c0915c0dceb67e2df2b0534...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jakub-Kicinski/net-constify-netdev-dev_addr/20211118-121649
git checkout ea5373ba01c0915c0dceb67e2df2b05343642b84
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/net/ethernet/smsc/smc9194.c: In function 'smc_probe':
>> drivers/net/ethernet/smsc/smc9194.c:927:39: error: assignment of read-only location '*(dev->dev_addr + ((sizetype)i + 1))'
927 | dev->dev_addr[ i + 1] = address >> 8;
| ^
drivers/net/ethernet/smsc/smc9194.c:928:36: error: assignment of read-only location '*(dev->dev_addr + (sizetype)i)'
928 | dev->dev_addr[ i ] = address & 0xFF;
| ^
vim +927 drivers/net/ethernet/smsc/smc9194.c
32670c36d0222e drivers/net/smc9194.c Stephen Hemminger 2009-03-26 815
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 816 /*----------------------------------------------------------------------
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 817 . Function: smc_probe( int ioaddr )
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 818 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 819 . Purpose:
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 820 . Tests to see if a given ioaddr points to an SMC9xxx chip.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 821 . Returns a 0 on success
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 822 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 823 . Algorithm:
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 824 . (1) see if the high byte of BANK_SELECT is 0x33
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 825 . (2) compare the ioaddr with the base register's address
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 826 . (3) see if I recognize the chip ID in the appropriate register
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 827 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 828 .---------------------------------------------------------------------
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 829 */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 830
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 831 /*---------------------------------------------------------------
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 832 . Here I do typical initialization tasks.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 833 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 834 . o Initialize the structure if needed
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 835 . o print out my vanity message if not done so already
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 836 . o print out what type of hardware is detected
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 837 . o print out the ethernet address
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 838 . o find the IRQ
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 839 . o set up my private data
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 840 . o configure the dev structure with my subroutines
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 841 . o actually GRAB the irq.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 842 . o GRAB the region
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 843 .-----------------------------------------------------------------
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 844 */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 845 static int __init smc_probe(struct net_device *dev, int ioaddr)
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 846 {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 847 int i, memory, retval;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 848 unsigned int bank;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 849
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 850 const char *version_string;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 851 const char *if_string;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 852
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 853 /* registers */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 854 word revision_register;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 855 word base_address_register;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 856 word configuration_register;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 857 word memory_info_register;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 858 word memory_cfg_register;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 859
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 860 /* Grab the region so that no one else tries to probe our ioports. */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 861 if (!request_region(ioaddr, SMC_IO_EXTENT, DRV_NAME))
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 862 return -EBUSY;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 863
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 864 dev->irq = irq;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 865 dev->if_port = ifport;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 866
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 867 /* First, see if the high byte is 0x33 */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 868 bank = inw( ioaddr + BANK_SELECT );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 869 if ( (bank & 0xFF00) != 0x3300 ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 870 retval = -ENODEV;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 871 goto err_out;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 872 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 873 /* The above MIGHT indicate a device, but I need to write to further
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 874 test this. */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 875 outw( 0x0, ioaddr + BANK_SELECT );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 876 bank = inw( ioaddr + BANK_SELECT );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 877 if ( (bank & 0xFF00 ) != 0x3300 ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 878 retval = -ENODEV;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 879 goto err_out;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 880 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 881 /* well, we've already written once, so hopefully another time won't
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 882 hurt. This time, I need to switch the bank register to bank 1,
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 883 so I can access the base address register */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 884 SMC_SELECT_BANK(1);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 885 base_address_register = inw( ioaddr + BASE );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 886 if ( ioaddr != ( base_address_register >> 3 & 0x3E0 ) ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 887 printk(CARDNAME ": IOADDR %x doesn't match configuration (%x). "
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 888 "Probably not a SMC chip\n",
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 889 ioaddr, base_address_register >> 3 & 0x3E0 );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 890 /* well, the base address register didn't match. Must not have
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 891 been a SMC chip after all. */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 892 retval = -ENODEV;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 893 goto err_out;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 894 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 895
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 896 /* check if the revision register is something that I recognize.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 897 These might need to be added to later, as future revisions
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 898 could be added. */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 899 SMC_SELECT_BANK(3);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 900 revision_register = inw( ioaddr + REVISION );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 901 if ( !chip_ids[ ( revision_register >> 4 ) & 0xF ] ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 902 /* I don't recognize this chip, so... */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 903 printk(CARDNAME ": IO %x: Unrecognized revision register:"
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 904 " %x, Contact author.\n", ioaddr, revision_register);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 905
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 906 retval = -ENODEV;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 907 goto err_out;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 908 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 909
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 910 /* at this point I'll assume that the chip is an SMC9xxx.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 911 It might be prudent to check a listing of MAC addresses
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 912 against the hardware address, or do some other tests. */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 913
2ad02bdc885db5 drivers/net/ethernet/smsc/smc9194.c Ben Boeckel 2013-11-01 914 pr_info_once("%s\n", version);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 915
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 916 /* fill in some of the fields */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 917 dev->base_addr = ioaddr;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 918
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 919 /*
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 920 . Get the MAC address ( bank 1, regs 4 - 9 )
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 921 */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 922 SMC_SELECT_BANK( 1 );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 923 for ( i = 0; i < 6; i += 2 ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 924 word address;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 925
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 926 address = inw( ioaddr + ADDR0 + i );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 @927 dev->dev_addr[ i + 1] = address >> 8;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 928 dev->dev_addr[ i ] = address & 0xFF;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 929 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 930
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 931 /* get the memory information */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 932
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 933 SMC_SELECT_BANK( 0 );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 934 memory_info_register = inw( ioaddr + MIR );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 935 memory_cfg_register = inw( ioaddr + MCR );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 936 memory = ( memory_cfg_register >> 9 ) & 0x7; /* multiplier */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 937 memory *= 256 * ( memory_info_register & 0xFF );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 938
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 939 /*
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 940 Now, I want to find out more about the chip. This is sort of
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 941 redundant, but it's cleaner to have it in both, rather than having
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 942 one VERY long probe procedure.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 943 */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 944 SMC_SELECT_BANK(3);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 945 revision_register = inw( ioaddr + REVISION );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 946 version_string = chip_ids[ ( revision_register >> 4 ) & 0xF ];
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 947 if ( !version_string ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 948 /* I shouldn't get here because this call was done before.... */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 949 retval = -ENODEV;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 950 goto err_out;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 951 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 952
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 953 /* is it using AUI or 10BaseT ? */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 954 if ( dev->if_port == 0 ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 955 SMC_SELECT_BANK(1);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 956 configuration_register = inw( ioaddr + CONFIG );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 957 if ( configuration_register & CFG_AUI_SELECT )
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 958 dev->if_port = 2;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 959 else
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 960 dev->if_port = 1;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 961 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 962 if_string = interfaces[ dev->if_port - 1 ];
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 963
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 964 /* now, reset the chip, and put it into a known state */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 965 smc_reset( ioaddr );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 966
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 967 /*
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 968 . If dev->irq is 0, then the device has to be banged on to see
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 969 . what the IRQ is.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 970 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 971 . This banging doesn't always detect the IRQ, for unknown reasons.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 972 . a workaround is to reset the chip and try again.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 973 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 974 . Interestingly, the DOS packet driver *SETS* the IRQ on the card to
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 975 . be what is requested on the command line. I don't do that, mostly
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 976 . because the card that I have uses a non-standard method of accessing
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 977 . the IRQs, and because this _should_ work in most configurations.
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 978 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 979 . Specifying an IRQ is done with the assumption that the user knows
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 980 . what (s)he is doing. No checking is done!!!!
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 981 .
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 982 */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 983 if ( dev->irq < 2 ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 984 int trials;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 985
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 986 trials = 3;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 987 while ( trials-- ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 988 dev->irq = smc_findirq( ioaddr );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 989 if ( dev->irq )
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 990 break;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 991 /* kick the card and try again */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 992 smc_reset( ioaddr );
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 993 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 994 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 995 if (dev->irq == 0 ) {
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 996 printk(CARDNAME": Couldn't autodetect your IRQ. Use irq=xx.\n");
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 997 retval = -ENODEV;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 998 goto err_out;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 999 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1000
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1001 /* now, print out the card info, in a short format.. */
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1002
2ad02bdc885db5 drivers/net/ethernet/smsc/smc9194.c Ben Boeckel 2013-11-01 1003 netdev_info(dev, "%s(r:%d) at %#3x IRQ:%d INTF:%s MEM:%db ",
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1004 version_string, revision_register & 0xF, ioaddr, dev->irq,
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1005 if_string, memory);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1006 /*
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1007 . Print the Ethernet address
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1008 */
2ad02bdc885db5 drivers/net/ethernet/smsc/smc9194.c Ben Boeckel 2013-11-01 1009 netdev_info(dev, "ADDR: %pM\n", dev->dev_addr);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1010
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1011 /* Grab the IRQ */
a0607fd3a25ba1 drivers/net/smc9194.c Joe Perches 2009-11-18 1012 retval = request_irq(dev->irq, smc_interrupt, 0, DRV_NAME, dev);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1013 if (retval) {
2ad02bdc885db5 drivers/net/ethernet/smsc/smc9194.c Ben Boeckel 2013-11-01 1014 netdev_warn(dev, "%s: unable to get IRQ %d (irqval=%d).\n",
2ad02bdc885db5 drivers/net/ethernet/smsc/smc9194.c Ben Boeckel 2013-11-01 1015 DRV_NAME, dev->irq, retval);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1016 goto err_out;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1017 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1018
32670c36d0222e drivers/net/smc9194.c Stephen Hemminger 2009-03-26 1019 dev->netdev_ops = &smc_netdev_ops;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1020 dev->watchdog_timeo = HZ/20;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1021
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1022 return 0;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1023
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1024 err_out:
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1025 release_region(ioaddr, SMC_IO_EXTENT);
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1026 return retval;
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1027 }
^1da177e4c3f41 drivers/net/smc9194.c Linus Torvalds 2005-04-16 1028
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH] sched/idle: support busy loop polling on idle SMT cpus
by kernel test robot
Hi Peng,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/sched/core]
[also build test ERROR on tip/master linux/master linus/master v5.16-rc1 next-20211118]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Peng-Wang/sched-idle-support-bus...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 8ea9183db4ad8afbcb7089a77c23eaf965b0cacd
config: sparc-randconfig-p001-20211118 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/11c6a63e5c0f496b43058351f1e2a488e...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Peng-Wang/sched-idle-support-busy-loop-polling-on-idle-SMT-cpus/20211116-195600
git checkout 11c6a63e5c0f496b43058351f1e2a488ee27a5ec
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sparc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/list.h:9,
from include/linux/rculist.h:10,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from kernel/sched/sched.h:5,
from kernel/sched/idle.c:9:
kernel/sched/idle.c: In function 'smt_idle_poll_switch':
>> kernel/sched/idle.c:73:27: error: implicit declaration of function 'task_css_check' [-Werror=implicit-function-declaration]
73 | tg = container_of(task_css_check(current, cpu_cgrp_id, true),
| ^~~~~~~~~~~~~~
include/linux/kernel.h:494:33: note: in definition of macro 'container_of'
494 | void *__mptr = (void *)(ptr); \
| ^~~
kernel/sched/idle.c:73:51: error: 'cpu_cgrp_id' undeclared (first use in this function); did you mean 'mem_cgroup_id'?
73 | tg = container_of(task_css_check(current, cpu_cgrp_id, true),
| ^~~~~~~~~~~
include/linux/kernel.h:494:33: note: in definition of macro 'container_of'
494 | void *__mptr = (void *)(ptr); \
| ^~~
kernel/sched/idle.c:73:51: note: each undeclared identifier is reported only once for each function it appears in
73 | tg = container_of(task_css_check(current, cpu_cgrp_id, true),
| ^~~~~~~~~~~
include/linux/kernel.h:494:33: note: in definition of macro 'container_of'
494 | void *__mptr = (void *)(ptr); \
| ^~~
In file included from <command-line>:
include/linux/kernel.h:495:58: error: invalid use of undefined type 'struct task_group'
495 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~
include/linux/compiler_types.h:302:23: note: in definition of macro '__compiletime_assert'
302 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:322:9: note: in expansion of macro '_compiletime_assert'
322 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:495:9: note: in expansion of macro 'BUILD_BUG_ON_MSG'
495 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~~~~~~~~~~~~~~~
include/linux/kernel.h:495:27: note: in expansion of macro '__same_type'
495 | BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
| ^~~~~~~~~~~
kernel/sched/idle.c:73:14: note: in expansion of macro 'container_of'
73 | tg = container_of(task_css_check(current, cpu_cgrp_id, true),
| ^~~~~~~~~~~~
include/linux/compiler_types.h:140:41: error: invalid use of undefined type 'struct task_group'
140 | #define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
| ^~~~~~~~~~~~~~~~~~
include/linux/stddef.h:17:33: note: in expansion of macro '__compiler_offsetof'
17 | #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
| ^~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:498:28: note: in expansion of macro 'offsetof'
498 | ((type *)(__mptr - offsetof(type, member))); })
| ^~~~~~~~
kernel/sched/idle.c:73:14: note: in expansion of macro 'container_of'
73 | tg = container_of(task_css_check(current, cpu_cgrp_id, true),
| ^~~~~~~~~~~~
kernel/sched/idle.c:75:36: error: invalid use of undefined type 'struct task_group'
75 | rq->need_smt_idle_poll = tg->need_smt_idle_poll;
| ^~
cc1: some warnings being treated as errors
vim +/task_css_check +73 kernel/sched/idle.c
57
58 void smt_idle_poll_switch(struct rq *rq)
59 {
60 struct rq *smt_rq;
61 struct task_group *tg;
62 int smt, cpu;
63
64 if (!static_branch_unlikely(&__smt_idle_poll_enabled))
65 return;
66
67 if (rq->idle == current) {
68 rq->need_smt_idle_poll = false;
69 return;
70 }
71
72 rcu_read_lock();
> 73 tg = container_of(task_css_check(current, cpu_cgrp_id, true),
74 struct task_group, css);
75 rq->need_smt_idle_poll = tg->need_smt_idle_poll;
76 rcu_read_unlock();
77
78 if (!rq->need_smt_idle_poll)
79 return;
80
81 cpu = rq->cpu;
82 for_each_cpu(smt, cpu_smt_mask(cpu)) {
83 if (cpu == smt || !cpu_online(smt))
84 continue;
85 smt_rq = cpu_rq(smt);
86 if (smt_rq->idle == smt_rq->curr && !smt_rq->in_smt_idle_poll)
87 smp_send_reschedule(smt);
88 }
89 }
90
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[mcgrof-next:20211116-sysctl-cleanups-v4 19/35] include/linux/sysctl.h:229:13: error: expected ';' after return statement
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211116-sysctl-cleanups-v4
head: 5347239461f25fc50aa761923245b9ec4a4aafec
commit: 80084262576dad57737fa04b203e1547ff7ad538 [19/35] sysctl: add helper to register a sysctl mount point
config: arm-randconfig-c002-20211118 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c46becf500df2a7fb4b4fce16178a036c344315a)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/com...
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20211116-sysctl-cleanups-v4
git checkout 80084262576dad57737fa04b203e1547ff7ad538
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm prepare
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
error: no override and no default toolchain set
init/Kconfig:70:warning: 'RUSTC_VERSION': number is invalid
In file included from arch/arm/kernel/asm-offsets.c:12:
In file included from include/linux/mm.h:717:
In file included from include/linux/huge_mm.h:8:
In file included from include/linux/fs.h:33:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:10:
In file included from include/linux/cred.h:13:
In file included from include/linux/key.h:17:
>> include/linux/sysctl.h:229:13: error: expected ';' after return statement
return NULL
^
;
1 error generated.
make[2]: *** [scripts/Makefile.build:122: arch/arm/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1279: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +229 include/linux/sysctl.h
226
227 static struct sysctl_header *register_sysctl_mount_point(const char *path)
228 {
> 229 return NULL
230 }
231
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[kbuild] [chrome-os:chromeos-5.4 13/15] drivers/gpu/drm/bridge/analogix/anx7625.c:1055 sp_tx_edid_read() warn: impossible condition '(g_edid_break < 0) => (0-255 < 0)'
by Dan Carpenter
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: 7fd7be5eec16d4ccd80534ee0ac446d947e5651a
commit: 331b74951ecc80a07a2eee8b8b68b4c5512276f0 [13/15] FROMLIST: drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read()
config: i386-randconfig-m021-20211117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/gpu/drm/bridge/analogix/anx7625.c:1055 sp_tx_edid_read() warn: impossible condition '(g_edid_break < 0) => (0-255 < 0)'
vim +1055 drivers/gpu/drm/bridge/analogix/anx7625.c
23d8ba8ff5d368 Xin Ji 2020-09-18 1017 static int sp_tx_edid_read(struct anx7625_data *ctx,
23d8ba8ff5d368 Xin Ji 2020-09-18 1018 u8 *pedid_blocks_buf)
23d8ba8ff5d368 Xin Ji 2020-09-18 1019 {
23d8ba8ff5d368 Xin Ji 2020-09-18 1020 u8 offset, edid_pos;
23d8ba8ff5d368 Xin Ji 2020-09-18 1021 int count, blocks_num;
23d8ba8ff5d368 Xin Ji 2020-09-18 1022 u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
23d8ba8ff5d368 Xin Ji 2020-09-18 1023 u8 i, j;
23d8ba8ff5d368 Xin Ji 2020-09-18 1024 u8 g_edid_break = 0;
^^^^^^^^^^^^^^^
23d8ba8ff5d368 Xin Ji 2020-09-18 1025 int ret;
23d8ba8ff5d368 Xin Ji 2020-09-18 1026 struct device *dev = &ctx->client->dev;
23d8ba8ff5d368 Xin Ji 2020-09-18 1027
23d8ba8ff5d368 Xin Ji 2020-09-18 1028 /* Address initial */
23d8ba8ff5d368 Xin Ji 2020-09-18 1029 ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
23d8ba8ff5d368 Xin Ji 2020-09-18 1030 AP_AUX_ADDR_7_0, 0x50);
23d8ba8ff5d368 Xin Ji 2020-09-18 1031 ret |= anx7625_reg_write(ctx, ctx->i2c.rx_p0_client,
23d8ba8ff5d368 Xin Ji 2020-09-18 1032 AP_AUX_ADDR_15_8, 0);
23d8ba8ff5d368 Xin Ji 2020-09-18 1033 ret |= anx7625_write_and(ctx, ctx->i2c.rx_p0_client,
23d8ba8ff5d368 Xin Ji 2020-09-18 1034 AP_AUX_ADDR_19_16, 0xf0);
23d8ba8ff5d368 Xin Ji 2020-09-18 1035 if (ret < 0) {
23d8ba8ff5d368 Xin Ji 2020-09-18 1036 DRM_DEV_ERROR(dev, "access aux channel IO error.\n");
23d8ba8ff5d368 Xin Ji 2020-09-18 1037 return -EIO;
23d8ba8ff5d368 Xin Ji 2020-09-18 1038 }
23d8ba8ff5d368 Xin Ji 2020-09-18 1039
23d8ba8ff5d368 Xin Ji 2020-09-18 1040 blocks_num = sp_tx_get_edid_block(ctx);
23d8ba8ff5d368 Xin Ji 2020-09-18 1041 if (blocks_num < 0)
23d8ba8ff5d368 Xin Ji 2020-09-18 1042 return blocks_num;
23d8ba8ff5d368 Xin Ji 2020-09-18 1043
23d8ba8ff5d368 Xin Ji 2020-09-18 1044 count = 0;
23d8ba8ff5d368 Xin Ji 2020-09-18 1045
23d8ba8ff5d368 Xin Ji 2020-09-18 1046 do {
23d8ba8ff5d368 Xin Ji 2020-09-18 1047 switch (count) {
23d8ba8ff5d368 Xin Ji 2020-09-18 1048 case 0:
23d8ba8ff5d368 Xin Ji 2020-09-18 1049 case 1:
23d8ba8ff5d368 Xin Ji 2020-09-18 1050 for (i = 0; i < 8; i++) {
23d8ba8ff5d368 Xin Ji 2020-09-18 1051 offset = (i + count * 8) * MAX_DPCD_BUFFER_SIZE;
23d8ba8ff5d368 Xin Ji 2020-09-18 1052 g_edid_break = edid_read(ctx, offset,
23d8ba8ff5d368 Xin Ji 2020-09-18 1053 pblock_buf);
23d8ba8ff5d368 Xin Ji 2020-09-18 1054
331b74951ecc80 Hsin-Yi Wang 2021-11-12 @1055 if (g_edid_break < 0)
^^^^^^^^^^^^^^^^
u8 can't be negative.
23d8ba8ff5d368 Xin Ji 2020-09-18 1056 break;
23d8ba8ff5d368 Xin Ji 2020-09-18 1057
23d8ba8ff5d368 Xin Ji 2020-09-18 1058 memcpy(&pedid_blocks_buf[offset],
23d8ba8ff5d368 Xin Ji 2020-09-18 1059 pblock_buf,
23d8ba8ff5d368 Xin Ji 2020-09-18 1060 MAX_DPCD_BUFFER_SIZE);
23d8ba8ff5d368 Xin Ji 2020-09-18 1061 }
23d8ba8ff5d368 Xin Ji 2020-09-18 1062
23d8ba8ff5d368 Xin Ji 2020-09-18 1063 break;
23d8ba8ff5d368 Xin Ji 2020-09-18 1064 case 2:
23d8ba8ff5d368 Xin Ji 2020-09-18 1065 offset = 0x00;
23d8ba8ff5d368 Xin Ji 2020-09-18 1066
23d8ba8ff5d368 Xin Ji 2020-09-18 1067 for (j = 0; j < 8; j++) {
23d8ba8ff5d368 Xin Ji 2020-09-18 1068 edid_pos = (j + count * 8) *
23d8ba8ff5d368 Xin Ji 2020-09-18 1069 MAX_DPCD_BUFFER_SIZE;
23d8ba8ff5d368 Xin Ji 2020-09-18 1070
23d8ba8ff5d368 Xin Ji 2020-09-18 1071 if (g_edid_break == 1)
23d8ba8ff5d368 Xin Ji 2020-09-18 1072 break;
23d8ba8ff5d368 Xin Ji 2020-09-18 1073
23d8ba8ff5d368 Xin Ji 2020-09-18 1074 segments_edid_read(ctx, count / 2,
23d8ba8ff5d368 Xin Ji 2020-09-18 1075 pblock_buf, offset);
23d8ba8ff5d368 Xin Ji 2020-09-18 1076 memcpy(&pedid_blocks_buf[edid_pos],
23d8ba8ff5d368 Xin Ji 2020-09-18 1077 pblock_buf,
23d8ba8ff5d368 Xin Ji 2020-09-18 1078 MAX_DPCD_BUFFER_SIZE);
23d8ba8ff5d368 Xin Ji 2020-09-18 1079 offset = offset + 0x10;
23d8ba8ff5d368 Xin Ji 2020-09-18 1080 }
23d8ba8ff5d368 Xin Ji 2020-09-18 1081
23d8ba8ff5d368 Xin Ji 2020-09-18 1082 break;
23d8ba8ff5d368 Xin Ji 2020-09-18 1083 case 3:
23d8ba8ff5d368 Xin Ji 2020-09-18 1084 offset = 0x80;
23d8ba8ff5d368 Xin Ji 2020-09-18 1085
23d8ba8ff5d368 Xin Ji 2020-09-18 1086 for (j = 0; j < 8; j++) {
23d8ba8ff5d368 Xin Ji 2020-09-18 1087 edid_pos = (j + count * 8) *
23d8ba8ff5d368 Xin Ji 2020-09-18 1088 MAX_DPCD_BUFFER_SIZE;
23d8ba8ff5d368 Xin Ji 2020-09-18 1089 if (g_edid_break == 1)
23d8ba8ff5d368 Xin Ji 2020-09-18 1090 break;
23d8ba8ff5d368 Xin Ji 2020-09-18 1091
23d8ba8ff5d368 Xin Ji 2020-09-18 1092 segments_edid_read(ctx, count / 2,
23d8ba8ff5d368 Xin Ji 2020-09-18 1093 pblock_buf, offset);
23d8ba8ff5d368 Xin Ji 2020-09-18 1094 memcpy(&pedid_blocks_buf[edid_pos],
23d8ba8ff5d368 Xin Ji 2020-09-18 1095 pblock_buf,
23d8ba8ff5d368 Xin Ji 2020-09-18 1096 MAX_DPCD_BUFFER_SIZE);
23d8ba8ff5d368 Xin Ji 2020-09-18 1097 offset = offset + 0x10;
23d8ba8ff5d368 Xin Ji 2020-09-18 1098 }
23d8ba8ff5d368 Xin Ji 2020-09-18 1099
23d8ba8ff5d368 Xin Ji 2020-09-18 1100 break;
23d8ba8ff5d368 Xin Ji 2020-09-18 1101 default:
23d8ba8ff5d368 Xin Ji 2020-09-18 1102 break;
23d8ba8ff5d368 Xin Ji 2020-09-18 1103 }
23d8ba8ff5d368 Xin Ji 2020-09-18 1104
23d8ba8ff5d368 Xin Ji 2020-09-18 1105 count++;
23d8ba8ff5d368 Xin Ji 2020-09-18 1106
23d8ba8ff5d368 Xin Ji 2020-09-18 1107 } while (blocks_num >= count);
23d8ba8ff5d368 Xin Ji 2020-09-18 1108
23d8ba8ff5d368 Xin Ji 2020-09-18 1109 /* Check edid data */
23d8ba8ff5d368 Xin Ji 2020-09-18 1110 if (!drm_edid_is_valid((struct edid *)pedid_blocks_buf)) {
23d8ba8ff5d368 Xin Ji 2020-09-18 1111 DRM_DEV_ERROR(dev, "WARNING! edid check fail!\n");
23d8ba8ff5d368 Xin Ji 2020-09-18 1112 return -EINVAL;
23d8ba8ff5d368 Xin Ji 2020-09-18 1113 }
23d8ba8ff5d368 Xin Ji 2020-09-18 1114
23d8ba8ff5d368 Xin Ji 2020-09-18 1115 /* Reset aux channel */
c078b992821d86 Linux Patches Robot 2021-11-05 1116 ret = sp_tx_rst_aux(ctx);
c078b992821d86 Linux Patches Robot 2021-11-05 1117 if (ret < 0) {
c078b992821d86 Linux Patches Robot 2021-11-05 1118 DRM_DEV_ERROR(dev, "Failed to reset aux channel!\n");
c078b992821d86 Linux Patches Robot 2021-11-05 1119 return ret;
c078b992821d86 Linux Patches Robot 2021-11-05 1120 }
23d8ba8ff5d368 Xin Ji 2020-09-18 1121
23d8ba8ff5d368 Xin Ji 2020-09-18 1122 return (blocks_num + 1);
23d8ba8ff5d368 Xin Ji 2020-09-18 1123 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
10 months
[linux-next:master 1655/2290] drivers/net/ethernet/broadcom/bnxt/bnxt.c:12343:44: warning: shift count >= width of type
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 5191249f880367a4cd675825cd721a8d78f26a45
commit: 4721031c3559db8eae61df305f10c00099a7c1d0 [1655/2290] net: move gro definitions to include/net/gro.h
config: riscv-randconfig-r034-20211118 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c46becf500df2a7fb4b4fce16178a036c344315a)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
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 4721031c3559db8eae61df305f10c00099a7c1d0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/net/ethernet/broadcom/bnxt/bnxt.c:40:
include/net/gro.h:413:22: error: implicit declaration of function 'csum_ipv6_magic' [-Werror,-Wimplicit-function-declaration]
return ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr,
^
include/net/gro.h:413:22: note: did you mean 'csum_tcpudp_magic'?
include/asm-generic/checksum.h:52:1: note: 'csum_tcpudp_magic' declared here
csum_tcpudp_magic(__be32 saddr, __be32 daddr, __u32 len,
^
In file included from drivers/net/ethernet/broadcom/bnxt/bnxt.c:45:
include/net/ip6_checksum.h:34:9: error: conflicting types for 'csum_ipv6_magic'
__sum16 csum_ipv6_magic(const struct in6_addr *saddr,
^
include/net/gro.h:413:22: note: previous implicit declaration is here
return ~csum_unfold(csum_ipv6_magic(&iph->saddr, &iph->daddr,
^
>> drivers/net/ethernet/broadcom/bnxt/bnxt.c:12343:44: warning: shift count >= width of type [-Wshift-count-overflow]
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) != 0 &&
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
1 warning and 2 errors generated.
vim +12343 drivers/net/ethernet/broadcom/bnxt/bnxt.c
230d1f0de754b4 Michael Chan 2019-08-29 12315
c0c050c58d8409 Michael Chan 2015-10-22 12316 static int bnxt_init_board(struct pci_dev *pdev, struct net_device *dev)
c0c050c58d8409 Michael Chan 2015-10-22 12317 {
c0c050c58d8409 Michael Chan 2015-10-22 12318 int rc;
c0c050c58d8409 Michael Chan 2015-10-22 12319 struct bnxt *bp = netdev_priv(dev);
c0c050c58d8409 Michael Chan 2015-10-22 12320
c0c050c58d8409 Michael Chan 2015-10-22 12321 SET_NETDEV_DEV(dev, &pdev->dev);
c0c050c58d8409 Michael Chan 2015-10-22 12322
c0c050c58d8409 Michael Chan 2015-10-22 12323 /* enable device (incl. PCI PM wakeup), and bus-mastering */
c0c050c58d8409 Michael Chan 2015-10-22 12324 rc = pci_enable_device(pdev);
c0c050c58d8409 Michael Chan 2015-10-22 12325 if (rc) {
c0c050c58d8409 Michael Chan 2015-10-22 12326 dev_err(&pdev->dev, "Cannot enable PCI device, aborting\n");
c0c050c58d8409 Michael Chan 2015-10-22 12327 goto init_err;
c0c050c58d8409 Michael Chan 2015-10-22 12328 }
c0c050c58d8409 Michael Chan 2015-10-22 12329
c0c050c58d8409 Michael Chan 2015-10-22 12330 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
c0c050c58d8409 Michael Chan 2015-10-22 12331 dev_err(&pdev->dev,
c0c050c58d8409 Michael Chan 2015-10-22 12332 "Cannot find PCI device base address, aborting\n");
c0c050c58d8409 Michael Chan 2015-10-22 12333 rc = -ENODEV;
c0c050c58d8409 Michael Chan 2015-10-22 12334 goto init_err_disable;
c0c050c58d8409 Michael Chan 2015-10-22 12335 }
c0c050c58d8409 Michael Chan 2015-10-22 12336
c0c050c58d8409 Michael Chan 2015-10-22 12337 rc = pci_request_regions(pdev, DRV_MODULE_NAME);
c0c050c58d8409 Michael Chan 2015-10-22 12338 if (rc) {
c0c050c58d8409 Michael Chan 2015-10-22 12339 dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting\n");
c0c050c58d8409 Michael Chan 2015-10-22 12340 goto init_err_disable;
c0c050c58d8409 Michael Chan 2015-10-22 12341 }
c0c050c58d8409 Michael Chan 2015-10-22 12342
c0c050c58d8409 Michael Chan 2015-10-22 @12343 if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) != 0 &&
c0c050c58d8409 Michael Chan 2015-10-22 12344 dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) != 0) {
c0c050c58d8409 Michael Chan 2015-10-22 12345 dev_err(&pdev->dev, "System does not support DMA, aborting\n");
3383176efc0fb0 Zhang Changzhong 2020-11-19 12346 rc = -EIO;
c54bc3ced51066 Michael Chan 2020-11-20 12347 goto init_err_release;
c0c050c58d8409 Michael Chan 2015-10-22 12348 }
c0c050c58d8409 Michael Chan 2015-10-22 12349
c0c050c58d8409 Michael Chan 2015-10-22 12350 pci_set_master(pdev);
c0c050c58d8409 Michael Chan 2015-10-22 12351
c0c050c58d8409 Michael Chan 2015-10-22 12352 bp->dev = dev;
c0c050c58d8409 Michael Chan 2015-10-22 12353 bp->pdev = pdev;
c0c050c58d8409 Michael Chan 2015-10-22 12354
8ae2473842bdbb Michael Chan 2020-05-04 12355 /* Doorbell BAR bp->bar1 is mapped after bnxt_fw_init_one_p2()
8ae2473842bdbb Michael Chan 2020-05-04 12356 * determines the BAR size.
8ae2473842bdbb Michael Chan 2020-05-04 12357 */
c0c050c58d8409 Michael Chan 2015-10-22 12358 bp->bar0 = pci_ioremap_bar(pdev, 0);
c0c050c58d8409 Michael Chan 2015-10-22 12359 if (!bp->bar0) {
c0c050c58d8409 Michael Chan 2015-10-22 12360 dev_err(&pdev->dev, "Cannot map device registers, aborting\n");
c0c050c58d8409 Michael Chan 2015-10-22 12361 rc = -ENOMEM;
c0c050c58d8409 Michael Chan 2015-10-22 12362 goto init_err_release;
c0c050c58d8409 Michael Chan 2015-10-22 12363 }
c0c050c58d8409 Michael Chan 2015-10-22 12364
c0c050c58d8409 Michael Chan 2015-10-22 12365 bp->bar2 = pci_ioremap_bar(pdev, 4);
c0c050c58d8409 Michael Chan 2015-10-22 12366 if (!bp->bar2) {
c0c050c58d8409 Michael Chan 2015-10-22 12367 dev_err(&pdev->dev, "Cannot map bar4 registers, aborting\n");
c0c050c58d8409 Michael Chan 2015-10-22 12368 rc = -ENOMEM;
c0c050c58d8409 Michael Chan 2015-10-22 12369 goto init_err_release;
c0c050c58d8409 Michael Chan 2015-10-22 12370 }
c0c050c58d8409 Michael Chan 2015-10-22 12371
6316ea6db93d87 Satish Baddipadige 2016-03-07 12372 pci_enable_pcie_error_reporting(pdev);
6316ea6db93d87 Satish Baddipadige 2016-03-07 12373
c0c050c58d8409 Michael Chan 2015-10-22 12374 INIT_WORK(&bp->sp_task, bnxt_sp_task);
230d1f0de754b4 Michael Chan 2019-08-29 12375 INIT_DELAYED_WORK(&bp->fw_reset_task, bnxt_fw_reset_task);
c0c050c58d8409 Michael Chan 2015-10-22 12376
c0c050c58d8409 Michael Chan 2015-10-22 12377 spin_lock_init(&bp->ntp_fltr_lock);
697197e5a17353 Michael Chan 2018-10-14 12378 #if BITS_PER_LONG == 32
697197e5a17353 Michael Chan 2018-10-14 12379 spin_lock_init(&bp->db_lock);
697197e5a17353 Michael Chan 2018-10-14 12380 #endif
c0c050c58d8409 Michael Chan 2015-10-22 12381
c0c050c58d8409 Michael Chan 2015-10-22 12382 bp->rx_ring_size = BNXT_DEFAULT_RX_RING_SIZE;
c0c050c58d8409 Michael Chan 2015-10-22 12383 bp->tx_ring_size = BNXT_DEFAULT_TX_RING_SIZE;
c0c050c58d8409 Michael Chan 2015-10-22 12384
18775aa8a91fcd Michael Chan 2017-10-26 12385 bnxt_init_dflt_coal(bp);
51f307856b60e6 Michael Chan 2016-07-01 12386
e99e88a9d2b067 Kees Cook 2017-10-16 12387 timer_setup(&bp->timer, bnxt_timer, 0);
c0c050c58d8409 Michael Chan 2015-10-22 12388 bp->current_interval = BNXT_TIMER_INTERVAL;
c0c050c58d8409 Michael Chan 2015-10-22 12389
442a35a5a7aa72 Jakub Kicinski 2020-07-09 12390 bp->vxlan_fw_dst_port_id = INVALID_HW_RING_ID;
442a35a5a7aa72 Jakub Kicinski 2020-07-09 12391 bp->nge_fw_dst_port_id = INVALID_HW_RING_ID;
442a35a5a7aa72 Jakub Kicinski 2020-07-09 12392
caefe526d7b5af Michael Chan 2015-12-09 12393 clear_bit(BNXT_STATE_OPEN, &bp->state);
c0c050c58d8409 Michael Chan 2015-10-22 12394 return 0;
c0c050c58d8409 Michael Chan 2015-10-22 12395
c0c050c58d8409 Michael Chan 2015-10-22 12396 init_err_release:
17086399c113d9 Sathya Perla 2017-02-20 12397 bnxt_unmap_bars(bp, pdev);
c0c050c58d8409 Michael Chan 2015-10-22 12398 pci_release_regions(pdev);
c0c050c58d8409 Michael Chan 2015-10-22 12399
c0c050c58d8409 Michael Chan 2015-10-22 12400 init_err_disable:
c0c050c58d8409 Michael Chan 2015-10-22 12401 pci_disable_device(pdev);
c0c050c58d8409 Michael Chan 2015-10-22 12402
c0c050c58d8409 Michael Chan 2015-10-22 12403 init_err:
c0c050c58d8409 Michael Chan 2015-10-22 12404 return rc;
c0c050c58d8409 Michael Chan 2015-10-22 12405 }
c0c050c58d8409 Michael Chan 2015-10-22 12406
:::::: The code at line 12343 was first introduced by commit
:::::: c0c050c58d840994ba842ad1c338a98e7c12b764 bnxt_en: New Broadcom ethernet driver.
:::::: TO: Michael Chan <mchan(a)broadcom.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
Re: [PATCH net-next 5/9] net: constify netdev->dev_addr
by kernel test robot
Hi Jakub,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Jakub-Kicinski/net-constify-netd...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 75082e7f46809432131749f4ecea66864d0f7438
config: m68k-defconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.0
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
# https://github.com/0day-ci/linux/commit/ea5373ba01c0915c0dceb67e2df2b0534...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jakub-Kicinski/net-constify-netdev-dev_addr/20211118-121649
git checkout ea5373ba01c0915c0dceb67e2df2b05343642b84
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/net/ethernet/8390/mac8390.c: In function 'mac8390_rsrc_init':
>> drivers/net/ethernet/8390/mac8390.c:317:31: warning: passing argument 1 of 'nubus_get_rsrc_mem' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
317 | nubus_get_rsrc_mem(dev->dev_addr, &ent, 6);
| ~~~^~~~~~~~~~
In file included from drivers/net/ethernet/8390/mac8390.c:29:
include/linux/nubus.h:156:31: note: expected 'void *' but argument is of type 'const unsigned char *'
156 | void nubus_get_rsrc_mem(void *dest, const struct nubus_dirent *dirent,
| ~~~~~~^~~~
--
drivers/net/ethernet/amd/atarilance.c:370:28: warning: no previous prototype for 'atarilance_probe' [-Wmissing-prototypes]
370 | struct net_device * __init atarilance_probe(void)
| ^~~~~~~~~~~~~~~~
drivers/net/ethernet/amd/atarilance.c: In function 'lance_probe1':
>> drivers/net/ethernet/amd/atarilance.c:588:33: warning: passing argument 1 of 'lp->memcpy_f' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
588 | lp->memcpy_f(dev->dev_addr, RIEBL_HWADDR_ADDR, ETH_ALEN);
| ~~~^~~~~~~~~~
drivers/net/ethernet/amd/atarilance.c:588:33: note: expected 'void *' but argument is of type 'const unsigned char *'
drivers/net/ethernet/amd/atarilance.c:593:42: error: assignment of read-only location '*(dev->dev_addr + (sizetype)i)'
593 | dev->dev_addr[i] =
| ^
--
drivers/net/ethernet/apple/macmace.c: In function 'mace_probe':
drivers/net/ethernet/apple/macmace.c:232:34: error: assignment of read-only location '*(dev->dev_addr + (sizetype)j)'
232 | dev->dev_addr[j] = v;
| ^
drivers/net/ethernet/apple/macmace.c: In function 'mace_reset':
>> drivers/net/ethernet/apple/macmace.c:294:36: warning: passing argument 2 of '__mace_set_address' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
294 | __mace_set_address(dev, dev->dev_addr);
| ~~~^~~~~~~~~~
drivers/net/ethernet/apple/macmace.c:95:62: note: expected 'void *' but argument is of type 'const unsigned char *'
95 | static void __mace_set_address(struct net_device *dev, void *addr);
| ~~~~~~^~~~
drivers/net/ethernet/apple/macmace.c: In function '__mace_set_address':
drivers/net/ethernet/apple/macmace.c:334:45: error: assignment of read-only location '*(dev->dev_addr + (sizetype)i)'
334 | mb->padr = dev->dev_addr[i] = p[i];
| ^
--
drivers/net/ethernet/natsemi/macsonic.c: In function 'mac_onboard_sonic_ethernet_addr':
drivers/net/ethernet/natsemi/macsonic.c:216:42: error: assignment of read-only location '*(dev->dev_addr + (sizetype)i)'
216 | dev->dev_addr[i] = SONIC_READ_PROM(i);
| ^
>> drivers/net/ethernet/natsemi/macsonic.c:225:37: warning: passing argument 1 of 'bit_reverse_addr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
225 | bit_reverse_addr(dev->dev_addr);
| ~~~^~~~~~~~~~
drivers/net/ethernet/natsemi/macsonic.c:109:51: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
109 | static inline void bit_reverse_addr(unsigned char addr[6])
| ~~~~~~~~~~~~~~^~~~~~~
drivers/net/ethernet/natsemi/macsonic.c:246:26: error: assignment of read-only location '*(dev->dev_addr + 5)'
246 | dev->dev_addr[5] = val >> 8;
| ^
drivers/net/ethernet/natsemi/macsonic.c:247:26: error: assignment of read-only location '*(dev->dev_addr + 4)'
247 | dev->dev_addr[4] = val & 0xff;
| ^
drivers/net/ethernet/natsemi/macsonic.c:249:26: error: assignment of read-only location '*(dev->dev_addr + 3)'
249 | dev->dev_addr[3] = val >> 8;
| ^
drivers/net/ethernet/natsemi/macsonic.c:250:26: error: assignment of read-only location '*(dev->dev_addr + 2)'
250 | dev->dev_addr[2] = val & 0xff;
| ^
drivers/net/ethernet/natsemi/macsonic.c:252:26: error: assignment of read-only location '*(dev->dev_addr + 1)'
252 | dev->dev_addr[1] = val >> 8;
| ^
drivers/net/ethernet/natsemi/macsonic.c:253:26: error: assignment of read-only location '*dev->dev_addr'
253 | dev->dev_addr[0] = val & 0xff;
| ^
drivers/net/ethernet/natsemi/macsonic.c: In function 'mac_sonic_nubus_ethernet_addr':
drivers/net/ethernet/natsemi/macsonic.c:360:34: error: assignment of read-only location '*(dev->dev_addr + (sizetype)i)'
360 | dev->dev_addr[i] = SONIC_READ_PROM(i);
| ^
drivers/net/ethernet/natsemi/macsonic.c:364:37: warning: passing argument 1 of 'bit_reverse_addr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
364 | bit_reverse_addr(dev->dev_addr);
| ~~~^~~~~~~~~~
drivers/net/ethernet/natsemi/macsonic.c:109:51: note: expected 'unsigned char *' but argument is of type 'const unsigned char *'
109 | static inline void bit_reverse_addr(unsigned char addr[6])
| ~~~~~~~~~~~~~~^~~~~~~
vim +317 drivers/net/ethernet/8390/mac8390.c
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 285
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 286 static bool mac8390_rsrc_init(struct net_device *dev,
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 287 struct nubus_rsrc *fres,
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 288 enum mac8390_type cardtype)
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 289 {
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 290 struct nubus_board *board = fres->board;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 291 struct nubus_dir dir;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 292 struct nubus_dirent ent;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 293 int offset;
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 294 volatile unsigned short *i;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 295
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 296 dev->irq = SLOT2IRQ(board->slot);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 297 /* This is getting to be a habit */
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 298 dev->base_addr = board->slot_addr | ((board->slot & 0xf) << 20);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 299
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 300 /*
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 301 * Get some Nubus info - we will trust the card's idea
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 302 * of where its memory and registers are.
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 303 */
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 304
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 305 if (nubus_get_func_dir(fres, &dir) == -1) {
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 306 dev_err(&board->dev,
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 307 "Unable to get Nubus functional directory\n");
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 308 return false;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 309 }
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 310
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 311 /* Get the MAC address */
8e4d9696b45d96 drivers/net/mac8390.c Joe Perches 2010-01-04 312 if (nubus_find_rsrc(&dir, NUBUS_RESID_MAC_ADDRESS, &ent) == -1) {
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 313 dev_info(&board->dev, "MAC address resource not found\n");
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 314 return false;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 315 }
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 316
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 @317 nubus_get_rsrc_mem(dev->dev_addr, &ent, 6);
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 318
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 319 if (useresources[cardtype] == 1) {
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 320 nubus_rewinddir(&dir);
8e4d9696b45d96 drivers/net/mac8390.c Joe Perches 2010-01-04 321 if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS,
8e4d9696b45d96 drivers/net/mac8390.c Joe Perches 2010-01-04 322 &ent) == -1) {
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 323 dev_err(&board->dev,
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 324 "Memory offset resource not found\n");
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 325 return false;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 326 }
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 327 nubus_get_rsrc_mem(&offset, &ent, 4);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 328 dev->mem_start = dev->base_addr + offset;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 329 /* yes, this is how the Apple driver does it */
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 330 dev->base_addr = dev->mem_start + 0x10000;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 331 nubus_rewinddir(&dir);
8e4d9696b45d96 drivers/net/mac8390.c Joe Perches 2010-01-04 332 if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_LENGTH,
8e4d9696b45d96 drivers/net/mac8390.c Joe Perches 2010-01-04 333 &ent) == -1) {
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 334 dev_info(&board->dev,
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 335 "Memory length resource not found, probing\n");
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 336 offset = mac8390_memsize(dev->mem_start);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 337 } else {
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 338 nubus_get_rsrc_mem(&offset, &ent, 4);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 339 }
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 340 dev->mem_end = dev->mem_start + offset;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 341 } else {
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 342 switch (cardtype) {
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 343 case MAC8390_KINETICS:
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 344 case MAC8390_DAYNA: /* it's the same */
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 345 dev->base_addr = (int)(board->slot_addr +
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 346 DAYNA_8390_BASE);
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 347 dev->mem_start = (int)(board->slot_addr +
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 348 DAYNA_8390_MEM);
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 349 dev->mem_end = dev->mem_start +
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 350 mac8390_memsize(dev->mem_start);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 351 break;
2964db0f590437 drivers/net/mac8390.c Finn Thain 2007-05-01 352 case MAC8390_INTERLAN:
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 353 dev->base_addr = (int)(board->slot_addr +
2964db0f590437 drivers/net/mac8390.c Finn Thain 2007-05-01 354 INTERLAN_8390_BASE);
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 355 dev->mem_start = (int)(board->slot_addr +
2964db0f590437 drivers/net/mac8390.c Finn Thain 2007-05-01 356 INTERLAN_8390_MEM);
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 357 dev->mem_end = dev->mem_start +
2964db0f590437 drivers/net/mac8390.c Finn Thain 2007-05-01 358 mac8390_memsize(dev->mem_start);
2964db0f590437 drivers/net/mac8390.c Finn Thain 2007-05-01 359 break;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 360 case MAC8390_CABLETRON:
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 361 dev->base_addr = (int)(board->slot_addr +
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 362 CABLETRON_8390_BASE);
494a973e229542 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 363 dev->mem_start = (int)(board->slot_addr +
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 364 CABLETRON_8390_MEM);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 365 /* The base address is unreadable if 0x00
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 366 * has been written to the command register
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 367 * Reset the chip by writing E8390_NODMA +
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 368 * E8390_PAGE0 + E8390_STOP just to be
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 369 * sure
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 370 */
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 371 i = (void *)dev->base_addr;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 372 *i = 0x21;
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 373 dev->mem_end = dev->mem_start +
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 374 mac8390_memsize(dev->mem_start);
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 375 break;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 376
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 377 default:
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 378 dev_err(&board->dev,
4a1b27c9e32c39 drivers/net/ethernet/8390/mac8390.c Finn Thain 2018-02-18 379 "No known base address for card type\n");
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 380 return false;
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 381 }
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 382 }
^1da177e4c3f41 drivers/net/mac8390.c Linus Torvalds 2005-04-16 383
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 384 return true;
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 385 }
f6de7acc42de90 drivers/net/mac8390.c Joe Perches 2010-01-04 386
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[android-common:upstream-f2fs-stable-linux-5.4.y 665/676] fs/ubifs/file.c:1644:16: error: passing argument 1 of 'ubifs_getattr' from incompatible pointer type
by kernel test robot
tree: https://android.googlesource.com/kernel/common upstream-f2fs-stable-linux-5.4.y
head: 0de6dec9da87fd1c8b99ad0643dab94f8a332004
commit: 0e764ea6471e002f101dd7726b6e97f0e55c2288 [665/676] ubifs: report correct st_size for encrypted symlinks
config: i386-randconfig-r015-20211117 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common upstream-f2fs-stable-linux-5.4.y
git checkout 0e764ea6471e002f101dd7726b6e97f0e55c2288
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
fs/ubifs/file.c: In function 'ubifs_symlink_getattr':
>> fs/ubifs/file.c:1644:16: error: passing argument 1 of 'ubifs_getattr' from incompatible pointer type [-Werror=incompatible-pointer-types]
1644 | ubifs_getattr(mnt_userns, path, stat, request_mask, query_flags);
| ^~~~~~~~~~
| |
| struct user_namespace *
In file included from fs/ubifs/file.c:40:
fs/ubifs/ubifs.h:1997:38: note: expected 'const struct path *' but argument is of type 'struct user_namespace *'
1997 | int ubifs_getattr(const struct path *path, struct kstat *stat,
| ~~~~~~~~~~~~~~~~~~~^~~~
fs/ubifs/file.c:1644:28: error: passing argument 2 of 'ubifs_getattr' from incompatible pointer type [-Werror=incompatible-pointer-types]
1644 | ubifs_getattr(mnt_userns, path, stat, request_mask, query_flags);
| ^~~~
| |
| const struct path *
In file included from fs/ubifs/file.c:40:
fs/ubifs/ubifs.h:1997:58: note: expected 'struct kstat *' but argument is of type 'const struct path *'
1997 | int ubifs_getattr(const struct path *path, struct kstat *stat,
| ~~~~~~~~~~~~~~^~~~
>> fs/ubifs/file.c:1644:34: warning: passing argument 3 of 'ubifs_getattr' makes integer from pointer without a cast [-Wint-conversion]
1644 | ubifs_getattr(mnt_userns, path, stat, request_mask, query_flags);
| ^~~~
| |
| struct kstat *
In file included from fs/ubifs/file.c:40:
fs/ubifs/ubifs.h:1998:9: note: expected 'u32' {aka 'unsigned int'} but argument is of type 'struct kstat *'
1998 | u32 request_mask, unsigned int flags);
| ~~~~^~~~~~~~~~~~
>> fs/ubifs/file.c:1644:2: error: too many arguments to function 'ubifs_getattr'
1644 | ubifs_getattr(mnt_userns, path, stat, request_mask, query_flags);
| ^~~~~~~~~~~~~
In file included from fs/ubifs/file.c:40:
fs/ubifs/ubifs.h:1997:5: note: declared here
1997 | int ubifs_getattr(const struct path *path, struct kstat *stat,
| ^~~~~~~~~~~~~
fs/ubifs/file.c: At top level:
>> fs/ubifs/file.c:1676:17: error: initialization of 'int (*)(const struct path *, struct kstat *, u32, unsigned int)' {aka 'int (*)(const struct path *, struct kstat *, unsigned int, unsigned int)'} from incompatible pointer type 'int (*)(struct user_namespace *, const struct path *, struct kstat *, u32, unsigned int)' {aka 'int (*)(struct user_namespace *, const struct path *, struct kstat *, unsigned int, unsigned int)'} [-Werror=incompatible-pointer-types]
1676 | .getattr = ubifs_symlink_getattr,
| ^~~~~~~~~~~~~~~~~~~~~
fs/ubifs/file.c:1676:17: note: (near initialization for 'ubifs_symlink_inode_operations.getattr')
cc1: some warnings being treated as errors
vim +/ubifs_getattr +1644 fs/ubifs/file.c
1639
1640 static int ubifs_symlink_getattr(struct user_namespace *mnt_userns,
1641 const struct path *path, struct kstat *stat,
1642 u32 request_mask, unsigned int query_flags)
1643 {
> 1644 ubifs_getattr(mnt_userns, path, stat, request_mask, query_flags);
1645
1646 if (IS_ENCRYPTED(d_inode(path->dentry)))
1647 return fscrypt_symlink_getattr(path, stat);
1648 return 0;
1649 }
1650
1651 const struct address_space_operations ubifs_file_address_operations = {
1652 .readpage = ubifs_readpage,
1653 .writepage = ubifs_writepage,
1654 .write_begin = ubifs_write_begin,
1655 .write_end = ubifs_write_end,
1656 .invalidatepage = ubifs_invalidatepage,
1657 .set_page_dirty = ubifs_set_page_dirty,
1658 #ifdef CONFIG_MIGRATION
1659 .migratepage = ubifs_migrate_page,
1660 #endif
1661 .releasepage = ubifs_releasepage,
1662 };
1663
1664 const struct inode_operations ubifs_file_inode_operations = {
1665 .setattr = ubifs_setattr,
1666 .getattr = ubifs_getattr,
1667 #ifdef CONFIG_UBIFS_FS_XATTR
1668 .listxattr = ubifs_listxattr,
1669 #endif
1670 .update_time = ubifs_update_time,
1671 };
1672
1673 const struct inode_operations ubifs_symlink_inode_operations = {
1674 .get_link = ubifs_get_link,
1675 .setattr = ubifs_setattr,
> 1676 .getattr = ubifs_symlink_getattr,
1677 #ifdef CONFIG_UBIFS_FS_XATTR
1678 .listxattr = ubifs_listxattr,
1679 #endif
1680 .update_time = ubifs_update_time,
1681 };
1682
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
[android-common:android12-5.10-2021-09 6729/10851] arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq'
by kernel test robot
Hi Marc,
FYI, the error/warning still remains.
tree: https://android.googlesource.com/kernel/common android12-5.10-2021-09
head: 0a07ca4e42c839ccc8cfcfa63078c9cb580c7d3b
commit: 1105b4d1cef4bc19ad20129a716194268c937eaf [6729/10851] BACKPORT: FROMGIT: KVM: arm64: Rework SVE host-save/guest-restore
config: arm64-buildonly-randconfig-r004-20211004 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c0039de2953d15815448b4b3c3bafb45607781e0)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android12-5.10-2021-09
git checkout 1105b4d1cef4bc19ad20129a716194268c937eaf
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/arm64/kvm/hyp/vhe/switch.c:8:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
arch/arm64/kvm/hyp/vhe/switch.c:227:17: warning: no previous prototype for function 'kvm_unexpected_el2_exception' [-Wmissing-prototypes]
asmlinkage void kvm_unexpected_el2_exception(void)
^
arch/arm64/kvm/hyp/vhe/switch.c:227:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void kvm_unexpected_el2_exception(void)
^
static
1 warning and 1 error generated.
--
In file included from arch/arm64/kvm/hyp/nvhe/switch.c:8:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
arch/arm64/kvm/hyp/nvhe/switch.c:282:17: warning: no previous prototype for function 'kvm_unexpected_el2_exception' [-Wmissing-prototypes]
asmlinkage void kvm_unexpected_el2_exception(void)
^
arch/arm64/kvm/hyp/nvhe/switch.c:282:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void kvm_unexpected_el2_exception(void)
^
static
1 warning and 1 error generated.
--
In file included from arch/arm64/kvm/hyp/nvhe/hyp-main.c:7:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
arch/arm64/kvm/hyp/nvhe/hyp-main.c:233:6: warning: no previous prototype for function 'handle_trap' [-Wmissing-prototypes]
void handle_trap(struct kvm_cpu_context *host_ctxt)
^
arch/arm64/kvm/hyp/nvhe/hyp-main.c:233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void handle_trap(struct kvm_cpu_context *host_ctxt)
^
static
1 warning and 1 error generated.
--
In file included from arch/arm64/kvm/hyp/nvhe/mem_protect.c:15:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
1 error generated.
vim +/sve_cond_update_zcr_vq +216 arch/arm64/kvm/hyp/include/hyp/switch.h
213
214 static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu)
215 {
> 216 sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
217 __sve_restore_state(vcpu_sve_pffr(vcpu),
218 &vcpu->arch.ctxt.fp_regs.fpsr);
219 write_sysreg_el1(__vcpu_sys_reg(vcpu, ZCR_EL1), SYS_ZCR);
220 }
221
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months
fs/proc/vmcore.c:443:42: warning: unused variable 'vmcore_mmap_ops'
by kernel test robot
Hi Nick,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42eb8fdac2fc5d62392dcfcf0253753e821a97b0
commit: 5640975003d0234da08559677e22ec25b9cb3267 RISC-V: Add crash kernel support
date: 7 months ago
config: riscv-buildonly-randconfig-r001-20211001 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 5640975003d0234da08559677e22ec25b9cb3267
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:88:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from fs/proc/vmcore.c:18:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:57:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from fs/proc/vmcore.c:18:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from fs/proc/vmcore.c:18:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from fs/proc/vmcore.c:18:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:61:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from fs/proc/vmcore.c:18:
In file included from include/linux/highmem.h:10:
In file included from include/linux/hardirq.h:10:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:1005:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> fs/proc/vmcore.c:443:42: warning: unused variable 'vmcore_mmap_ops' [-Wunused-const-variable]
static const struct vm_operations_struct vmcore_mmap_ops = {
^
8 warnings generated.
vim +/vmcore_mmap_ops +443 fs/proc/vmcore.c
9cb218131de1c5 Michael Holzheu 2013-09-11 442
9cb218131de1c5 Michael Holzheu 2013-09-11 @443 static const struct vm_operations_struct vmcore_mmap_ops = {
9cb218131de1c5 Michael Holzheu 2013-09-11 444 .fault = mmap_vmcore_fault,
9cb218131de1c5 Michael Holzheu 2013-09-11 445 };
9cb218131de1c5 Michael Holzheu 2013-09-11 446
:::::: The code at line 443 was first introduced by commit
:::::: 9cb218131de1c59dca9063b2efe876f053f316af vmcore: introduce remap_oldmem_pfn_range()
:::::: TO: Michael Holzheu <holzheu(a)linux.vnet.ibm.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months